Changeset 12706 for extensions/rv_gmaps/trunk/template/map.tpl
- Timestamp:
- Dec 8, 2011, 10:36:35 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/template/map.tpl
r12701 r12706 7 7 <title>{$GALLERY_TITLE}</title> 8 8 9 <script src="http://maps.googleapis.com/maps/api/js?sensor=false&language={$lang_info.code} " type="text/javascript"></script>9 <script src="http://maps.googleapis.com/maps/api/js?sensor=false&language={$lang_info.code}&libraries=places" type="text/javascript"></script> 10 10 11 11 {combine_script id='jquery' load='header' path='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'} … … 51 51 if (console) 52 52 { 53 console.log(msg + " b="+map.getBounds().toUrlValue() + " c="+map.getCenter().toUrlValue() + " z="+map.getZoom() ); 53 var b = map.getBounds(); 54 if (b) 55 console.log(msg + " b="+b.toUrlValue() + " c="+map.getCenter().toUrlValue() + " z="+map.getZoom() ); 56 else 57 console.log(msg); 54 58 } 55 59 } … … 111 115 112 116 map.pwgDataLoader.start( "{/literal}{$U_MAP_DATA}{literal}" ); 117 118 var ac = new google.maps.places.Autocomplete( document.getElementById('q') ); 119 ac.bindTo('bounds', map); 120 google.maps.event.addListener(ac, 'place_changed', function() { 121 var place = ac.getPlace(); 122 if (place.geometry.viewport) { 123 map.fitBounds(place.geometry.viewport); 124 } else { 125 map.setCenter(place.geometry.location); 126 map.setZoom(17); // Why 17? Because it looks good. 127 } 128 } ); 113 129 } 114 130 … … 198 214 </a> 199 215 <span class="gmnoprint"> 200 <form action="#" onsubmit="if (this.q.value!='' && this.q.value!='{'Search a location...'|@translate|@escape:javascript}') searchLocation(this.q.value);return false;"> 201 <input type="text" size="32" name="q" 202 value="{'Search a location...'|@translate}" 203 onfocus="if (value=='{'Search a location...'|@translate|@escape:javascript}') value='';" 204 onblur="if (value=='') value='{'Search a location...'|@translate|@escape:javascript}'" /> 205 <input type="submit" value="{'Search'|@translate}"/> 206 </form> 216 <input type="text" size="48" id="q" /> 207 217 </span> 208 218 </div>
Note: See TracChangeset
for help on using the changeset viewer.