Dynamic change layer name
Hi
I have an issue to dynamic change layer display name. I use SetLayerProperty in the startup workflow. I can debug the process that hits handleSetLayerProperty, however the layer name isn't changed in the layer list.
Can you help me if I use correct the method or give me a example?
Thanks
Ying
0
-
Hi Yingnan,
The "SetLayerProperty" activity is not meant to change the layer name in the layer list. If this is what you want to do, then you can edit the layer name in Essentials Manager under Site > Map > Layer List Tab and double click on the name you wish to change.
The "Set Layer Property" activity is meant to change the settings of the layer like "showMapTip", "defaultVisibility", "maxScale", "minScale", "visible", "initiallyVisible", "identifiable", etc. You can change the display name of the layer as well using the "displayName" parameter in this activity, and the result will show up when the viewer calls for the layer name. For example, after you run the activity to change the layer name, you can perform an identify on that layer's features and the edited layer name will show up on the Tab in the Table View.
I hope this helps.
Carmen0 -
Thanks Carmen
I want to add date in the layer name dynamic because the layer data will be updated random.
I can get layer object by using getLayerById and update "DisplayName" property. However the layername isn't change in the layerlist, and it is changed in Legend. Is there any way to refreshe the layerlist?
Thanks
Ying0 -
We have a similar requirement for one of our viewers. Were you able figure out how to dynamically change the layer display name in the layer list? It would help us out if you are able to share the solution that you came up with for the issue. 0 -
Hi Tyson and Yingnan,
I did some research on this, but I'm sorry to say it's not currently possible. The layer list is presented from the REST endpoint, and is then read from the viewer when it loads. Since it's not dynamically generated, you can't alter it once the viewer loads.
I would suggest adding that to (https://support.geocortex.com/GSCIdeas?c=09a6000000008RsAAI&filter=1&categ=Geocortex%20Viewer%20for%20HTML5&type=html5&sub-nav=ideas&main-nav=essentials&page=1) the ideas section on the forums. If it gains enough traction, we may consider that feature in a future release of the product.0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
4 kommentarer