var bounds = new google.maps.LatLngBounds();
bounds.extend(positionOfPlace);
bounds.extend(positionOfPlace);
map.fitBounds(bounds);
You can adjust zoom level according to the distribution of pin points. Make a variable bounds and initialize it. PositionOfPlace refers to the lat long of the center of the prefered map.
Simpply then set bounds using fitBounds.
Make sure you add this coding to head section of your web page.
No comments:
Post a Comment