Javascript 在map.data.loadGeoJson之后,圆圈的事件被Geo Json的多边形覆盖
在我通过map.data.loadGeoJson()加载Geo Json文件后,生成器和圆被多边形覆盖,无法单击它们的事件。 下面是示例代码。我该怎么办?还有没有其他方法可以禁用这些多边形的“可单击”功能?多谢各位Javascript 在map.data.loadGeoJson之后,圆圈的事件被Geo Json的多边形覆盖,javascript,json,google-maps,google-maps-api-3,Javascript,Json,Google Maps,Google Maps Api 3,在我通过map.data.loadGeoJson()加载Geo Json文件后,生成器和圆被多边形覆盖,无法单击它们的事件。 下面是示例代码。我该怎么办?还有没有其他方法可以禁用这些多边形的“可单击”功能?多谢各位 map.data.loadGeoJson(samplejson.json); // Add circle overlay and bind to marker var circle = new google.maps.Circle({
map.data.loadGeoJson(samplejson.json);
// Add circle overlay and bind to marker
var circle = new google.maps.Circle({
map: map,
radius: 1600, // 10 miles in metres
fillColor: fill_color_val,
strokeColor: '#F5F5F5',
strokeWeight: 2,
fillOpacity: 1,
});
var marker = new google.maps.Marker({
position: latlng,
title: data[i].Author,
draggable: false,
map: map
});
marker.setVisible(false);
circle.bindTo('center', marker, 'position');
var infoWindow = new google.maps.InfoWindow({
content: "<div>Hello! World</div>",
maxWidth: 500
});
google.maps.event.addListener(circle, 'click', getInfoCallback(latlng, 14));
map.data.loadGeoJson(samplejson.json);
//添加圆形覆盖并绑定到标记
var circle=new google.maps.circle({
地图:地图,
半径:1600,//10英里(米)
fillColor:fill_color_val,
strokeColor:“#f5”,
冲程重量:2,
不透明度:1,
});
var marker=new google.maps.marker({
位置:latlng,
标题:资料[i].作者:,
可拖动:错误,
地图:地图
});
marker.setVisible(假);
圆圈.bindTo('中心',标记,'位置');
var infoWindow=new google.maps.infoWindow({
内容:“你好!世界”,
最大宽度:500
});
google.maps.event.addListener(圈出'click',getInfoCallback(latlng,14));
将zindex用于地图无法覆盖的其他图层。数据您能否确认至少标记仍然可以单击?通过修改其zIndex属性,可以将其他覆盖层置于google.maps.Data层之上。加载GeoJSON()后,无法单击所有标记和圆圈。如何设置数据层的zIndex?