Change Viewer Display according to Query Results in HTML5 Viewer
I have a query running based on a form, and I'd like to have the viewer zoom to the extent of the results and highlight the features, but can't find a way to make it work.
My query will successfully return features that will show up in a "Show Results" list, and my query has return geometry = true, but I'm unable to get the display on the map to change in any way. I've tried using Set Map Extent > Get Symbol from JSON > Set Feature Symbol > Add Graphics Layer Features, and Run Command with various highlight commands, but nothing is working, not even the Set Map Extent.
When I perform a simple query in the actual viewer though, it will zoom to the features and the results show up highlighted just fine.
What is the best way to do this in a workflow? Is it possible that I'm missing some setting in my map service that is not allowing it?
Thanks for your help!
-
We're using Buffer Geom > Get Geom Extent > Run Command "ZoomToExtent" to zoom. I'm not highlighting anything right now but don't see why it wouldn't work on the featureset returned from your queries. For our purposes, the builtin "feature focus" on each item of the results list has been sufficient for now, though I'm sure that we'll need highlights sooner than later in addition to the extent.
0 -
I found that I had to include the spatial reference in my query to the REST endpoint. It had to be set to 102100 (ESRI Web Mercator) for me and then it would zoom and highlight the results.
0 -
Thank you so much DDS and Matthew Ryan... you solved both my Zoom issue and my Highlight issue! Greatly appreciated!
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare