Hi. I would like to configure my web map to support "feature=layerID;searchfield;searchvalue" parameter of the apps/Embed URL. It seems to be pretty straightforward until I want to search two layers within the same map service.
So, I set up a “By Layer” find location capability for each layer in the web map and it looks like this under the hood:
"search":{"enabled":true,"disablePlaceFinder":false,"hintText":"Place, Address, TIP#","layers":[{"id":"NCDOT_STIP_1732","field":{"name":"TIP","exactMatch":false,"type":"esriFieldTypeString"},"subLayer":0},{"id":"NCDOT_STIP_1732","field":{"name":"TIP","exactMatch":false,"type":"esriFieldTypeString"}
I think because the web map references the map service, the map service id is duplicated as the search layer id instead of creating unique ids. As a result, the URL does not find the feature in either layer. For example:
From what I can tell, in order to make this search work, I have to add the map service layers to the web map separately. However, the power of referencing a map service in a web map is that all layers are grouped together. I lose that if I add the layers separately (until AGOL supports service/layer grouping in the web map).
So, I’m wondering if anyone knows how to make the feature= capability work without referencing each layer separately in the web map.
I hope this makes sense. Thanks.
The app uses feature layers (individual sub layers) to search so the layers need to be added separately. One solution (although I realize its not optimal) might be to add the search layers individually with the visiblity turned off. I think the feature search should still work in this scenario.
Thank you for the quick reply and idea. Can you explain what you mean by turning the visibility off in a feature layer?
Thanks.
I just mean unchecking the check box next to the layer in the Web Map. So it would look like this:
Test App
Okay. I see. The map also needs to work in the AGOL map viewer. But I'll file the idea away.
Thanks again.