There is reported bug about this issue...
http://code.google.com/p/gmaps-api-issues/issues/detail?id=666 :(

On Jun 3, 11:32 am, PetrKaleta <[email protected]> wrote:
> There must be some BUG in API, here is my code:
>
>                         var p2:Polygon = 
> polygons.getCountryData("FIN").getPolygon(); //
> Get polygon from encoded data
>                         _map.addOverlay(p2);
>
>                         if (p2.getInnerPolylineCount() > 0) { // If is 
> polygon created from
> many polylines
>                                 for (var lIdx:int = 0; lIdx < 
> p2.getInnerPolylineCount(); lIdx++)
> { // Get polylines count
>                                         for(var ivIdx:int = 0; ivIdx < 
> p2.getInnerVertexCount(lIdx); ivIdx
> ++) { // Get vertex count for each polyline
>                                                 
> polygonsBounds.extend(p2.getInnerVertex(lIdx, ivIdx)); // CRASH
> ON ERROR
>                                         }
>                                 }
>                         }
>                         else {
>                                 for (var ovIdx:int = 0; ovIdx < 
> p2.getOuterVertexCount(); ovIdx++)
> { // Get outer vertex count
>                                         
> polygonsBounds.extend(p2.getOuterVertex(ovIdx)); // Get current
> vertex
>                                 }
>                         }
>
> When I run this code for polygon which is created from some inner
> polylines, it crashes on p2.getInnerVertex(lIdx, ivIdx) with this
> exception:
>
> ReferenceError: Error #1069: Property copy not found on
> com.google.maps.LatLng and there is no default value.
>         at com.google.maps.overlays::Polygon/getInnerVertex()
>         at com.google.maps.wrappers::IPolygonWrapper/getInnerVertex()
>
> So I really don't understand what's going wrong :(
>
> On Jun 3, 10:40 am, PetrKaleta <[email protected]> wrote:
>
>
>
> > OMG, I know where is the problem. That Finland polygon is not just
> > "single" polygon = it is created from many small polygons... so I must
> > somehow calculate with each one... If I find some way I will post here
> > solution...
>
> > On Jun 3, 9:52 am, PetrKaleta <[email protected]> wrote:
>
> > > 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to