Aller au contenu principal

Are 'Get Layer' and 'Get Layer'Visibility' working?

Commentaires

8 commentaires

  • Permanently deleted user

    The issue with Get Layer was the Sub Layers always seemed to be null... (in the sample), but when i tried myself it seemed fine... (can't modify title of question)

    0
  • Stefan Schweigert

    Hello Ryan,

     

    Thanks for providing this information. We've been able to reproduce this issue and have filed an bug related to this behaviour. Your assumptions are correct as to the configuration. We are also looking into improving the documentation surrounding issues that use Layer and SubLayer Id fields.

     

    Thanks, Stefan

    0
  • Permanently deleted user

    Anyone looking for a work-around... Put this into a custom-module on the viewer-side...

    basically sends all visibility that you can loop through in the WF5...

     

     

    this.app.commandRegistry.command("SendLayerVisibilityToWorkflowUrl").register(this, (workflow_url) => {

    let layer_vis_array = []

    this.app.site.essentialsMap.allLayers().forEach(element => {

    layer_vis_array.push({

    ms_id: element.mapService.id,

    lyr_id: element.id,

    lyr_name: element.name,

    is_visible: element.isVisible()

    });

    });

     

    let args = {

    url: workflow_url,

    inputs: {

    layer_visibility_json: JSON.stringify(layer_vis_array)

    }

    }

    this.app.command("RunWorkflowByUrl").execute(args);

    });

    0
  • Permanently deleted user

    Hi Everybody,

     

    As another work around, I tried this and it worked.

    you can get the layer url out of Get Layer activity in an alert and manually add the sub layer id in the url.

    You can get the url in an alert with this command: =$layer1.layer.url.

    Your url will be something like: Https://<server>.<instance>/Geocortex/Essentials/<version>/REST/sites/<SiteName>/map/mapservices/<MapServiceID>/rest/services/x/MapServer/<LayerID>?Token.

    and then use this url hard-coded in another activity like Query.

     

    Best Regards.

    Adrian.

    0
  • Permanently deleted user

    I'm having problems with the "Get Layer" activity. Just to test it, I'm using a publicly accessible esri service - "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/0" - which I'm providing for the layer id parameter (leaving sub layer id blank). When I try to access the $layer1.layer.url, its undefined.

     

    Tried a few variations, with and without the sub layer, but no luck.

     

    Any thoughts on what I may be doing wrong?

     

    Thanks

    0
  • Stefan Schweigert

    Hi Zorba,

     

    If you add a Log activity after the Get Layer, and use =$layer1 as an input. When you run the workflow, open the browser console (F12) to view what values are set for the Get Layer. If there are no values set, check to make sure you are providing the correct Layer Id value.

     

    Let me know if this helps.

     

    Stefan

    0
  • Permanently deleted user

    User error. I was putting in incorrect input parameter. Got it sorted out. Thanks.?

    0
  • Christopher Wiebke

    To get the layer id for the set layer visibility command, I was able to use the get layer activity, then an alert activity with =$layer1.layer.id as the input.

    0

Vous devez vous connecter pour laisser un commentaire.