how to find the "center" of Graphics Layer

2298
1
07-01-2014 12:11 PM
forestknutsen1
MVP Regular Contributor
It looks like I can call getExtent() to get a polygon of the extent of the layer. Next I would like to have the point that is the center of the extent so that I can pan to it with my map view? I have looked around and can not find a method that will do this (probably looking right past it in the API). Any help would be much apprenticed.

Thanks,

Forest
0 Kudos
1 Reply
ShellyGill1
Esri Contributor
You could try getting the rectangular extent of the Polygon, using queryEnvelope(Envelope), and then you can call getCenter() on that Envelope. There's no getCenter() on Polygon, so understandable to miss this I think.
0 Kudos