在KMZ层顶部显示Groundoverlay

时间:2016-01-07 19:19:59

标签: javascript google-maps-api-3

我正在使用Google Maps API JavaScript库。我试图在KMZ图层上显示Groundoverlay图像。无论我尝试什么,KMZ层都会保持在顶部,阻挡我的Groundoverlay图像。

我已经注意到,无法为地面覆盖指定zIndex。任何帮助将非常感谢。以下是说明问题的javascript代码:

<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
zoom: 14,
center: {lat: 51.92123061150897, lng: 4.482456756591775}
});

var ctaLayer = new google.maps.KmlLayer({
url: 'http://bit.ly/1PjfdTp',
map: map, 
preserveViewport: true
});

var doctorbounds = {
north: 51.911766,
south: 51.909567,
east:  4.469100,
west:  4.466565
};

var doctorpicture = new google.maps.GroundOverlay(
'http://bit.ly/1mIHLPG',
doctorbounds);
doctorpicture.setMap(map);
}
</script>

1 个答案:

答案 0 :(得分:0)

可以使用geoxml3完成,如Vadim Gremyachev对this question (Geoxml3 groundOverlay zIndex)的回答所述。

(请注意,所有KML文件都必须位于同一个域中才能与geoxml3一起使用或通过代理访问)。

working link