开发者

google maps insertAt

In V3 of the javascript api for the polygon array there is a func开发者_Python百科tion insertAt(), does anyone have an example of how this is used?


You need to create your MVCArray object:

pathCoords = new google.maps.MVCArray();

Then set up your map:

myPoly = new google.maps.Polyline({
    path: pathCoords,
    strokeColor: '#000000',
    strokeOpacity: 1,
    strokeWeight: 2
});
myPoly.setMap(map);

You can then insert latLng objects:

myPoly.getPath().insertAt(pathCoordinates.length, latLng);


http://code.google.com/apis/maps/documentation/javascript/maptypes.html#MapTypeInterface

http://code.google.com/apis/maps/documentation/javascript/examples/maptype-overlay.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜