ArcGIS javascript: graphicsUtils.graphicsExtent with one point feature

This applies to javascript developers using the ArcGIS Javascript API. If you’re using the graphicsUtils to get the extent of a set of graphics, you can use graphicsUtils.graphicsExtent. But if your set of features contains a single point, the extent returned is null. Which makes sense, but it took me a little while to figure this out. So check for the number of points (and whether they actually have a different location) before trusting this graphicsExtent function to operate correctly.

It’s a small thing, but hey, it might save you some time.

See https://developers.arcgis.com/javascript/jsapi/esri.graphicsutils-amd.html.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s