Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var bounds = new google.maps.LatLngBounds();
- cities.forEach(function (value, index) {
- var myLatLng = new google.maps.LatLng(value.lat, value.lng);
- bounds.extend(myLatLng);
- var marker = new google.maps.Marker({
- position: myLatLng,
- map: map,
- title: "My Town"
- });
- });
- map.fitBounds(bounds);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement