Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var latlng = new google.maps.LatLng(38.269239, -122.276010);
- var myOptions = {
- zoom: 15,//Calculate this somehow?
- center: latlng,// Calculate value from array of coordinates?
- mapTypeId: google.maps.MapTypeId.HYBRID
- };
- var bounds = new google.maps.LatLngBounds();
- for (var i = 0; i < coordinates.length; i++) {
- bounds.extend(coordinates[i]);
- }
- bounds.getCenter();
- map.fitBounds(bounds);
- var bounds = new google.maps.LatLngBounds();
- polyline.getPath().forEach(function(e){//can't do polyline.getPath()[i] because it's a MVCArray
- bounds.extend(e);
- })
- _map.fitBounds(bounds);
- map.fitBounds(bounds);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement