【发布时间】:2015-01-19 20:12:14
【问题描述】:
我在一个区域周围创建了一组标记,我想将它们连接在一起以创建一个多边形(并为其着色)。我的多边形代码:
var polygon = new google.maps.Polygon({
paths: points,
strokeColor: '#f33f00',
fillColor: '#ff99aa',
fillOpacity: 0.2
});
polygon.setMap(map);
我在哪里
var points = new Array();
points.push(new google.maps.LatLng(prev_dest.y, prev_dest.x));
.push 命令在 V3 中不再有效吗?以前这有效:
map.addOverlay(new GPolygon(points, "#f33f00", 5, 1, "#ff99aa", 0.2));
【问题讨论】:
-
请提供一个Minimal, Complete, Tested and Readable example 来证明这个问题。
标签: javascript google-maps-api-3 polygon