【发布时间】:2011-07-06 22:06:38
【问题描述】:
我正在尝试为每个状态创建折线轮廓和填充。我需要状态折线是可点击的。此外,当以更大的缩放级别查看时,填充看起来是零散的。有什么建议吗?
见下面的代码:
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');
});
}
此代码确实可以使多段线可点击,但仅在多段线的非常特定区域中。有没有办法配置它来检测状态中任何地方的点击事件
【问题讨论】:
-
此代码确实可以使折线可点击,但仅在折线的特定区域中。有没有办法配置它来检测状态中任何地方的点击事件
标签: google-maps-api-3 clickable polyline