Changeset 8220 for extensions/rv_gmaps
- Timestamp:
- Dec 22, 2010, 7:04:12 AM (14 years ago)
- Location:
- extensions/rv_gmaps/trunk/template
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/template/data_loader.js
r8039 r8220 120 120 } 121 121 var digits = Math.max( getLatLonDigits(latRange,4,2), getLatLonDigits(lonRange,4,2) ); 122 /*var box = new google.maps.LatLngBounds(123 new google.maps.LatLng( Math.roundN(bounds.getSouthWest().lat()-sd,digits), Math.roundN( bounds.getSouthWest().lng()-wd,digits ) ),124 new google.maps.LatLng( Math.roundN(bounds.getNorthEast().lat()+nd,digits), Math.roundN( bounds.getNorthEast().lng()+ed,digits) )125 );*/126 122 var box = new google.maps.LatLngBounds( bounds.getSouthWest(), bounds.getNorthEast() ); 127 123 box.extend( new google.maps.LatLng( Math.roundN(bounds.getSouthWest().lat()-sd,digits), Math.roundN( bounds.getSouthWest().lng()-wd,digits ) ) ); … … 146 142 try { 147 143 google.maps.Event.trigger( this, "dataloading" ); 148 GDownloadUrl(url, pwgBind(this, this._onDataReceived) ); 144 jQuery.ajax( { 145 url: url.replace('.php','x.php'), 146 success: pwgBind(this, this._onAjaxSuccess), 147 error: pwgBind(this, this._onAjaxError), 148 }); 149 149 } 150 150 catch (e) { … … 155 155 }, 156 156 157 _on DataReceived: function(data, responseCode)157 _onAjaxSuccess: function(data, textStatus, xhr) 158 158 { 159 159 var resp; 160 160 try 161 161 { 162 if (responseCode!=200) 163 { 164 this._previousLoadDataReq.box=null; 165 google.maps.Event.trigger( this, "dataloadfailed", responseCode, null ); 166 } 167 else 168 try 169 { 170 eval('resp = ' + data); 171 if (resp.nb_items == undefined) 172 throw new Error( "DATA DECODING ERROR" ); 173 174 this._previousLoadDataReq.resultBounds = resp.bounds; 175 if (document.is_debug && resp.debug) google.maps.Log.write( resp.debug ); 176 google.maps.Event.trigger( this, "dataloaded", resp ); 177 } 178 catch (e) { 179 this._previousLoadDataReq.box=null; 180 google.maps.Event.trigger( this, "dataloadfailed", responseCode, e ); 181 var s = e.message; 182 s += '\n' + data.substr(0,1000); 183 alert( s ); 184 } 162 eval('resp = ' + data); 163 if (resp.nb_items == undefined) 164 throw new Error( "DATA DECODING ERROR" ); 165 this._previousLoadDataReq.resultBounds = resp.bounds; 166 if (document.is_debug && resp.debug) google.maps.Log.write( resp.debug ); 167 google.maps.Event.trigger( this, "dataloaded", resp ); 168 } 169 catch (e) { 170 this._previousLoadDataReq.box=null; 171 google.maps.Event.trigger( this, "dataloadfailed", responseCode, e ); 172 var s = e.message; 173 s += '\n' + data.substr(0,1000); 174 alert( s ); 185 175 } 186 176 finally { 187 177 this._dataLoading = false; 188 178 } 189 } 179 }, 180 181 _onAjaxError: function(xhr, textStatus, exc) 182 { 183 try { 184 google.maps.Event.trigger( this, "dataloadfailed", textStatus + xhr.status, exc ); 185 } 186 catch (e) { 187 } 188 finally { 189 this._dataLoading = false; 190 } 191 }, 190 192 191 193 } -
extensions/rv_gmaps/trunk/template/map.tpl
r8039 r8220 21 21 <script src="http://maps.google.com/maps?file=api&v=2&key={$GMAPS_API_KEY}&hl={$lang_info.code}" type="text/javascript"></script> 22 22 23 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery. js" type="text/javascript"></script>23 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> 24 24 <script type="text/javascript">jQuery.noConflict();</script> 25 25 <script src="{$PLUGIN_ROOT_URL}/template/nyroModal/jquery.nyroModal-1.6.2.js" type="text/javascript"></script> -
extensions/rv_gmaps/trunk/template/picture_map_content.tpl
r8029 r8220 1 1 {html_head} 2 2 <script src="http://maps.google.com/maps/api/js?sensor=false&hl={$lang_info.code}" type="text/javascript"></script> 3 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery. js" type="text/javascript"></script>3 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> 4 4 <script src="{$PLUGIN_ROOT_URL}/template/nyroModal/jquery.nyroModal-1.6.2.js" type="text/javascript"></script> 5 5 <link href="{$PLUGIN_ROOT_URL}/template/nyroModal/nyroModal.css" rel="stylesheet" type="text/css">
Note: See TracChangeset
for help on using the changeset viewer.