I list my users on the google maps based on their locations.
But I dont want it zoom in to a degree where others can see on what street they live.
Is there a way to disable “zoom in” feature in the following Google maps codes?
Thanks!
function initialize() {
var data = <%=Data%>;
var center = new google.maps.LatLng(48.404840395764175, 2.6845264434814453);
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 2,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var markers = [];
for (var i = 0; i < data.users.length; i++) {
var location = data.users[i];
var latLng = new google.maps.LatLng(location.latitude, location.longitude);
var marker = new google.maps.Marker({ position: latLng });
markers.push(marker);
}
var markerCluster = new MarkerClusterer(map, markers);
}
google.maps.event.addDomListener(window, 'load', initialize);
You can add
minZoomandmaxZoomproperties to the options object you pass to theMapconstructor:From the docs for
maxZoom: