I'm working with google maps javascript API and I need to get the bounds of the current viewport.
I tried to use map.getBounds();
then getNorthEast()...
etc. but the problem is that I need the North West, and the South East coordinates, not North East and South West.
Any way to get those bounds or "convert" the bounds that the API gives me to get North West and South East ?
Thank you
In the sample below you can extract the coords for North, East, South, and West
and you can use North West , South East
aNorth = map.getBounds().getNorthEast().lat();
aEast = map.getBounds().getNorthEast().lng();
aSouth = map.getBounds().getSouthWest().lat();
aWest = map.getBounds().getSouthWest().lng();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With