How to find the extent of the highlighted features on map?
In 3.x, there was a way to find extent of the highlighted (or selected by using FeatureLayer.selectFeatures()) features using graphicsUtils.graphicsExtent(selectedFeatures).
Is there a way to get the extent of the highlighted features in 4.x? Once I get an extent then I want to expand it based on user's settings. I can use goTo(selectedFeatures) but it doesn't seem to have any option to supply zoom factor to expand the extent.
Solved! Go to Solution.
Hi there,
I'd run queryExtent method on the layerView using the same expression requirements. This will return an extent of all features meet the criteria. Or you can do something similar in this example: https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-find-the-extent-of-an-ar...
Hi there,
I'd run queryExtent method on the layerView using the same expression requirements. This will return an extent of all features meet the criteria. Or you can do something similar in this example: https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-find-the-extent-of-an-ar...
Thanks @UndralBatsukh . queryExtent() has some limitations so I am avoiding it. But the url of the community post you shared looks good. I did not think of the callback of goTo() and expand it. I will try it and see how it goes, thanks for the help!