Select to view content in your preferred language

Calculating Map Center

2573
2
Jump to solution
03-27-2013 09:08 AM
AaronConnolly
Regular Contributor
There seem to be 3 ways of calculating the map's center point. Which is the preferred way?

1. Using the center property on AGSMapView?
2. Using the visibleArea method's envelope then, center property?
3. Using the visibleAreaEnvelope's center property?

Thanks,
- Aaron
0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor
The center property is CGPoint of AGSMapView and is an inherited property of UIView so that you might not want. There is no center property on visibleArea. There is one on visibleArea.envelope.center, which is same as visibleAreaEnvelope.center.

You should use center property of visibleAreaEnvelope.

Regards,
Nimesh

View solution in original post

0 Kudos
2 Replies
NimeshJarecha
Esri Regular Contributor
The center property is CGPoint of AGSMapView and is an inherited property of UIView so that you might not want. There is no center property on visibleArea. There is one on visibleArea.envelope.center, which is same as visibleAreaEnvelope.center.

You should use center property of visibleAreaEnvelope.

Regards,
Nimesh
0 Kudos
AaronConnolly
Regular Contributor
Got it. Thanks Nimesh!
0 Kudos