1/** 2 * L.Control.GeoSearch - search for an address and zoom to it's location 3 * L.GeoSearch.Provider.Esri uses arcgis geocoding service 4 * https://github.com/smeijer/leaflet.control.geosearch 5 */ 6 7L.GeoSearch.Provider.Esri = L.Class.extend({ 8 options: { 9 10 }, 11 12 initialize: function(options) { 13 options = L.Util.setOptions(this, options); 14 }, 15 16 GetServiceUrl: function (qry) { 17 var parameters = L.Util.extend({ 18 text: qry, 19 f: 'pjson' 20 }, this.options); 21 22 return location.protocol 23 + '//geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find' 24 + L.Util.getParamString(parameters); 25 }, 26 27 ParseJSON: function (data) { 28 if (data.locations.length == 0) 29 return []; 30 31 var results = []; 32 for (var i = 0; i < data.locations.length; i++) 33 results.push(new L.GeoSearch.Result( 34 data.locations[i].feature.geometry.x, 35 data.locations[i].feature.geometry.y, 36 data.locations[i].name 37 )); 38 39 return results; 40 } 41});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.