有没有办法将 infoWindow 添加到由 google.maps.Circle 创建的圈子中
像这样的东西
var circ = new google.maps.Circle({
center:latlng,
clickable:false,
fillColor:colors[count],
fillOpacity:0.3,
map:map,
radius:radius,
strokeColor:colors[count],
strokeOpacity:0.3});
和
//create info window
var infoWindow= new google.maps.InfoWindow({
content: "Your info here"
});
//add a click event to the circle
google.maps.event.addListener(circ, 'click', function(){
//call the infoWindow
infoWindow.open(map, circ);
});
或者有一种方法可以在圆的中心创建一个不可见的标记,可以点击它来访问 infoWindow