0

我正在尝试为每个状态创建折线轮廓和填充。我需要状态折线是可点击的。此外,当以更大的缩放级别查看时,填充看起来是零散的。有什么建议么?

见下面的代码:

function drawBorder(){
 var Polyline_Path = new google.maps.Polyline({
path: newyork,
strokeColor: "#CD0000",
// color of the outline of the polyline
strokeOpacity: 1,
// between 0.0 and 1.0
strokeWeight: 1,
// The stroke width in pixels
fillColor: "#CD0000",
fillOpacity: 1,
clickable: true
});
Polyline_Path.setMap(map);

google.maps.event.addListener(Polyline_Path, 'click', function() {   
alert('you clicked polyline');    
}); 
}

此代码确实可以使折线可单击,但仅在折线的非常特定区域中。有没有办法配置它来检测状态中任何地方的点击事件

4

1 回答 1

1

我改用了 google.maps.Polygon,它处理了碎片和可点击问题

于 2011-07-06T14:06:38.417 回答