Select to view content in your preferred language

Graphic Layer Extent

3560
3
02-18-2011 01:35 PM
HeathClark
Occasional Contributor
Is it possible to gather the extent of all graphics added to a graphics layer (so I can set map extent to show all graphics on the layer)?  I have some c# code to process xmin/xmax of graphics being added (typically polygons) but its not efficient, just wondering if there is a GraphicsLayer.getExtent type function that I haven't stumbled across yet (or a map.graphicslayer.extent?).
0 Kudos
3 Replies
HeathClark
Occasional Contributor
Thanks for the quick response, however, the link provided doesn't work?
0 Kudos
derekswingley1
Deactivated User
Really? Works for me...but go to the documentation:  http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm

Click "esri Namespace Methods" then you want to look for esri.graphicsExtent(graphics). It takes an array of graphics as a parameter and returns an extent which you can pass to map.setExtent().
0 Kudos