Changeset 8501 for extensions/edit_gmaps/admin/js
- Timestamp:
- Jan 7, 2011, 6:13:48 PM (13 years ago)
- Location:
- extensions/edit_gmaps/admin/js
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/edit_gmaps/admin/js/JScript.js
r8466 r8501 9 9 function onLoad() { 10 10 var reg = new RegExp('/', "g"); 11 12 coordinates.ADRESSE= coordinates.ADRESSE.replace("/",", "); 11 12 if (coordinates.ADRESSE) 13 coordinates.ADRESSE = coordinates.ADRESSE.replace("/", ", "); 13 14 14 15 document.getElementById("match").value = coordinates.ADRESSE; 15 16 geocoder = new google.maps.Geocoder(); 16 17 var mapElement = document.getElementById("map"); 17 if ( coordinates.LAT <= 90 ) { 18 19 n = coordinates.ADRESSE.indexOf("/"); 20 if (n>0) 21 zoom = 5; 22 else 23 zoom = 18 ; 18 if (coordinates.LAT <= 90 && coordinates.LAT != " " && coordinates.LAT != "" ) { 19 24 20 } else { 25 21 coordinates.LAT=49 ;coordinates.LON = 3; 26 22 coordinates.ZOOM = coordinates.ZOOM | 18; 27 23 geocoder.geocode({ 'address': coordinates.ADRESSE }, function (results, status) { 28 24 /* Si l'adresse a pu être géolocalisée */ … … 36 32 } 37 33 }); 38 39 zoom = 4;34 35 40 36 } 41 37 zoom = coordinates.ZOOM; 42 38 LatLng = new google.maps.LatLng(coordinates.LAT, coordinates.LON); 43 39 … … 113 109 document.Envoie.lat.value=latLng.lat() ; 114 110 document.Envoie.lon.value = latLng.lng(); 111 115 112 116 113 } 117 114 118 function updateMarkerAddress(str) { 119 document.getElementById('markerAdress').innerHTML = str; 120 115 function updateMarkerAddress(str) { 116 document.getElementById('markerAdress').innerHTML = str; 117 118 jQuery("#match").val(str); 121 119 } 122 120 … … 161 159 } 162 160 }); 163 } 164 165 166 167 168 jQuery().ready(function () { 169 170 171 jQuery('.cluetip').cluetip({ 172 width: 300, height: 100, 173 splitTitle: '|' 174 } 161 } 162 163 //======================================================= 164 function On_Click(a, b, c) { 165 document.Envoie.lat.value = b; 166 document.Envoie.lon.value = c; 167 168 coordinates = {LAT:a, 169 LON : b} ; 170 LatLng = new google.maps.LatLng(coordinates.LAT, coordinates.LON); 171 updateMarkerPosition(LatLng); 172 173 174 } 175 176 jQuery(window).load( 177 178 function () { 179 //Récupérer tous les inputs radios appartenant à un même groupe 180 /* a = jQuery('input[type=hidden][name=Selectthumbnail]'); 181 b = a.length; 182 c = jQuery('input[type=hidden]:checked').length; 183 d = jQuery('input[type=hidden][name="Selectthumbnail"]').attr('value'); 184 */ 185 186 // onLoad(); 187 }); 188 189 jQuery(document).ready(function () { 190 191 192 jQuery('.cluetip').cluetip({ 193 width: 300, height: 100, 194 splitTitle: '|' 195 } 175 196 ); 176 177 // Resize possible 178 jQuery("#cadre").resizable({ 179 handles: "all", 180 animate: true, 181 animateDuration: "slow", 182 animateEasing: "swing", 183 preventDefault: true, 184 preserveCursor: true, 185 autoHide: true, 186 ghost: true 187 }); 188 189 jQuery("#match").keydown(function (e) { 190 191 // e.target pour FireFox 192 // event.srcElement pour IE 193 var Obj = e ? e.target : event.srcElement; 194 if (Obj.tagName != "INPUT") return false; 195 196 197 var Code = e.keyCode || e.which; 198 if (Code != 13) return true; 199 coordinates.ADRESSE= document.getElementById("match").value ; 200 codeAddress(); 201 return false; 202 }); 203 204 205 }); 206 197 jQuery("#search").click(function (e) { 198 199 coordinates = { ADRESSE: jQuery("#match").val(), 200 LAT:0,LON:0,ZOOM: 18 201 }; 202 codeAddress(); 203 return false; 204 }); 205 206 jQuery("#match").keydown(function (e) { 207 // e.target pour FireFox 208 // event.srcElement pour IE 209 var Obj = e ? e.target : event.srcElement; 210 if (Obj.tagName != "INPUT") return false; 211 var Code = e.keyCode || e.which; 212 if (Code != 13) return true; 213 coordinates = { ADRESSE: jQuery("#match").val(), 214 LAT:0,LON:0,ZOOM: 18 215 }; 216 codeAddress(); 217 return false; 218 }); 219 220 221 }); 222
Note: See TracChangeset
for help on using the changeset viewer.