sdi_loadservice
This bundle provides the functionality to display additional (preconfigured or custom) contents on
the map.
The widget role of the service loading dialog is sdi_loadservice
.
Configuration Reference
Property | Type | Mandatory | Default | Description |
---|---|---|---|---|
addToBottom |
Boolean | no | false | If true , a newly generated GroupLayer will be added to the bottom of the layers list, otherwise to the top. If loadServiceNodeId is set to an existing GroupLayer ID this parameter has no effect. |
collapsingThreshold |
Number | no | 10 | Defines the maximum amount of sublayers before the subtree will not be collapsed in the content selection step. |
favorites |
Array | no | [] | Defines a list of favorite map services, where each service entry has a name , a url , a type and a description (optional). If description is missing, the url will be displayed as description for the entry in the UI. You can organize the entries in categories. A category is an entry with a name and a children property. children must be an array containing the entries belonging to that category. Favorites can also be added through domain bundles. See the section Configure map service favorites in domain bundles for details. |
hiddenInputTabs |
Array | no | [] | Allows hiding of input tabs favorites or custom . If empty, all tabs are shown. |
initialInputTab |
String | no | undefined | Allows setting of initial active input tab. If given value is invalid the first tab will be active. |
maxDescriptionCharacters |
Number | no | 125 | Allows setting of maximum amount of characters in the description of favorite items. If the description length exceeds this length it will be cut and shortened by "...". Hovering over the description shows the whole description. |
maxOGCFeatureCountPerQuery |
Number | no | 5000 | Allows setting the maximum feature count to limit the number of features returned for a single query to a OGC Feature API. |
The following sample shows how this configuration is adjusted in the app.json
file:
{
"sdi_loadservice": {
"Config": {
"addToBottom": true,
"collapsingThreshold": 10,
"hiddenInputTabs": [
"custom"
],
"initialInputTab": "favorites",
"favorites": [
{
"name": "My category",
"description": "Description for this category",
"children": [
{
"name": "Vector tiles - World_Basemap_v2",
"description": "Esri basemap World_Basemap_v2",
"url": "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer",
"type": "AGS_VECTORTILE"
}
]
},
{
"name": "AGOL World Imagery",
"description": " World Imagery provides one-meter or better satellite and aerial imagery in many parts of the world and lower-resolution satellite imagery worldwide.",
"url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
"type": "AGS_DYNAMIC"
}
]
}
}
}
Constraints
- Web Map Tile Service (WMTS) sublayers can only be added to the map if the current SRS is supported by the service.
However, after adding the service it is possible to change the SRS (e.g. with
sdi_srschanger
).
Use Cases
Configure map service favorites in domain bundles
If you have a lot of map service favorites configured (using the favorites
property described above), managing those
favorites might become hard and confusing. Alternatively, you can configure your favorite map services in separate
domain bundles (see domains-system). Adding and removing map service from the favorites
list can then be performed by adding and removing domain bundles to your apps. The different favorites will be merged
into a single list in the load service dialog.
A domain bundle for this purpose consists of a single manifest.json
file with the following content:
{
"name": "domain-loadservice-example",
"version": "1.0.0",
"dependencies": {
"domains-system": "^4.14.0"
},
"main": "",
"layer": "",
"i18n": [],
"domain-config": {
"load-service-favorites": [
{
"name": "The name of the service",
"description": "Description for the service",
"url": "http://www.mymapservice.de/some-service",
"type": "WMTS"
}
]
}
}
Here, the map services are configured with the load-service-favorites
in the exact same format as in the favorites
property described in the table above.
You can assign an arbitrary name to the bundle (which is "domain-loadservice-example" in the example above), but please don't choose "domain-loadservice" as bundle name to avoid conflicts, because map.apps SDI already contains a bundle with that name. However, by convention domain bundles should have a prefix "domain", which makes it easy to distinguish them from other bundles in map.apps Manager.
Dynamically add layers via URL parameter add_layers
This bundle supports adding layers to the map that are encoded in the add_layers
URL parameter.
IMPORTANT: This feature requires the map.apps parametermanager
bundle.
Since the parametermanager
bundle is not loaded automatically, you'll need to add this bundle to the allowedBundles
list in your app.
Do not add the parametermanager
bundle to your app if you are using the sdi_appstatemanagement
bundle in the same app.
There are issues regarding the compatibility when running the parametermanager
bundle and the sdi_appstatemanagement
bundles at the same time in the same app.
If you require both features in the same app, it is recommended to migrate to the new version of app state management (those bundles with names beginning with sdi_appstate-*
).
Syntax
The syntax is defined as follows:
&add_layers=<type>:<url>[<ids>]
e.g. (not URL-encoded):
add_layers=AGS_DYNAMIC:https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer[0,2]
For <type>
insert any of the following service types:
WMS
, WMTS
, WFS
, AGS_DYNAMIC
, AGS_FEATURE
, INSPIRE_VIEW
, OGC_FEATURE
, AGS_SCENE
, AGS_VECTORTILE
Special cases
WFS
To add single types of a WFS service to the map, use the typenames of the WFS for the list of <ids>
. These must be URL encoded.
Example:
URL-encoded
add_layers=WFS:https://ahocevar.com/geoserver/wfs%5Bne%3Ane_10m_admin_0_boundary_lines_land%5D
URL-decoded
add_layers=WFS:https://ahocevar.com/geoserver/wfs[ne:ne_10m_admin_0_boundary_lines_land]
Open the load service dialog on startup and prepopulate it with a service
If you specify the serviceURL
parameter in the URL when starting the app, the load service dialog will be opened automatically on startup and the user is directly taken to the layer selection step.
The serviceURL
parameter must contain the URL of the service to be loaded. Here is an example:
http://example.com/mapapps/resources/apps/sdi_demo/index.html?lang=de&serviceURL=https://www.wms.nrw.de/geobasis/wms_nw_alkis
Please note that using the serviceURL
parameter requires the parametermanager
bundle to be loaded in the app.