how to use AddMapService command
Hi,
I'd like to use the AddMapService external command to add a layer to my layer list.
I've tried
Command Name "MapService"
Command Parameter "https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Petroleum/KGS_OilGasFields_Kansas/MapServer/0"
also tried the service and not the layer, so without /0. This is an esri sample service.
The only other layer I have in my site is OpenStreetMap
Nothing seems to happen.
Any suggestions?
Thank you,
Maria
0
-
Anyone?
I've found the constructor in the API, so would look for a Parameter for the AddMapService Command equivalent to
new MapService(url?: string): MapService0 -
Hi Maria,
If you check the documentation for the command (https://docs.geocortex.com/essentials/gvh/latest/commands-help/#/commands/Layer List/AddMapService) , you'll find that the parameter it needs is a Geocortex.Essentials.Client.MapService object. Unfortunately I don't think you'll be able to use this command in a workflow. Even if you're able to successfully create the MapService object, it won't be serializable, meaning you would get errors when you try to use it in client-side activities like RunExternalCommand.
If you know ahead of time the layers that could need to be added to the map, you could put them in a layer catalog, and add a reference to the catalog on the site. Adding layers from a layer catalog is definitely doable in a workflow; use the command "AppendCatalogLayers" with the string parameter catalogname.mapserviceid.layername
You might also want to post on the Ideas section (https://support.geocortex.com/GSCIdeas?c=09a6000000008RsAAI&filter=1&categ=all&sub-nav=ideas&main-nav=essentials&page=1) and request that we provide a command or workflow activity that adds a layer to the map and only requires the url as a parameter.
Hope that helps,
Amanda0 -
I had the same need to add a result map service from GPservices to the viewer. It would be great to be able to do it through workflow. I have created an idea here (https://support.geocortex.com/essentialsGSCIdeasDetail?c=09a6000000008RsAAI&id=087f2000000fxX6AAI&categ=all&sub-nav=ideas&main-nav=essentials) , please vote up. 0 -
Hello,
i can not add a layer using the "AppendCatalogLayers" command with the string parameter catalogname.mapserviceid.layername when the layer name contains dots or commas. Is any chance to add those layers from Layer Catalog in WorkFlow.
Thank you,
Marek0 -
Hi Malek,
This is a bug. Special characters can't be part of a layer name when using "AddCatalogLayer" or "AppendCatalogLayers" in a workflow. I will add your name as a stakeholder on this.
Thanks,Marion.
0 -
Hi Marion, I'd like to be added as a stakeholder. 0
Please sign in to leave a comment.
Comments
6 comments