开发者

google maps insertAt

开发者 https://www.devze.com 2023-04-13 09:35 出处:网络
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:

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

精彩评论

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

关注公众号