Grouping layers that have been added with "add layer to map"
Hello everyone,
we're using the activity "add layer to map" to add layers to our webmap on application startup:

While adding layers at a certain position using “index” is already very helpful, it would be even better if we somehow could add these layers to already existing groups, or even create new layer groups to add those layers to.
Does anyone know of a way to do this?
-
We solved this by, generally speaking, “adding some body of a WebMap.”
Simply put, the steps were as follows:
1. Create a WebMap with the layers and group layers
2. Note the WebMap's portal item
3. Send an HTTP request to the portal's REST interface and the WebMap's portal item
4. Parse the JSON and extract the OperationalLayers
(see https://developers.arcgis.com/web-map-specification/ )
5. Run a command with “map.add-layers” and the JSON as a parameter
In practice, there were additional sub-steps, and it was very time-consuming to set up the workflow. Finally, this approach allowed entire WebMaps (no tables, no basemaps) to be dynamically added (at runtime) to the Studio Web App.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar