Aller au contenu principal

Grouping layers that have been added with "add layer to map"

Commentaires

3 commentaires

  • Christian Ullmann

    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.

    1
  • Christian Ullmann

    For a minimum you could also just create the JSON for the “map.add-layers” command.

    The general JSON for a group layer construct can be found here:

    https://developers.arcgis.com/web-map-specification/objects/groupLayer/

    You can use that in a workflow like that:

    1
  • Andreas Grimm

    Thanks, Christian. 

     “map.add-layers” was our first approach, too, but unfortunately layers added this way don't honor pop-up settings. 

    0

Vous devez vous connecter pour laisser un commentaire.