pyt*_*981 18 google-maps google-maps-api-3
今天我注意到在特定区域中移除了最接近的可用缩放级别的卫星图像(它可能会影响其他区域,但我只关注一个明显受影响的区域).两天前有20级,现在只有19级.
MaxZoomService仍然表示此位置的最近可用缩放是20.但是当地图处于19级时,按+缩放按钮不会将缩放增加到20级.
是否有理由为什么我说它可用时不能放大到20级?
一些理论解释(均未经证实)包括:
(我不认为自上而下与倾斜的可用深度存在混淆,因为两者都锁定在第19级).
更新:
查看实时示例:https://jsfiddle.net/3qojzt76/
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map;
var latlng = {lat: 37.8768101, lng: -122.2813413}
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
mapTypeId: google.maps.MapTypeId.SATELLITE,
tilt: 0,
center: latlng,
zoom: 19
});
var mapZoomService = new google.maps.MaxZoomService()
mapZoomService.getMaxZoomAtLatLng(latlng, function(MaxZoomResult){
if(google.maps.MaxZoomStatus.OK){
alert('map.getZoom(): '+map.getZoom()+', MaxZoomResult.zoom: ' + MaxZoomResult.zoom)
}else{
alert('Error: in google.maps.MaxZoomService().getMaxZoomAtLatLng()')
}
})
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=&callback=initMap"
async defer></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)