How to draw a polygon by encoded polyline, and encoded levels?
In documentation i don't see how to do it...

http://code.google.com/intl/it-IT/apis/maps/documentation/javascript/reference.html#PolygonOptions

I can draw a polygon from encoded polyline..
Passed argument "ret" its like this:
{"polylines" : [ {"polyline":"EncodedPolyline", "polygonNumber":1,
"EncodedLevels": "MYENCODEDLEVELS"} ] }

function PolylineToDraw(ret)
{
    var obj = eval("(" + ret + ")");
    var mpaths = [];
    var last = 1;
    for(i=0; i<obj.polylines.length; i++)
    {

mpaths.push(google.maps.geometry.encoding.decodePath(""+obj.polylines[i].polyline));
        if(last != obj.polylines[i].polygonnumber ||
i+1>=obj.polylines.length)
        {
            var cc = new google.maps.Polygon({
                paths: mpaths,
                strokeColor: "#0000FF",
                strokeOpacity: 0.8,
                strokeWeight: 2,
                fillColor: "#0000FF",
                fillOpacity: 0.35
            });
            cc.setMap(map);
            last = obj.polylines[i].polygonnumber;
            mpaths = [];
        }
    }
}

How to include Encoded Levels in drawing?


-- 
Stefano Tucci

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to