Have you waited for the MAP_READY event to be dispatched?  I'm pretty
sure that you'll get a 1009 error if you attempt to add an overlay to
a map that isn't yet ready.

Nick

On Jan 11, 12:18 pm, Marc <[email protected]> wrote:
> I'm having trouble getting a polygon constructed from an array of
> encoded polylines. Here is the code snippet I'm using:
>
>    (encoded strings previously defined in polygonSets array)
>
>    var encodedSets:Array = new Array();
>    polygonSets.forEach(addPolyline);
>
>    function addPolyline(element:*, index:int, arr:Array):void {
>            var encoded:EncodedPolylineData = new EncodedPolylineData(element,
> 32,"BBBBB",4);
>            encodedSets.push(encoded);
>    }
>
>    var myPolygon:Polygon = Polygon.fromEncoded(encodedSets, new
> PolygonOptions());
>    map.addOverlay(myPolygon);
>
> If I trace(encodedSets) there is an array of EncodedPolylineData
> objects, but I keep getting this error from the Polygon constructor
> call:
>
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
>
> Any ideas?
-- 
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