嗨,我将在我的网络应用程序中包含一个谷歌地图,我将使用标记。该地图完美运行,问题是出于安全原因我不希望人们能够进行最大缩放。我需要限制缩放,但我不知道怎么做。我不知道如何在javascript中做到这一点,有人可以帮忙吗?
这是我使用的脚本:
<script type="text/javascript">
var locations = [
['<b>Location:</b> England<br /><br /><b>Product:</b> ISIS Professional (1D)<br /><br /><b>Managing tidal flood risk</b>', 51.5171, 0.1062, 1] ];
var map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(47.754097979680026, 15.1171875),
zoom: 2,
mapTypeControl: true,
draggable: true,
scaleControl: false,
scrollwheel: false,
zoomControl: true,
navigationControl: false,
streetViewControl: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var image = 'img/pointer.png';
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map,
icon: image
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
</script>