There must be bug or something, because if I use this code:
var polygons:CountryPolygons = new CountryPolygons();
var polygonsBounds:LatLngBounds = new LatLngBounds();
var p1:Polygon =
polygons.getCountryData("CZE").getPolygon();
_map.addOverlay(p1);
for(var i:int = 0; i < p1.getOuterVertexCount(); i++) {
polygonsBounds.extend(p1.getOuterVertex(i));
}
var p2:Polygon =
polygons.getCountryData("FIN").getPolygon();
_map.addOverlay(p2);
for(var j:int = 0; j < p2.getOuterVertexCount(); j++) {
polygonsBounds.extend(p2.getOuterVertex(j));
}
_map.setCenter(polygonsBounds.getCenter(),
_map.getBoundsZoomLevel
(polygonsBounds), _map.getCurrentMapType());
the result is same like in my previous example = p1 (czech republic)
is focused, but p2 (Finlad) is not focused compleatly. What's wrong?
On Jun 2, 7:32 pm, Mathew Thomas <[email protected]> wrote:
> I saw a method in the demo section that does polylines that Pam wrote --
> needs to be modified -- with getoutervertices -- or something to that effect
> -- but it was an easy change
>
>
>
> On Tue, Jun 2, 2009 at 12:54 PM, PetrKaleta <[email protected]> wrote:
>
> > Hi I am working with encoded polygons and polylines. Is there any way
> > to calculate LatLngBounds of all polygons & polylines = zoom to fit
> > all of them.
>
> > TY
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---