Select to view content in your preferred language

How to determine current XY of Map's Center?

1182
2
Jump to solution
01-04-2013 06:51 AM
EdwardHinkle
Occasional Contributor
Hi,

I've read extensively through the API and various resources. I've done some great and unordinary things with the API but I can't seem to figure out how to detect the center of the map. The reason is I need to be able to resize the map and keep the center of the map as the center of the map despite the resizes and changes.

Currently when I resize the map, it adds more map space or remove map space on the size that is resized. I know I can use .centerAt() to center the map, however I need the X, Y from the current map center before the resize so I can re-center after the resize.

Thanks!

Eddie
0 Kudos
1 Solution

Accepted Solutions
JohnGravois
Deactivated User
you should be able to use getCenter() and pass the map extent.

View solution in original post

0 Kudos
2 Replies
JohnGravois
Deactivated User
you should be able to use getCenter() and pass the map extent.
0 Kudos
EdwardHinkle
Occasional Contributor
Perfect!! Thanks 🙂
0 Kudos