toggle layer on/off from feature description
Is there an existing command to toggle on/off the visibility of a layer from the feature description? or does it have to be executed as a workflow?
ie.
I am indicating a Right of way on a parcel by a Yes or No in the featuere desription. it would nice to have a "hyperlink" to toggle on/off the layer. Something like this;
Right of Way on Site: Yes (Turn off/on ROW layer)
-
Have you tried the ToggleLayerVisibility command?
0 -
Hi John,
Not sure how the syntax should be?
<a href="ToggleVisibilityLayer ????????????">turn on/off layer</a>
anyone? examples please?
Ken
0 -
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 -
Thx John,
I tried this and it didn't work.
<p><a href="command:ToggleLayerVisibility?(38,6)">Toggle Layer</a> </p>
0 -
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.
Kommentare
5 Kommentare