Aller au contenu principal

Popup is not displayed correctly with command “map.add-layers”

Commentaires

5 commentaires

  • Yannick Mijnheer

    Please add this as an idea, I'll vote for it :) I've been running into the same issue, which made it hard for me to decide which route to pick (the command through a Workflow, or the “Add from Portal”-function). I preferred the Workflow-flexibility.

    Luckily I found a work around. With the command mapp.add-layers you can also add a layerDefinition (see here). The trick is to go into AGO-assistant, find the json of the service, within that JSON find the layerDefinition, and then copy it and add it to the command parameter in your Workflow. The argument should then look something like this:

    ={ "layers": [ 
    {
    "layerType": "ArcGISFeatureLayer",
    "url": "https://xxx/MapServer/0",
    "title": "LayerName 2025",
    "opacity": 0.5,
    "layerDefinition": {....}
    }
    ] }

    This also gives you the flexibility to change the symbology and the maptips on the fly, even if you don't host the service yourself. When using it this way (with external services) my advice is to add them to a WebMap, configure the symbology and maptips as you like, and then get the layerDefinition from the JSON of the WebMap through AGO-assistant (instead of the service itself).

    Anyway, this is a cumbersom workaround, and I think it would be a great idea if the standard would be that the command applies the layerDefinition of the service.

    Good luck! Yannick

    0
  • Franco Di Bari

    Hello Yannick,
    thank you very much for the idea. I will definitely give it a try.
    We have hosted our services ourselves, so we can access them easily.

    It is a possibility but the original problem remains. Something must be different in the workflow command “maps.add-layers” than in Studio Web, although it is the identical command. The popups just get lost, the rest is there.

    Thanks again for aour help and idea

    0
  • Franco Di Bari

    Hello everyone,
    we have now found a solution.
    In Vertigis Studio Workflow there is an activity pack “ArcGIS Maps SDK for Javascript”. Here there is an activity “Create layer from Portal Item”. If this activity is used first and then the activity “add layer to map”, the popups are also displayed correctly.

    At first we used the command “maps.add-layers”, which did not work.
    I hope this helps anyone who has a similar problem.

     

     

    Best regards

    Franco

    0
  • Zorba Conlen

    Hi Franco,

    I tried your suggestion and it works pretty well, but one thing I noticed is that the ‘Remove Layer’ command is not present in the context menu for the newly added layer. Therefore, users don't have an ability to remove the layer if they choose. That differs from the behavior when using the command to add a layer.

    Should see it like this but that option is missing

    Are you seeing this behavior also?

    0
  • Franco Di Bari

    Hello Zorba,

    Yes, I am experiencing the same “error”. The button to remove the layers is missing. I haven't even noticed that yet. Unfortunately, I don't know how to activate it.

    best regards

    Franco

    0

Vous devez vous connecter pour laisser un commentaire.