0

I'm working with the Flash Api for Google Maps in my Actionscript/Air project. I now need the latLngBounds (the top left, top right, bottom right and bottom left) values of the current view of the map. The function map.getLatLngBounds should do that, but it always gives me a really low lat/lng bounds back.

Always somewhere around:

MapBounds{ lat: { hi: 0.8147270895329215 , low: 0.814011505887222 }, lng: { hi: 0.19547530117504353, low: 0.19447761445167258 } }

It's always between 1 and -1. It that how it should be? If it is, How do I use that LatLngBound to determine if a certain LatLng (for example { lat: 47.315383, lng: 12.750291 }) lies inside the boundary?

http://code.google.com/intl/nl-NL/apis/maps/documentation/flash/reference.html#IMap.getLatLngBounds

Peter O.
  • 32,158
  • 14
  • 82
  • 96
Terrabythia
  • 2,031
  • 3
  • 19
  • 29
  • Ok. I've learned that the lat/lng hi and low values don't really say anything. If i trace for example getNorth(), I do get the right top lat-value. But still: the function latLngBounds.containsLatLng() ALWAYS returns false, even when I'm sure the latLng lies within the LatLngBound. – Terrabythia Feb 29 '12 at 15:13

1 Answers1

0

It's been a while since I've worked with Google Maps Flash API, so I don't remember as much as I'd like to be able to help with this question, but based on what you said, you can try creating a new LatLngBound with the getNorth() functions so that you are checking against the right values instead. It's merely a workaround, and I'm not even sure it will work.

Google map coordinates are not always intuitive though. You might want to look at some of the methods that translate coordinates. It's most likely returning what it thinks is correct based on the zoom level and viewport, but not what you would expect. I'll update this post later if I think of something else.

Mark Ursino
  • 31,209
  • 11
  • 51
  • 83
rcheuk
  • 1,140
  • 1
  • 12
  • 32