我在使用Google Maps API和KML文件时遇到了一个奇怪的问题。当我用KML初始化地图时,一切都很顺利。但是问题来了:当我将地图缩放到级别10时,KML层发生了反转。
下面是示例:
希望有人能够帮助我。
敬礼, M.
下面是示例:
var settings,map,marker,infowindow,consultant_fname,consultant_lname,consultant_zip,consultant_city,mapOptions;
var markers = [];
$(document).ready(function(){
mapOptions = {
zoom: 8,
center: new google.maps.LatLng(47.643186, 13.760376),
scrollwheel: false,
mapTypeControl: false,
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
position: google.maps.ControlPosition.RIGHT_TOP
},
scaleControl: true,
streetViewControl: false,
panControl:true,
panControlOptions : {
position: google.maps.ControlPosition.RIGHT_TOP
},
};
map = new google.maps.Map(document.getElementById('gmap'),mapOptions);
var ctaLayer = new google.maps.KmlLayer('https://www.creditnet.at/austria_3.kml',{
preserveViewport: true,
suppressInfoWindows: true,
map: map,
});
ctaLayer.setMap(map);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<div id="gmap" style="width:700px;height:700px;"></div>
敬礼, M.