Hello everyone,
I'm trying to start the map at a zoom level of 16, then get the bounds
of the visible area at that zoom level. I want to then apply the lat/
long of the upper left, upper right, lower left, and lower right
corners of the visible area to their respective navigational
directions (northeast, etc.). Once I have that information, I want to
draw a polygon based on those coordinates.
My issue starts at the beginning: determining the lat/long of the
corners! All I have to go by really is the center of the current view
and the zoom level it's at. The closest I've come is this:
private function setScene():void {
var bounds:LatLngBounds = new LatLngBounds();
var northEast:LatLng = bounds.getNorthEast();
var northWest:LatLng = bounds.getNorthWest();
var southEast:LatLng = bounds.getSouthEast();
var southWest:LatLng = bounds.getSouthWest();
var polygon:Polygon = new Polygon([
northWest,
northEast,
southEast,
southWest,
northWest], new PolygonOptions({
fillStyle: {
color: 0xff0080,
alpha: 0
},
strokeStyle: {
thickness: 3,
color: 0xFF0000,
alpha: 1,
pixelHinting: true
}})
);
this.map.clearOverlays();
this.map.addOverlay(polygon);
}
This creates some nonsense lat/long coordinates that essentially draws
a polygon around the entire planet. I traced the zoom level and it
says it's at 2.
I think this would work smoothly if I already had Lat/Long coordinates
to put in for the LatLngBounds function, but I would need those to be
put in dynamically depending on what the center of the map is.
I've tried all sorts of crazy things to get this to work, but I can't
find much documentation on most of it. If anyone can help me out, I'd
greatly appreciate it!
- Owen
PS - if anyone knows how to restrict zoom levels to a certain range
(say 16 - 20), that would also help me out a lot!
--
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en.