Advanced JavaScript session for #Automattic-ians with the unstoppable @koop
Posted on Instagram 5:51 pm, September 11, 2012 jQuery(document).ready(function(){ var gmap_m3dc47fa24b6b9f17d47801c6c1e98099 = { positions : { 804 : new google.maps.LatLng( ‘32.790149071’, ‘-117.252331748’ ) }, bounds : new google.maps.LatLngBounds(), // empty for now, we’ll dynamically extend it later map : new google.maps.Map( document.getElementById( ‘gmap_m3dc47fa24b6b9f17d47801c6c1e98099’ ), { mapTypeId: google.maps.MapTypeId.ROADMAP, center: new google.maps.LatLng( 0, 0 ), zoom: 16 // Seems to be a good zoom for a single point } ), markers : {}, }; // end of gmap // Extend the bounds of interest based on our positions for ( var m in gmap_m3dc47fa24b6b9f17d47801c6c1e98099.positions ) { gmap_m3dc47fa24b6b9f17d47801c6c1e98099.bounds.extend( gmap_m3dc47fa24b6b9f17d47801c6c1e98099.positions[m] ); } // Render markers for ( var m in gmap_m3dc47fa24b6b9f17d47801c6c1e98099.positions ) { gmap_m3dc47fa24b6b9f17d47801c6c1e98099.markers[m] = new google.maps.Marker( { clickable: true, map : gmap_m3dc47fa24b6b9f17d47801c6c1e98099.map, position : gmap_m3dc47fa24b6b9f17d47801c6c1e98099.positions[m] } ); } // Redraw map to fit our new marker-based bounds gmap_m3dc47fa24b6b9f17d47801c6c1e98099.map.setCenter( gmap_m3dc47fa24b6b9f17d47801c6c1e98099.positions[804] ); });
