Hi there,
I'm trying to create a function that performs a query on the map based in the current map.graphics.
Is there an easy way to add map.graphics to the geometry parameter, besides going trough the map.graphics.graphics array to find the extents?
Thanks
geometries = esri.getGeometries(map.graphics); geometryService.union(geometries, function(geometry){ query.geometry =geometry; ... });
geometries = esri.getGeometries(map.graphics); geometryService.union(geometries, function(geometry){ query.geometry =geometry; ... });
esri.graphicsExtent(map.graphics.graphics)
Thanks for your response, but I accomplished the some thing (I think) using:esri.graphicsExtent(map.graphics.graphics)
It seems to work fine, but can you tell me the difference between this solutions and yours?
your approach used the extent of map.graphics.graphics as query.geometry while mine merged map.graphics.graphics into one geometry and used that geometry as query.geometry.
Ok, I understood that part, but I was wondering what's the best approach, and if the final result will be the same.
The result may or may not be the same. For example a point which may be within the extend of a polygon may actually outside that polygon.