Skip to content

Instantly share code, notes, and snippets.

@ericchen
ericchen / auto_zoom_markers.js
Created July 5, 2013 09:53
Auto Zoom To Fit All Markers on Google Maps API v3
var LatLngList = new Array (new google.maps.LatLng (52.537,-2.061), new google.maps.LatLng (52.564,-2.017));
// Create a new viewpoint bound
var bounds = new google.maps.LatLngBounds ();
// Go through each...
for (var i = 0, LtLgLen = LatLngList.length; i < LtLgLen; i++) {
// And increase the bounds to take this point
bounds.extend (LatLngList[i]);
}
// Fit these bounds to the map
map.fitBounds (bounds);
<form action="http://eatlifewhole.us2.list-manage.com/subscribe/post?u=7508dbd4c8535093d08e46101&amp;id=21c70d21c5" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
<fieldset>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address </label>
<input type="text" value="Email Address" name="EMAIL" class="required email" id="mce-EMAIL" onfocus="if (this.value == 'Email Address') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Email Address';}">
</div>
<div><input type="submit" value="Sign Up Today!" name="subscribe" id="mc-embedded-subscribe" class="btn"></div>
<div id="mce-responses">
<div class="response" id="mce-error-response" style="display:none"></div>