How to test dependency widget with a sample widget?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
Hello Community,
I have created below dependency widget:
The baseline widget makes use of a JavaScript library called OpenLayers. See https://openlayers.org/.
Requirements
1. Setup Widget Dependency
First we will setup the dependency, JS include, CSS include, UI script, and style sheet.
Create Widget Dependency [sp_dependency]
Name: "OpenLayers v10.7.0"
JS Includes: <create new, see below>
CSS Includes: <create new, see below>
Create JS Include [sp_js_include]
Display name: "ol.js"
Source: UI Script
UI script: <create new, see below>
Create CSS Include [sp_css_include]
Name: "ol.css"
Source: Style Sheet
Style sheet: <create new, see below>
Create UI Script [sys_ui_script]
API Name: "ol.js"
UI Type: All
Script: copy and paste contents from
https://cdn.jsdelivr.net/npm/ol@v10.7.0/dist/ol.js
Create Style Sheet [sp_css]
Name: "ol.css"
CSS: copy and paste contents from
https://cdn.jsdelivr.net/npm/ol@v10.7.0/ol.css
Turn off SCSS compilation: true
2. If This Does Not Work
It may be that the minified ol.js will not work as a UI script for some reason. If that is the case, we can apply the following workaround:
Change JS Include
Display name: "ol.js"
Source: URL
JS file URL:
https://cdn.jsdelivr.net/npm/ol@v10.7.0/dist/ol.js
Change CSS Include
Name: "ol.css"
Source: URL
CSS file URL:
https://cdn.jsdelivr.net/npm/ol@v10.7.0/ol.css
Sample widget created for testing:
HTML:
<div>
<h3>Dependency Test</h3>
<div id="map" style="height:400px;"></div>
</div>
Client:
I have tried above methods
