diff -r 829abfdd6d27 -r 37970a213463 src/pyams_gis/resources/js/leaflet-esri-geocoder-2.2.4.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_gis/resources/js/leaflet-esri-geocoder-2.2.4.min.js Thu Jul 12 17:40:07 2018 +0200 @@ -0,0 +1,1 @@ +(function(b,a){typeof exports==="object"&&typeof module!=="undefined"?a(exports,require("leaflet"),require("esri-leaflet")):typeof define==="function"&&define.amd?define(["exports","leaflet","esri-leaflet"],a):(a((b.L=b.L||{},b.L.esri=b.L.esri||{},b.L.esri.Geocoding=b.L.esri.Geocoding||{}),b.L,b.L.esri))}(this,function(y,g,w){g="default" in g?g["default"]:g;var d="2.2.4";var t=w.Task.extend({path:"findAddressCandidates",params:{outSr:4326,forStorage:false,outFields:"*",maxLocations:20},setters:{address:"address",neighborhood:"neighborhood",city:"city",subregion:"subregion",region:"region",postal:"postal",country:"country",text:"singleLine",category:"category",token:"token",key:"magicKey",fields:"outFields",forStorage:"forStorage",maxLocations:"maxLocations"},initialize:function(z){z=z||{};z.url=z.url||i;w.Task.prototype.initialize.call(this,z)},within:function(z){z=g.latLngBounds(z);this.params.searchExtent=w.Util.boundsToExtent(z);return this},nearby:function(A,z){A=g.latLng(A);this.params.location=A.lng+","+A.lat;this.params.distance=Math.min(Math.max(z,2000),50000);return this},run:function(A,z){if(this.options.customParam){this.params[this.options.customParam]=this.params.singleLine;delete this.params.singleLine}return this.request(function(C,B){var E=this._processGeocoderResponse;var D=(!C)?E(B):undefined;A.call(z,C,{results:D},B)},this)},_processGeocoderResponse:function(z){var B=[];for(var A=0;A-1){this.options.supportsSuggest=true}else{this.options.supportsSuggest=false}}},this)}});function r(z){return new c(z)}var f=g.Evented.extend({options:{zoomToResult:true,useMapBounds:12,searchBounds:null},initialize:function(A,z){g.Util.setOptions(this,z);this._control=A;if(!z||!z.providers||!z.providers.length){throw new Error("You must specify at least one provider")}this._providers=z.providers},_geocode:function(F,C,E){var A=0;var z=[];var D;var G=g.Util.bind(function(H,I){A--;if(H){return}if(I){z=z.concat(I)}if(A<=0){D=this._boundsFromResults(z);this.fire("results",{results:z,bounds:D,latlng:(D)?D.getCenter():undefined,text:F},true);if(this.options.zoomToResult&&D){this._control._map.fitBounds(D)}this.fire("load")}},this);if(C){A++;E.results(F,C,this._searchBounds(),G)}else{for(var B=0;B=0;D--){var z=E[D];A.push(z.latlng);if(z.bounds&&z.bounds.isValid()&&!z.bounds.equals(B)){G.push(z.bounds)}}var F=g.latLngBounds(A);for(var C=0;C0){this._suggestions.style.display="block"}this._suggestions.style.maxHeight=(this._map.getSize().y-this._suggestions.offsetTop-this._wrapper.offsetTop-10)+"px";var z=[];var F;var D;var H=[];for(var C=0;C1&&G!==B.provider.options.label){D=g.DomUtil.create("span","geocoder-control-header",this._suggestions);D.textContent=B.provider.options.label;D.innerText=B.provider.options.label;G=B.provider.options.label;z.push(D)}if(!F){F=g.DomUtil.create("ul","geocoder-control-list",this._suggestions)}if(H.indexOf(B.text)===-1){var I=g.DomUtil.create("li","geocoder-control-suggestion",F);I.innerHTML=B.text;I.provider=B.provider;I["data-magic-key"]=B.magicKey}else{for(var A=0;A=0;D--){var z=E[D];A.push(z.latlng);if(z.bounds&&z.bounds.isValid()&&!z.bounds.equals(B)){G.push(z.bounds)}}var F=g.latLngBounds(A);for(var C=0;C=2){this._geosearchCore._geocode(this._input.value,undefined);this.clear()}else{if(H.length===1){g.DomUtil.addClass(H[0],"geocoder-control-selected");this._geosearchCore._geocode(H[0].innerHTML,H[0]["data-magic-key"],H[0].provider)}else{this.clear();this._input.blur()}}}g.DomEvent.preventDefault(G);break;case 38:if(D){g.DomUtil.removeClass(D,"geocoder-control-selected")}var F=H[J-1];if(D&&F){g.DomUtil.addClass(F,"geocoder-control-selected")}else{g.DomUtil.addClass(H[H.length-1],"geocoder-control-selected")}g.DomEvent.preventDefault(G);break;case 40:if(D){g.DomUtil.removeClass(D,"geocoder-control-selected")}var B=H[J+1];if(D&&B){g.DomUtil.addClass(B,"geocoder-control-selected")}else{g.DomUtil.addClass(H[0],"geocoder-control-selected")}g.DomEvent.preventDefault(G);break;default:for(var I=0;I=0;I--){var H=J.features[I];E.push({text:this.options.formatSuggestion.call(this,H),magicKey:H.id})}D(G,E.slice(0,this.options.maxResults))}},this);return z},results:function(C,z,A,D){var B=this._resultsQuery;if(z){delete B.params.where;B.featureIds([z])}else{B.where(this._buildQuery(C))}if(A){B.within(A)}return B.run(g.Util.bind(function(F,J){var I=[];for(var H=0;H=0;z--){var A='upper("'+this.options.searchFields[z]+'")';C.push(A+" LIKE upper('%"+B+"%')")}if(this.options.where){return this.options.where+" AND ("+C.join(" OR ")+")"}else{return C.join(" OR ")}},_featureBounds:function(B){var A=g.geoJson(B);if(B.geometry.type==="Point"){var z=A.getBounds().getCenter();var D=((this.options.bufferRadius/40075017)*360)/Math.cos((180/Math.PI)*z.lat);var C=(this.options.bufferRadius/40075017)*360;return g.latLngBounds([z.lat-C,z.lng-D],[z.lat+C,z.lng+D])}else{return A.getBounds()}}});function u(z){return new j(z)}var n=w.MapService.extend({options:{layers:[0],label:"Map Service",bufferRadius:1000,maxResults:5,formatSuggestion:function(z){return z.properties[z.displayFieldName]+" "+z.layerName+""}},initialize:function(z){w.MapService.prototype.initialize.call(this,z);this._getIdFields()},suggestions:function(B,A,C){var z=this.find().text(B).fields(this.options.searchFields).returnGeometry(false).layers(this.options.layers);return z.run(function(J,E,K){var I=[];if(!J){var H=Math.min(this.options.maxResults,E.features.length);K.results=K.results.reverse();for(var F=0;F