Zum Hauptinhalt gehen

toggle layer on/off from feature description

Kommentare

5 Kommentare

  • John Nerge

    Have you tried the ToggleLayerVisibility command?

    0
  • Permanently deleted user

    Hi John,

    Not sure how the syntax should be?

    <a href="ToggleVisibilityLayer ????????????">turn on/off  layer</a>

    anyone? examples please?

    Ken

     

    0
  • John Nerge

    Here's the arguments description from the GVS admin guide:

    Requires a Tuple of two strings.

     

    The first is the ID of the map service.

     

    The second is the ID of the layer to be toggled. For example:

     

    CommandRegistry.GetCommand("ToggleLayerVisibility").Command.Execute(Tuple.Create("mapserviceid", "layerid"));

    Fyi, it also notes that it can't be used in a workflow.

    I haven't actually used the command before, so I don't know the syntax. Maybe something like this?

    <a href="command:ToggleLayerVisibility?(mapserviceid,layerid)">Toggle Layer</a> 

    0
  • Permanently deleted user

    Thx John,

    I tried this and it didn't work.

    <p><a href="command:ToggleLayerVisibility?(38,6)">Toggle Layer</a> </p>

     

     

     

     

     

    0
  • Permanently deleted user

    Hi Kenneth,

    Unfortunately you can't use the command ToggleLayerVisibility from the feature description. The best way to do this would be with a workflow, and then run that workflow from the feature description. You can create a generic workflow that accepts as  parameters the Map Service ID and the Layer Name and then toggles the visibility of that layer using the "Get layer visibility" and "Set layer visibility" activities.

    You can invoke the workflow from the feature description and pass parameters by doing:

    <p><a href="command:RunWorkflowWithArguments?workflowId=ToogleLayerVisibilityWorkflow&MapServiceID=3&LayerName=Parcels">Toggle Layer</a> </p>

    -Alejandro

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.