Select to view content in your preferred language

Using Feature Search in Embed Map URL

1951
4
02-02-2016 09:51 AM
MaryEllen_Perko
Frequent Contributor

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:

http://www.arcgis.com/apps/Embed/index.html?webmap=cb02f4f828974670ad01bb83be91b18c&feature=NCDOT_ST...

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.

0 Kudos
4 Replies
KellyHutchins
Esri Frequent Contributor

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.

MaryEllen_Perko
Frequent Contributor

Thank you for the quick reply and idea.  Can you explain what you mean by turning the visibility off in a feature layer?

Thanks.

0 Kudos
KellyHutchins
Esri Frequent Contributor
0 Kudos
MaryEllen_Perko
Frequent Contributor

Okay.  I see.  The map also needs to work in the AGOL map viewer.  But I'll file the idea away.


Thanks again.

0 Kudos