New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

leaflet-control-geocoder

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-control-geocoder - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 2.0.1 (2020-11-30)
- Fixes usage of [`L.Evented`](https://leafletjs.com/reference-1.7.1.html#evented) [mixin](https://leafletjs.com/reference-1.7.1.html#class-includes) for [TypeScript](https://www.typescriptlang.org/docs/handbook/mixins.html) ([#312](https://github.com/perliedman/leaflet-control-geocoder/issues/312))
## 2.0.0 (2020-11-28)

@@ -2,0 +6,0 @@

40

dist/control.d.ts

@@ -58,5 +58,18 @@ import * as L from 'leaflet';

/**
* Leaflet mixins https://leafletjs.com/reference-1.7.1.html#class-includes
* for TypeScript https://www.typescriptlang.org/docs/handbook/mixins.html
* @internal
*/
declare class EventedControl {
constructor(...args: any[]);
}
/**
* @internal
*/
interface EventedControl extends L.Control, L.Evented {
}
/**
* This is the geocoder control. It works like any other [Leaflet control](https://leafletjs.com/reference.html#control), and is added to the map.
*/
export declare class GeocoderControl extends L.Control {
export declare class GeocoderControl extends EventedControl {
options: GeocoderControlOptions;

@@ -81,26 +94,2 @@ private _alts;

constructor(options?: Partial<GeocoderControlOptions>);
/**
* Adds a listener function to a particular event type of the object.
* @param type the event type
* @param fn the listener function
* @param context the this listener function context
* @see https://leafletjs.com/reference.html#evented-on
*/
on(type: string, fn: L.LeafletEventHandlerFn, context?: any): this;
/**
* Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object.
* @param type the event type
* @param fn the listener function
* @param context the this listener function context
* @see https://leafletjs.com/reference.html#evented-off
*/
off(type: string, fn?: L.LeafletEventHandlerFn, context?: any): this;
/**
* Fires an event of the specified type. You can optionally provide an data object.
* @param type the event type
* @param data the event data object
* @param propagate whether to propagate to event parents
* @see https://leafletjs.com/reference.html#evented-fire
*/
fire(type: string, data?: any, propagate?: boolean): this;
addThrobberClass(): void;

@@ -140,1 +129,2 @@ removeThrobberClass(): void;

export declare function geocoder(options?: Partial<GeocoderControlOptions>): GeocoderControl;
export {};

@@ -1427,7 +1427,19 @@ var leafletControlGeocoder = (function (L) {

/**
* Leaflet mixins https://leafletjs.com/reference-1.7.1.html#class-includes
* for TypeScript https://www.typescriptlang.org/docs/handbook/mixins.html
* @internal
*/
var EventedControl = // eslint-disable-next-line @typescript-eslint/no-unused-vars
function EventedControl() {// empty
};
L.Util.extend(EventedControl.prototype, L.Control.prototype);
L.Util.extend(EventedControl.prototype, L.Evented.prototype);
/**
* This is the geocoder control. It works like any other [Leaflet control](https://leafletjs.com/reference.html#control), and is added to the map.
*/
var GeocoderControl = /*#__PURE__*/function (_L$Control) {
_inheritsLoose(GeocoderControl, _L$Control);
var GeocoderControl = /*#__PURE__*/function (_EventedControl) {
_inheritsLoose(GeocoderControl, _EventedControl);

@@ -1441,3 +1453,3 @@ /**

_this = _L$Control.call(this, options) || this;
_this = _EventedControl.call(this, options) || this;
_this.options = {

@@ -1467,44 +1479,5 @@ showUniqueResult: true,

}
/**
* Adds a listener function to a particular event type of the object.
* @param type the event type
* @param fn the listener function
* @param context the this listener function context
* @see https://leafletjs.com/reference.html#evented-on
*/
var _proto = GeocoderControl.prototype;
_proto.on = function on(type, fn, context) {
L.Evented.prototype.on(type, fn, context);
return this;
}
/**
* Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object.
* @param type the event type
* @param fn the listener function
* @param context the this listener function context
* @see https://leafletjs.com/reference.html#evented-off
*/
;
_proto.off = function off(type, fn, context) {
L.Evented.prototype.off(type, fn, context);
return this;
}
/**
* Fires an event of the specified type. You can optionally provide an data object.
* @param type the event type
* @param data the event data object
* @param propagate whether to propagate to event parents
* @see https://leafletjs.com/reference.html#evented-fire
*/
;
_proto.fire = function fire(type, data, propagate) {
L.Evented.prototype.fire(type, data, propagate);
return this;
};
_proto.addThrobberClass = function addThrobberClass() {

@@ -1859,3 +1832,3 @@ L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber');

return GeocoderControl;
}(L.Control);
}(EventedControl);
/**

@@ -1862,0 +1835,0 @@ * [Class factory method](https://leafletjs.com/reference.html#class-class-factories) for {@link GeocoderControl}

@@ -1,2 +0,2 @@

var leafletControlGeocoder=function(t){function e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function o(e,o){return t.Util.extend(o,e.geocodingQueryParams)}function n(e,o){return t.Util.extend(o,e.reverseQueryParams)}var s=0,i=/[&<>"'`]/g,r=/[&<>"'`]/,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};function l(t){return a[t]}function c(e,o,n,i,r){var a="_l_geocoder_"+s++;o[r||"callback"]=a,window[a]=t.Util.bind(n,i);var l=document.createElement("script");l.type="text/javascript",l.src=e+u(o),l.id=a,document.getElementsByTagName("head")[0].appendChild(l)}function p(t,e,o){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){var t;if(200!==n.status&&304!==n.status)t="";else if("string"==typeof n.response)try{t=JSON.parse(n.response)}catch(e){t=n.response}else t=n.response;o(t)}},n.open("GET",t+u(e),!0),n.responseType="json",n.setRequestHeader("Accept","application/json"),n.send(null)}function u(t,e,o){var n=[];for(var s in t){var i=encodeURIComponent(o?s.toUpperCase():s),r=t[s];if(Array.isArray(r))for(var a=0;a<r.length;a++)n.push(i+"="+encodeURIComponent(r[a]));else n.push(i+"="+encodeURIComponent(String(r)))}return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var d=function(){function e(e){this.options={serviceUrl:"https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",apiKey:""},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){var i=o(this.options,{token:this.options.apiKey,SingleLine:e,outFields:"Addr_Type",forStorage:!1,maxLocations:10,f:"json"});p(this.options.serviceUrl+"/findAddressCandidates",i,function(e){var o=[];if(e.candidates&&e.candidates.length)for(var i=0;i<=e.candidates.length-1;i++){var r=e.candidates[i],a=t.latLng(r.location.y,r.location.x),l=t.latLngBounds(t.latLng(r.extent.ymax,r.extent.xmax),t.latLng(r.extent.ymin,r.extent.xmin));o[i]={name:r.address,bbox:l,center:a}}n.call(s,o)})},s.suggest=function(t,e,o){return this.geocode(t,e,o)},s.reverse=function(e,o,s,i){var r=n(this.options,{location:encodeURIComponent(e.lng)+","+encodeURIComponent(e.lat),distance:100,f:"json"});p(this.options.serviceUrl+"/reverseGeocode",r,function(e){var o=[];if(e&&!e.error){var n=t.latLng(e.location.y,e.location.x),r=t.latLngBounds(n,n);o.push({name:e.address.Match_addr,center:n,bbox:r})}s.call(i,o)})},e}(),h=function(){function e(e){this.options={serviceUrl:"https://dev.virtualearth.net/REST/v1/Locations"},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){var i=o(this.options,{query:e,key:this.options.apiKey});c(this.options.apiKey,i,function(e){var o=[];if(e.resourceSets.length>0)for(var i=e.resourceSets[0].resources.length-1;i>=0;i--){var r=e.resourceSets[0].resources[i],a=r.bbox;o[i]={name:r.name,bbox:t.latLngBounds([a[0],a[1]],[a[2],a[3]]),center:t.latLng(r.point.coordinates)}}n.call(s,o)},this,"jsonp")},s.reverse=function(e,o,s,i){var r=n(this.options,{key:this.options.apiKey});c(this.options.serviceUrl+e.lat+","+e.lng,r,function(e){for(var o=[],n=e.resourceSets[0].resources.length-1;n>=0;n--){var r=e.resourceSets[0].resources[n],a=r.bbox;o[n]={name:r.name,bbox:t.latLngBounds([a[0],a[1]],[a[2],a[3]]),center:t.latLng(r.point.coordinates)}}s.call(i,o)},this,"jsonp")},e}(),g=function(){function e(e){this.options={serviceUrl:"https://maps.googleapis.com/maps/api/geocode/json"},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){var i=o(this.options,{key:this.options.apiKey,address:e});p(this.options.serviceUrl,i,function(e){var o=[];if(e.results&&e.results.length)for(var i=0;i<=e.results.length-1;i++){var r=e.results[i],a=t.latLng(r.geometry.location),l=t.latLngBounds(t.latLng(r.geometry.viewport.northeast),t.latLng(r.geometry.viewport.southwest));o[i]={name:r.formatted_address,bbox:l,center:a,properties:r.address_components}}n.call(s,o)})},s.reverse=function(e,o,s,i){var r=n(this.options,{key:this.options.apiKey,latlng:encodeURIComponent(e.lat)+","+encodeURIComponent(e.lng)});p(this.options.serviceUrl,r,function(e){var o=[];if(e.results&&e.results.length)for(var n=0;n<=e.results.length-1;n++){var r=e.results[n],a=t.latLng(r.geometry.location),l=t.latLngBounds(t.latLng(r.geometry.viewport.northeast),t.latLng(r.geometry.viewport.southwest));o[n]={name:r.formatted_address,bbox:l,center:a,properties:r.address_components}}s.call(i,o)})},e}(),f=function(){function e(e){if(this.options={serviceUrl:"https://geocoder.api.here.com/6.2/",app_id:"",app_code:"",reverseGeocodeProxRadius:null},t.Util.setOptions(this,e),e.apiKey)throw Error("apiKey is not supported, use app_id/app_code instead!")}var s=e.prototype;return s.geocode=function(t,e,n){var s=o(this.options,{searchtext:t,gen:9,app_id:this.options.app_id,app_code:this.options.app_code,jsonattributes:1});this.getJSON(this.options.serviceUrl+"geocode.json",s,e,n)},s.reverse=function(t,e,o,s){var i=this.options.reverseGeocodeProxRadius?this.options.reverseGeocodeProxRadius:null,r=i?","+encodeURIComponent(i):"",a=n(this.options,{prox:encodeURIComponent(t.lat)+","+encodeURIComponent(t.lng)+r,mode:"retrieveAddresses",app_id:this.options.app_id,app_code:this.options.app_code,gen:9,jsonattributes:1});this.getJSON(this.options.serviceUrl+"reversegeocode.json",a,o,s)},s.getJSON=function(e,o,n,s){p(e,o,function(e){var o=[];if(e.response.view&&e.response.view.length)for(var i=0;i<=e.response.view[0].result.length-1;i++){var r=e.response.view[0].result[i].location,a=t.latLng(r.displayPosition.latitude,r.displayPosition.longitude),l=t.latLngBounds(t.latLng(r.mapView.topLeft.latitude,r.mapView.topLeft.longitude),t.latLng(r.mapView.bottomRight.latitude,r.mapView.bottomRight.longitude));o[i]={name:r.address.label,properties:r.address,bbox:l,center:a}}n.call(s,o)})},e}();function v(e){var o;return(o=e.match(/^([NS])\s*(\d{1,3}(?:\.\d*)?)\W*([EW])\s*(\d{1,3}(?:\.\d*)?)$/))?t.latLng((/N/i.test(o[1])?1:-1)*parseFloat(o[2]),(/E/i.test(o[3])?1:-1)*parseFloat(o[4])):(o=e.match(/^(\d{1,3}(?:\.\d*)?)\s*([NS])\W*(\d{1,3}(?:\.\d*)?)\s*([EW])$/))?t.latLng((/N/i.test(o[2])?1:-1)*parseFloat(o[1]),(/E/i.test(o[4])?1:-1)*parseFloat(o[3])):(o=e.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?$/))?t.latLng((/N/i.test(o[1])?1:-1)*(parseFloat(o[2])+parseFloat(o[3])/60),(/E/i.test(o[4])?1:-1)*(parseFloat(o[5])+parseFloat(o[6])/60)):(o=e.match(/^(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([NS])\W*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([EW])$/))?t.latLng((/N/i.test(o[3])?1:-1)*(parseFloat(o[1])+parseFloat(o[2])/60),(/E/i.test(o[6])?1:-1)*(parseFloat(o[4])+parseFloat(o[5])/60)):(o=e.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?$/))?t.latLng((/N/i.test(o[1])?1:-1)*(parseFloat(o[2])+parseFloat(o[3])/60+parseFloat(o[4])/3600),(/E/i.test(o[5])?1:-1)*(parseFloat(o[6])+parseFloat(o[7])/60+parseFloat(o[8])/3600)):(o=e.match(/^(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]\s*([NS])\W*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?\s*([EW])$/))?t.latLng((/N/i.test(o[4])?1:-1)*(parseFloat(o[1])+parseFloat(o[2])/60+parseFloat(o[3])/3600),(/E/i.test(o[8])?1:-1)*(parseFloat(o[5])+parseFloat(o[6])/60+parseFloat(o[7])/3600)):(o=e.match(/^\s*([+-]?\d+(?:\.\d*)?)\s*[\s,]\s*([+-]?\d+(?:\.\d*)?)\s*$/))?t.latLng(parseFloat(o[1]),parseFloat(o[2])):void 0}var m=function(){function e(e){this.options={next:void 0,sizeInMeters:1e4},t.Util.setOptions(this,e)}return e.prototype.geocode=function(t,e,o){var n=v(t);if(n){var s=[{name:t,center:n,bbox:n.toBounds(this.options.sizeInMeters)}];e.call(o,s)}else this.options.next&&this.options.next.geocode(t,e,o)},e}(),_=function(){function e(e){this.options={serviceUrl:"https://api.mapbox.com/geocoding/v5/mapbox.places/"},t.Util.setOptions(this,e)}var s=e.prototype;return s._getProperties=function(t){for(var e={text:t.text,address:t.address},o=0;o<(t.context||[]).length;o++)e[t.context[o].id.split(".")[0]]=t.context[o].text,t.context[o].short_code&&(e.countryShortCode=t.context[o].short_code);return e},s.geocode=function(e,n,s){var i=this,r=o(this.options,{access_token:this.options.apiKey});void 0!==r.proximity&&void 0!==r.proximity.lat&&void 0!==r.proximity.lng&&(r.proximity=r.proximity.lng+","+r.proximity.lat),p(this.options.serviceUrl+encodeURIComponent(e)+".json",r,function(e){var o=[];if(e.features&&e.features.length)for(var r=0;r<=e.features.length-1;r++){var a,l=e.features[r],c=t.latLng(l.center.reverse());a=l.bbox?t.latLngBounds(t.latLng(l.bbox.slice(0,2).reverse()),t.latLng(l.bbox.slice(2,4).reverse())):t.latLngBounds(c,c),o[r]={name:l.place_name,bbox:a,center:c,properties:i._getProperties(l)}}n.call(s,o)})},s.suggest=function(t,e,o){return this.geocode(t,e,o)},s.reverse=function(e,o,s,i){var r=this,a=n(this.options,{access_token:this.options.apiKey});p(this.options.serviceUrl+encodeURIComponent(e.lng)+","+encodeURIComponent(e.lat)+".json",a,function(e){var o=[];if(e.features&&e.features.length)for(var n=0;n<=e.features.length-1;n++){var a,l=e.features[n],c=t.latLng(l.center.reverse());a=l.bbox?t.latLngBounds(t.latLng(l.bbox.slice(0,2).reverse()),t.latLng(l.bbox.slice(2,4).reverse())):t.latLngBounds(c,c),o[n]={name:l.place_name,bbox:a,center:c,properties:r._getProperties(l)}}s.call(i,o)})},e}(),b=function(){function e(e){this.options={serviceUrl:"https://www.mapquestapi.com/geocoding/v1"},t.Util.setOptions(this,e),this.options.apiKey=decodeURIComponent(this.options.apiKey)}var s=e.prototype;return s._formatName=function(){return[].slice.call(arguments).filter(function(t){return!!t}).join(", ")},s.geocode=function(e,n,s){var i=o(this.options,{key:this.options.apiKey,location:e,limit:5,outFormat:"json"});p(this.options.serviceUrl+"/address",i,t.Util.bind(function(e){var o=[];if(e.results&&e.results[0].locations)for(var i=e.results[0].locations.length-1;i>=0;i--){var r=e.results[0].locations[i],a=t.latLng(r.latLng);o[i]={name:this._formatName(r.street,r.adminArea4,r.adminArea3,r.adminArea1),bbox:t.latLngBounds(a,a),center:a}}n.call(s,o)},this))},s.reverse=function(e,o,s,i){var r=n(this.options,{key:this.options.apiKey,location:e.lat+","+e.lng,outputFormat:"json"});p(this.options.serviceUrl+"/reverse",r,t.Util.bind(function(e){var o=[];if(e.results&&e.results[0].locations)for(var n=e.results[0].locations.length-1;n>=0;n--){var r=e.results[0].locations[n],a=t.latLng(r.latLng);o[n]={name:this._formatName(r.street,r.adminArea4,r.adminArea3,r.adminArea1),bbox:t.latLngBounds(a,a),center:a}}s.call(i,o)},this))},e}(),y=function(){function e(e){this.options={userId:void 0,apiKey:void 0,serviceUrl:"https://neutrinoapi.com/"},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){var i=o(this.options,{apiKey:this.options.apiKey,userId:this.options.userId,address:e.split(/\s+/).join(".")});p(this.options.serviceUrl+"geocode-address",i,function(e){var o=[];if(e.locations){e.geometry=e.locations[0];var i=t.latLng(e.geometry.latitude,e.geometry.longitude),r=t.latLngBounds(i,i);o[0]={name:e.geometry.address,bbox:r,center:i}}n.call(s,o)})},s.suggest=function(t,e,o){return this.geocode(t,e,o)},s.reverse=function(e,o,s,i){var r=n(this.options,{apiKey:this.options.apiKey,userId:this.options.userId,latitude:e.lat,longitude:e.lng});p(this.options.serviceUrl+"geocode-reverse",r,function(o){var n=[];if(200==o.status.status&&o.found){var r=t.latLng(e.lat,e.lng),a=t.latLngBounds(r,r);n[0]={name:o.address,bbox:a,center:r}}s.call(i,n)})},e}(),L=function(){function e(e){this.options={serviceUrl:"https://nominatim.openstreetmap.org/",htmlTemplate:function(t){var e,o,n=t.address,s=[];return(n.road||n.building)&&s.push("{building} {road} {house_number}"),(n.city||n.town||n.village||n.hamlet)&&s.push('<span class="'+(s.length>0?"leaflet-control-geocoder-address-detail":"")+'">{postcode} {city} {town} {village} {hamlet}</span>'),(n.state||n.country)&&s.push('<span class="'+(s.length>0?"leaflet-control-geocoder-address-context":"")+'">{state} {country}</span>'),e=s.join("<br/>"),o=n,e.replace(/\{ *([\w_]+) *\}/g,function(t,e){var n,s=o[e];return void 0===s?s="":"function"==typeof s&&(s=s(o)),null==(n=s)?"":n?r.test(n=""+n)?n.replace(i,l):n:n+""})}},t.Util.setOptions(this,e||{})}var s=e.prototype;return s.geocode=function(e,n,s){var i=this,r=o(this.options,{q:e,limit:5,format:"json",addressdetails:1});p(this.options.serviceUrl+"search",r,function(e){for(var o=[],r=e.length-1;r>=0;r--){for(var a=e[r].boundingbox,l=0;l<4;l++)a[l]=parseFloat(a[l]);o[r]={icon:e[r].icon,name:e[r].display_name,html:i.options.htmlTemplate?i.options.htmlTemplate(e[r]):void 0,bbox:t.latLngBounds([a[0],a[2]],[a[1],a[3]]),center:t.latLng(e[r].lat,e[r].lon),properties:e[r]}}n.call(s,o)})},s.reverse=function(e,o,s,i){var r=this,a=n(this.options,{lat:e.lat,lon:e.lng,zoom:Math.round(Math.log(o/256)/Math.log(2)),addressdetails:1,format:"json"});p(this.options.serviceUrl+"reverse",a,function(e){var o=[];if(e&&e.lat&&e.lon){var n=t.latLng(e.lat,e.lon),a=t.latLngBounds(n,n);o.push({name:e.display_name,html:r.options.htmlTemplate?r.options.htmlTemplate(e):void 0,center:n,bbox:a,properties:e})}s.call(i,o)})},e}(),U=function(){function e(e){t.Util.setOptions(this,e)}var o=e.prototype;return o.geocode=function(e,o,n){try{var s=this.options.OpenLocationCode.decode(e),i={name:e,center:t.latLng(s.latitudeCenter,s.longitudeCenter),bbox:t.latLngBounds(t.latLng(s.latitudeLo,s.longitudeLo),t.latLng(s.latitudeHi,s.longitudeHi))};o.call(n,[i])}catch(t){console.warn(t),o.call(n,[])}},o.reverse=function(e,o,n,s){try{var i={name:this.options.OpenLocationCode.encode(e.lat,e.lng,this.options.codeLength),center:t.latLng(e.lat,e.lng),bbox:t.latLngBounds(t.latLng(e.lat,e.lng),t.latLng(e.lat,e.lng))};n.call(s,[i])}catch(t){console.warn(t),n.call(s,[])}},e}(),x=function(){function e(e){this.options={serviceUrl:"https://api.opencagedata.com/geocode/v1/json"},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){var i=o(this.options,{key:this.options.apiKey,q:e});p(this.options.serviceUrl,i,function(e){var o=[];if(e.results&&e.results.length)for(var i=0;i<e.results.length;i++){var r,a=e.results[i],l=t.latLng(a.geometry);r=a.annotations&&a.annotations.bounds?t.latLngBounds(t.latLng(a.annotations.bounds.northeast),t.latLng(a.annotations.bounds.southwest)):t.latLngBounds(l,l),o.push({name:a.formatted,bbox:r,center:l})}n.call(s,o)})},s.suggest=function(t,e,o){return this.geocode(t,e,o)},s.reverse=function(e,o,s,i){var r=n(this.options,{key:this.options.apiKey,q:[e.lat,e.lng].join(",")});p(this.options.serviceUrl,r,function(e){var o=[];if(e.results&&e.results.length)for(var n=0;n<e.results.length;n++){var r,a=e.results[n],l=t.latLng(a.geometry);r=a.annotations&&a.annotations.bounds?t.latLngBounds(t.latLng(a.annotations.bounds.northeast),t.latLng(a.annotations.bounds.southwest)):t.latLngBounds(l,l),o.push({name:a.formatted,bbox:r,center:l})}s.call(i,o)})},e}(),w=function(){function e(e){this.options={serviceUrl:"https://api.geocode.earth/v1"},this._lastSuggest=0,t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(t,e,n){var s=this,i=o(this.options,{api_key:this.options.apiKey,text:t});p(this.options.serviceUrl+"/search",i,function(t){e.call(n,s._parseResults(t,"bbox"))})},s.suggest=function(t,e,n){var s=this,i=o(this.options,{api_key:this.options.apiKey,text:t});p(this.options.serviceUrl+"/autocomplete",i,function(t){t.geocoding.timestamp>s._lastSuggest&&(s._lastSuggest=t.geocoding.timestamp,e.call(n,s._parseResults(t,"bbox")))})},s.reverse=function(t,e,o,s){var i=this,r=n(this.options,{api_key:this.options.apiKey,"point.lat":t.lat,"point.lon":t.lng});p(this.options.serviceUrl+"/reverse",r,function(t){o.call(s,i._parseResults(t,"bounds"))})},s._parseResults=function(e,o){var n=[];return t.geoJSON(e,{pointToLayer:function(e,o){return t.circleMarker(o)},onEachFeature:function(e,s){var i,r,a={};s.getBounds?r=(i=s.getBounds()).getCenter():s.feature.bbox?(r=s.getLatLng(),i=t.latLngBounds(t.GeoJSON.coordsToLatLng(s.feature.bbox.slice(0,2)),t.GeoJSON.coordsToLatLng(s.feature.bbox.slice(2,4)))):(r=s.getLatLng(),i=t.latLngBounds(r,r)),a.name=s.feature.properties.label,a.center=r,a[o]=i,a.properties=s.feature.properties,n.push(a)}}),n},e}();function C(t){return new w(t)}var E=w,k=C,D=w,R=C,B=function(o){function n(e){return o.call(this,t.Util.extend({serviceUrl:"https://api.openrouteservice.org/geocode"},e))||this}return e(n,o),n}(w),F=function(){function e(e){this.options={serviceUrl:"https://photon.komoot.io/api/",reverseUrl:"https://photon.komoot.io/reverse/",nameProperties:["name","street","suburb","hamlet","town","city","state","country"]},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){var i=o(this.options,{q:e});p(this.options.serviceUrl,i,t.Util.bind(function(t){n.call(s,this._decodeFeatures(t))},this))},s.suggest=function(t,e,o){return this.geocode(t,e,o)},s.reverse=function(e,o,s,i){var r=n(this.options,{lat:e.lat,lon:e.lng});p(this.options.reverseUrl,r,t.Util.bind(function(t){s.call(i,this._decodeFeatures(t))},this))},s._decodeFeatures=function(e){var o=[];if(e&&e.features)for(var n=0;n<e.features.length;n++){var s=e.features[n],i=s.geometry.coordinates,r=t.latLng(i[1],i[0]),a=s.properties.extent,l=a?t.latLngBounds([a[1],a[0]],[a[3],a[2]]):t.latLngBounds(r,r);o.push({name:this._decodeFeatureName(s),html:this.options.htmlTemplate?this.options.htmlTemplate(s):void 0,center:r,bbox:l,properties:s.properties})}return o},s._decodeFeatureName=function(t){return(this.options.nameProperties||[]).map(function(e){return t.properties[e]}).filter(function(t){return!!t}).join(", ")},e}(),S=function(){function e(e){this.options={serviceUrl:"https://api.what3words.com/v2/"},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){p(this.options.serviceUrl+"forward",o(this.options,{key:this.options.apiKey,addr:e.split(/\s+/).join(".")}),function(e){var o=[];if(e.geometry){var i=t.latLng(e.geometry.lat,e.geometry.lng),r=t.latLngBounds(i,i);o[0]={name:e.words,bbox:r,center:i}}n.call(s,o)})},s.suggest=function(t,e,o){return this.geocode(t,e,o)},s.reverse=function(e,o,s,i){p(this.options.serviceUrl+"reverse",n(this.options,{key:this.options.apiKey,coords:[e.lat,e.lng].join(",")}),function(e){var o=[];if(200==e.status.status){var n=t.latLng(e.geometry.lat,e.geometry.lng),r=t.latLngBounds(n,n);o[0]={name:e.words,bbox:r,center:n}}s.call(i,o)})},e}(),T={__proto__:null,geocodingParams:o,reverseParams:n,ArcGis:d,arcgis:function(t){return new d(t)},Bing:h,bing:function(t){return new h(t)},Google:g,google:function(t){return new g(t)},HERE:f,here:function(t){return new f(t)},parseLatLng:v,LatLng:m,latLng:function(t){return new m(t)},Mapbox:_,mapbox:function(t){return new _(t)},MapQuest:b,mapQuest:function(t){return new b(t)},Neutrino:y,neutrino:function(t){return new y(t)},Nominatim:L,nominatim:function(t){return new L(t)},OpenLocationCode:U,openLocationCode:function(t){return new U(t)},OpenCage:x,opencage:function(t){return new x(t)},Pelias:w,pelias:C,GeocodeEarth:E,geocodeEarth:k,Mapzen:D,mapzen:R,Openrouteservice:B,openrouteservice:function(t){return new B(t)},Photon:F,photon:function(t){return new F(t)},What3Words:S,what3words:function(t){return new S(t)}},N=function(o){function n(e){var n;return(n=o.call(this,e)||this).options={showUniqueResult:!0,showResultIcons:!1,collapsed:!0,expand:"touch",position:"topright",placeholder:"Search...",errorMessage:"Nothing found.",iconLabel:"Initiate a new search",query:"",queryMinLength:1,suggestMinLength:3,suggestTimeout:250,defaultMarkGeocode:!0},n._requestCount=0,t.Util.setOptions(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n),e),n.options.geocoder||(n.options.geocoder=new L),n}e(n,o);var s=n.prototype;return s.on=function(e,o,n){return t.Evented.prototype.on(e,o,n),this},s.off=function(e,o,n){return t.Evented.prototype.off(e,o,n),this},s.fire=function(e,o,n){return t.Evented.prototype.fire(e,o,n),this},s.addThrobberClass=function(){t.DomUtil.addClass(this._container,"leaflet-control-geocoder-throbber")},s.removeThrobberClass=function(){t.DomUtil.removeClass(this._container,"leaflet-control-geocoder-throbber")},s.onAdd=function(e){var o=this,n="leaflet-control-geocoder",s=t.DomUtil.create("div",n+" leaflet-bar"),i=t.DomUtil.create("button",n+"-icon",s),r=this._form=t.DomUtil.create("div",n+"-form",s);this._map=e,this._container=s,i.innerHTML="&nbsp;",i.type="button",i.setAttribute("aria-label",this.options.iconLabel);var a=this._input=t.DomUtil.create("input","",r);return a.type="text",a.value=this.options.query,a.placeholder=this.options.placeholder,t.DomEvent.disableClickPropagation(a),this._errorElement=t.DomUtil.create("div",n+"-form-no-error",s),this._errorElement.innerHTML=this.options.errorMessage,this._alts=t.DomUtil.create("ul",n+"-alternatives leaflet-control-geocoder-alternatives-minimized",s),t.DomEvent.disableClickPropagation(this._alts),t.DomEvent.addListener(a,"keydown",this._keydown,this),this.options.geocoder.suggest&&t.DomEvent.addListener(a,"input",this._change,this),t.DomEvent.addListener(a,"blur",function(){o.options.collapsed&&!o._preventBlurCollapse&&o._collapse(),o._preventBlurCollapse=!1}),this.options.collapsed?"click"===this.options.expand?t.DomEvent.addListener(s,"click",function(t){0===t.button&&2!==t.detail&&o._toggle()}):"touch"===this.options.expand?t.DomEvent.addListener(s,t.Browser.touch?"touchstart mousedown":"mousedown",function(t){o._toggle(),t.preventDefault(),t.stopPropagation()},this):(t.DomEvent.addListener(s,"mouseover",this._expand,this),t.DomEvent.addListener(s,"mouseout",this._collapse,this),this._map.on("movestart",this._collapse,this)):(this._expand(),t.DomEvent.addListener(s,t.Browser.touch?"touchstart":"click",function(){return o._geocode()})),this.options.defaultMarkGeocode&&this.on("markgeocode",this.markGeocode,this),this.on("startgeocode",this.addThrobberClass,this),this.on("finishgeocode",this.removeThrobberClass,this),this.on("startsuggest",this.addThrobberClass,this),this.on("finishsuggest",this.removeThrobberClass,this),t.DomEvent.disableClickPropagation(s),s},s.setQuery=function(t){return this._input.value=t,this},s._geocodeResult=function(e,o){if(!o&&this.options.showUniqueResult&&1===e.length)this._geocodeResultSelected(e[0]);else if(e.length>0){this._alts.innerHTML="",this._results=e,t.DomUtil.removeClass(this._alts,"leaflet-control-geocoder-alternatives-minimized"),t.DomUtil.addClass(this._container,"leaflet-control-geocoder-options-open");for(var n=0;n<e.length;n++)this._alts.appendChild(this._createAlt(e[n],n))}else t.DomUtil.addClass(this._container,"leaflet-control-geocoder-options-error"),t.DomUtil.addClass(this._errorElement,"leaflet-control-geocoder-error")},s.markGeocode=function(e){return this._map.fitBounds((e=e.geocode||e).bbox),this._geocodeMarker&&this._map.removeLayer(this._geocodeMarker),this._geocodeMarker=new t.Marker(e.center).bindPopup(e.html||e.name).addTo(this._map).openPopup(),this},s._geocode=function(t){var e=this,o=this._input.value;if(t||!(o.length<this.options.queryMinLength)){var n=++this._requestCount,s=function(s){n===e._requestCount&&(e.fire(t?"finishsuggest":"finishgeocode",{input:o,results:s}),e._geocodeResult(s,t))};this._lastGeocode=o,t||this._clearResults(),this.fire(t?"startsuggest":"startgeocode",{input:o}),t?this.options.geocoder.suggest(o,s):this.options.geocoder.geocode(o,s)}},s._geocodeResultSelected=function(t){this.fire("markgeocode",{geocode:t})},s._toggle=function(){t.DomUtil.hasClass(this._container,"leaflet-control-geocoder-expanded")?this._collapse():this._expand()},s._expand=function(){t.DomUtil.addClass(this._container,"leaflet-control-geocoder-expanded"),this._input.select(),this.fire("expand")},s._collapse=function(){t.DomUtil.removeClass(this._container,"leaflet-control-geocoder-expanded"),t.DomUtil.addClass(this._alts,"leaflet-control-geocoder-alternatives-minimized"),t.DomUtil.removeClass(this._errorElement,"leaflet-control-geocoder-error"),t.DomUtil.removeClass(this._container,"leaflet-control-geocoder-options-open"),t.DomUtil.removeClass(this._container,"leaflet-control-geocoder-options-error"),this._input.blur(),this.fire("collapse")},s._clearResults=function(){t.DomUtil.addClass(this._alts,"leaflet-control-geocoder-alternatives-minimized"),this._selection=null,t.DomUtil.removeClass(this._errorElement,"leaflet-control-geocoder-error"),t.DomUtil.removeClass(this._container,"leaflet-control-geocoder-options-open"),t.DomUtil.removeClass(this._container,"leaflet-control-geocoder-options-error")},s._createAlt=function(e,o){var n=this,s=t.DomUtil.create("li",""),i=t.DomUtil.create("a","",s),r=this.options.showResultIcons&&e.icon?t.DomUtil.create("img","",i):null,a=e.html?void 0:document.createTextNode(e.name);return r&&(r.src=e.icon),s.setAttribute("data-result-index",String(o)),e.html?i.innerHTML=i.innerHTML+e.html:a&&i.appendChild(a),t.DomEvent.addListener(s,"mousedown touchstart",function(o){n._preventBlurCollapse=!0,t.DomEvent.stop(o),n._geocodeResultSelected(e),t.DomEvent.on(s,"click touchend",function(){n.options.collapsed?n._collapse():n._clearResults()})},this),s},s._keydown=function(e){var o=this,n=function(e){o._selection&&(t.DomUtil.removeClass(o._selection,"leaflet-control-geocoder-selected"),o._selection=o._selection[e>0?"nextSibling":"previousSibling"]),o._selection||(o._selection=o._alts[e>0?"firstChild":"lastChild"]),o._selection&&t.DomUtil.addClass(o._selection,"leaflet-control-geocoder-selected")};switch(e.keyCode){case 27:this.options.collapsed?this._collapse():this._clearResults();break;case 38:n(-1);break;case 40:n(1);break;case 13:if(this._selection){var s=parseInt(this._selection.getAttribute("data-result-index"),10);this._geocodeResultSelected(this._results[s]),this._clearResults()}else this._geocode();break;default:return}t.DomEvent.preventDefault(e)},s._change=function(){var t=this,e=this._input.value;e!==this._lastGeocode&&(clearTimeout(this._suggestTimeout),e.length>=this.options.suggestMinLength?this._suggestTimeout=setTimeout(function(){return t._geocode(!0)},this.options.suggestTimeout):this._clearResults())},n}(t.Control);return t.Util.extend(N,T),t.Util.extend(t.Control,{Geocoder:N,geocoder:function(t){return new N(t)}}),N}(L);
var leafletControlGeocoder=function(t){function e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function o(e,o){return t.Util.extend(o,e.geocodingQueryParams)}function n(e,o){return t.Util.extend(o,e.reverseQueryParams)}var s=0,i=/[&<>"'`]/g,r=/[&<>"'`]/,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};function l(t){return a[t]}function c(e,o,n,i,r){var a="_l_geocoder_"+s++;o[r||"callback"]=a,window[a]=t.Util.bind(n,i);var l=document.createElement("script");l.type="text/javascript",l.src=e+u(o),l.id=a,document.getElementsByTagName("head")[0].appendChild(l)}function p(t,e,o){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){var t;if(200!==n.status&&304!==n.status)t="";else if("string"==typeof n.response)try{t=JSON.parse(n.response)}catch(e){t=n.response}else t=n.response;o(t)}},n.open("GET",t+u(e),!0),n.responseType="json",n.setRequestHeader("Accept","application/json"),n.send(null)}function u(t,e,o){var n=[];for(var s in t){var i=encodeURIComponent(o?s.toUpperCase():s),r=t[s];if(Array.isArray(r))for(var a=0;a<r.length;a++)n.push(i+"="+encodeURIComponent(r[a]));else n.push(i+"="+encodeURIComponent(String(r)))}return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var d=function(){function e(e){this.options={serviceUrl:"https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",apiKey:""},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){var i=o(this.options,{token:this.options.apiKey,SingleLine:e,outFields:"Addr_Type",forStorage:!1,maxLocations:10,f:"json"});p(this.options.serviceUrl+"/findAddressCandidates",i,function(e){var o=[];if(e.candidates&&e.candidates.length)for(var i=0;i<=e.candidates.length-1;i++){var r=e.candidates[i],a=t.latLng(r.location.y,r.location.x),l=t.latLngBounds(t.latLng(r.extent.ymax,r.extent.xmax),t.latLng(r.extent.ymin,r.extent.xmin));o[i]={name:r.address,bbox:l,center:a}}n.call(s,o)})},s.suggest=function(t,e,o){return this.geocode(t,e,o)},s.reverse=function(e,o,s,i){var r=n(this.options,{location:encodeURIComponent(e.lng)+","+encodeURIComponent(e.lat),distance:100,f:"json"});p(this.options.serviceUrl+"/reverseGeocode",r,function(e){var o=[];if(e&&!e.error){var n=t.latLng(e.location.y,e.location.x),r=t.latLngBounds(n,n);o.push({name:e.address.Match_addr,center:n,bbox:r})}s.call(i,o)})},e}(),h=function(){function e(e){this.options={serviceUrl:"https://dev.virtualearth.net/REST/v1/Locations"},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){var i=o(this.options,{query:e,key:this.options.apiKey});c(this.options.apiKey,i,function(e){var o=[];if(e.resourceSets.length>0)for(var i=e.resourceSets[0].resources.length-1;i>=0;i--){var r=e.resourceSets[0].resources[i],a=r.bbox;o[i]={name:r.name,bbox:t.latLngBounds([a[0],a[1]],[a[2],a[3]]),center:t.latLng(r.point.coordinates)}}n.call(s,o)},this,"jsonp")},s.reverse=function(e,o,s,i){var r=n(this.options,{key:this.options.apiKey});c(this.options.serviceUrl+e.lat+","+e.lng,r,function(e){for(var o=[],n=e.resourceSets[0].resources.length-1;n>=0;n--){var r=e.resourceSets[0].resources[n],a=r.bbox;o[n]={name:r.name,bbox:t.latLngBounds([a[0],a[1]],[a[2],a[3]]),center:t.latLng(r.point.coordinates)}}s.call(i,o)},this,"jsonp")},e}(),g=function(){function e(e){this.options={serviceUrl:"https://maps.googleapis.com/maps/api/geocode/json"},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){var i=o(this.options,{key:this.options.apiKey,address:e});p(this.options.serviceUrl,i,function(e){var o=[];if(e.results&&e.results.length)for(var i=0;i<=e.results.length-1;i++){var r=e.results[i],a=t.latLng(r.geometry.location),l=t.latLngBounds(t.latLng(r.geometry.viewport.northeast),t.latLng(r.geometry.viewport.southwest));o[i]={name:r.formatted_address,bbox:l,center:a,properties:r.address_components}}n.call(s,o)})},s.reverse=function(e,o,s,i){var r=n(this.options,{key:this.options.apiKey,latlng:encodeURIComponent(e.lat)+","+encodeURIComponent(e.lng)});p(this.options.serviceUrl,r,function(e){var o=[];if(e.results&&e.results.length)for(var n=0;n<=e.results.length-1;n++){var r=e.results[n],a=t.latLng(r.geometry.location),l=t.latLngBounds(t.latLng(r.geometry.viewport.northeast),t.latLng(r.geometry.viewport.southwest));o[n]={name:r.formatted_address,bbox:l,center:a,properties:r.address_components}}s.call(i,o)})},e}(),f=function(){function e(e){if(this.options={serviceUrl:"https://geocoder.api.here.com/6.2/",app_id:"",app_code:"",reverseGeocodeProxRadius:null},t.Util.setOptions(this,e),e.apiKey)throw Error("apiKey is not supported, use app_id/app_code instead!")}var s=e.prototype;return s.geocode=function(t,e,n){var s=o(this.options,{searchtext:t,gen:9,app_id:this.options.app_id,app_code:this.options.app_code,jsonattributes:1});this.getJSON(this.options.serviceUrl+"geocode.json",s,e,n)},s.reverse=function(t,e,o,s){var i=this.options.reverseGeocodeProxRadius?this.options.reverseGeocodeProxRadius:null,r=i?","+encodeURIComponent(i):"",a=n(this.options,{prox:encodeURIComponent(t.lat)+","+encodeURIComponent(t.lng)+r,mode:"retrieveAddresses",app_id:this.options.app_id,app_code:this.options.app_code,gen:9,jsonattributes:1});this.getJSON(this.options.serviceUrl+"reversegeocode.json",a,o,s)},s.getJSON=function(e,o,n,s){p(e,o,function(e){var o=[];if(e.response.view&&e.response.view.length)for(var i=0;i<=e.response.view[0].result.length-1;i++){var r=e.response.view[0].result[i].location,a=t.latLng(r.displayPosition.latitude,r.displayPosition.longitude),l=t.latLngBounds(t.latLng(r.mapView.topLeft.latitude,r.mapView.topLeft.longitude),t.latLng(r.mapView.bottomRight.latitude,r.mapView.bottomRight.longitude));o[i]={name:r.address.label,properties:r.address,bbox:l,center:a}}n.call(s,o)})},e}();function m(e){var o;return(o=e.match(/^([NS])\s*(\d{1,3}(?:\.\d*)?)\W*([EW])\s*(\d{1,3}(?:\.\d*)?)$/))?t.latLng((/N/i.test(o[1])?1:-1)*parseFloat(o[2]),(/E/i.test(o[3])?1:-1)*parseFloat(o[4])):(o=e.match(/^(\d{1,3}(?:\.\d*)?)\s*([NS])\W*(\d{1,3}(?:\.\d*)?)\s*([EW])$/))?t.latLng((/N/i.test(o[2])?1:-1)*parseFloat(o[1]),(/E/i.test(o[4])?1:-1)*parseFloat(o[3])):(o=e.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?$/))?t.latLng((/N/i.test(o[1])?1:-1)*(parseFloat(o[2])+parseFloat(o[3])/60),(/E/i.test(o[4])?1:-1)*(parseFloat(o[5])+parseFloat(o[6])/60)):(o=e.match(/^(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([NS])\W*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([EW])$/))?t.latLng((/N/i.test(o[3])?1:-1)*(parseFloat(o[1])+parseFloat(o[2])/60),(/E/i.test(o[6])?1:-1)*(parseFloat(o[4])+parseFloat(o[5])/60)):(o=e.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?$/))?t.latLng((/N/i.test(o[1])?1:-1)*(parseFloat(o[2])+parseFloat(o[3])/60+parseFloat(o[4])/3600),(/E/i.test(o[5])?1:-1)*(parseFloat(o[6])+parseFloat(o[7])/60+parseFloat(o[8])/3600)):(o=e.match(/^(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]\s*([NS])\W*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?\s*([EW])$/))?t.latLng((/N/i.test(o[4])?1:-1)*(parseFloat(o[1])+parseFloat(o[2])/60+parseFloat(o[3])/3600),(/E/i.test(o[8])?1:-1)*(parseFloat(o[5])+parseFloat(o[6])/60+parseFloat(o[7])/3600)):(o=e.match(/^\s*([+-]?\d+(?:\.\d*)?)\s*[\s,]\s*([+-]?\d+(?:\.\d*)?)\s*$/))?t.latLng(parseFloat(o[1]),parseFloat(o[2])):void 0}var v=function(){function e(e){this.options={next:void 0,sizeInMeters:1e4},t.Util.setOptions(this,e)}return e.prototype.geocode=function(t,e,o){var n=m(t);if(n){var s=[{name:t,center:n,bbox:n.toBounds(this.options.sizeInMeters)}];e.call(o,s)}else this.options.next&&this.options.next.geocode(t,e,o)},e}(),_=function(){function e(e){this.options={serviceUrl:"https://api.mapbox.com/geocoding/v5/mapbox.places/"},t.Util.setOptions(this,e)}var s=e.prototype;return s._getProperties=function(t){for(var e={text:t.text,address:t.address},o=0;o<(t.context||[]).length;o++)e[t.context[o].id.split(".")[0]]=t.context[o].text,t.context[o].short_code&&(e.countryShortCode=t.context[o].short_code);return e},s.geocode=function(e,n,s){var i=this,r=o(this.options,{access_token:this.options.apiKey});void 0!==r.proximity&&void 0!==r.proximity.lat&&void 0!==r.proximity.lng&&(r.proximity=r.proximity.lng+","+r.proximity.lat),p(this.options.serviceUrl+encodeURIComponent(e)+".json",r,function(e){var o=[];if(e.features&&e.features.length)for(var r=0;r<=e.features.length-1;r++){var a,l=e.features[r],c=t.latLng(l.center.reverse());a=l.bbox?t.latLngBounds(t.latLng(l.bbox.slice(0,2).reverse()),t.latLng(l.bbox.slice(2,4).reverse())):t.latLngBounds(c,c),o[r]={name:l.place_name,bbox:a,center:c,properties:i._getProperties(l)}}n.call(s,o)})},s.suggest=function(t,e,o){return this.geocode(t,e,o)},s.reverse=function(e,o,s,i){var r=this,a=n(this.options,{access_token:this.options.apiKey});p(this.options.serviceUrl+encodeURIComponent(e.lng)+","+encodeURIComponent(e.lat)+".json",a,function(e){var o=[];if(e.features&&e.features.length)for(var n=0;n<=e.features.length-1;n++){var a,l=e.features[n],c=t.latLng(l.center.reverse());a=l.bbox?t.latLngBounds(t.latLng(l.bbox.slice(0,2).reverse()),t.latLng(l.bbox.slice(2,4).reverse())):t.latLngBounds(c,c),o[n]={name:l.place_name,bbox:a,center:c,properties:r._getProperties(l)}}s.call(i,o)})},e}(),b=function(){function e(e){this.options={serviceUrl:"https://www.mapquestapi.com/geocoding/v1"},t.Util.setOptions(this,e),this.options.apiKey=decodeURIComponent(this.options.apiKey)}var s=e.prototype;return s._formatName=function(){return[].slice.call(arguments).filter(function(t){return!!t}).join(", ")},s.geocode=function(e,n,s){var i=o(this.options,{key:this.options.apiKey,location:e,limit:5,outFormat:"json"});p(this.options.serviceUrl+"/address",i,t.Util.bind(function(e){var o=[];if(e.results&&e.results[0].locations)for(var i=e.results[0].locations.length-1;i>=0;i--){var r=e.results[0].locations[i],a=t.latLng(r.latLng);o[i]={name:this._formatName(r.street,r.adminArea4,r.adminArea3,r.adminArea1),bbox:t.latLngBounds(a,a),center:a}}n.call(s,o)},this))},s.reverse=function(e,o,s,i){var r=n(this.options,{key:this.options.apiKey,location:e.lat+","+e.lng,outputFormat:"json"});p(this.options.serviceUrl+"/reverse",r,t.Util.bind(function(e){var o=[];if(e.results&&e.results[0].locations)for(var n=e.results[0].locations.length-1;n>=0;n--){var r=e.results[0].locations[n],a=t.latLng(r.latLng);o[n]={name:this._formatName(r.street,r.adminArea4,r.adminArea3,r.adminArea1),bbox:t.latLngBounds(a,a),center:a}}s.call(i,o)},this))},e}(),y=function(){function e(e){this.options={userId:void 0,apiKey:void 0,serviceUrl:"https://neutrinoapi.com/"},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){var i=o(this.options,{apiKey:this.options.apiKey,userId:this.options.userId,address:e.split(/\s+/).join(".")});p(this.options.serviceUrl+"geocode-address",i,function(e){var o=[];if(e.locations){e.geometry=e.locations[0];var i=t.latLng(e.geometry.latitude,e.geometry.longitude),r=t.latLngBounds(i,i);o[0]={name:e.geometry.address,bbox:r,center:i}}n.call(s,o)})},s.suggest=function(t,e,o){return this.geocode(t,e,o)},s.reverse=function(e,o,s,i){var r=n(this.options,{apiKey:this.options.apiKey,userId:this.options.userId,latitude:e.lat,longitude:e.lng});p(this.options.serviceUrl+"geocode-reverse",r,function(o){var n=[];if(200==o.status.status&&o.found){var r=t.latLng(e.lat,e.lng),a=t.latLngBounds(r,r);n[0]={name:o.address,bbox:a,center:r}}s.call(i,n)})},e}(),L=function(){function e(e){this.options={serviceUrl:"https://nominatim.openstreetmap.org/",htmlTemplate:function(t){var e,o,n=t.address,s=[];return(n.road||n.building)&&s.push("{building} {road} {house_number}"),(n.city||n.town||n.village||n.hamlet)&&s.push('<span class="'+(s.length>0?"leaflet-control-geocoder-address-detail":"")+'">{postcode} {city} {town} {village} {hamlet}</span>'),(n.state||n.country)&&s.push('<span class="'+(s.length>0?"leaflet-control-geocoder-address-context":"")+'">{state} {country}</span>'),e=s.join("<br/>"),o=n,e.replace(/\{ *([\w_]+) *\}/g,function(t,e){var n,s=o[e];return void 0===s?s="":"function"==typeof s&&(s=s(o)),null==(n=s)?"":n?r.test(n=""+n)?n.replace(i,l):n:n+""})}},t.Util.setOptions(this,e||{})}var s=e.prototype;return s.geocode=function(e,n,s){var i=this,r=o(this.options,{q:e,limit:5,format:"json",addressdetails:1});p(this.options.serviceUrl+"search",r,function(e){for(var o=[],r=e.length-1;r>=0;r--){for(var a=e[r].boundingbox,l=0;l<4;l++)a[l]=parseFloat(a[l]);o[r]={icon:e[r].icon,name:e[r].display_name,html:i.options.htmlTemplate?i.options.htmlTemplate(e[r]):void 0,bbox:t.latLngBounds([a[0],a[2]],[a[1],a[3]]),center:t.latLng(e[r].lat,e[r].lon),properties:e[r]}}n.call(s,o)})},s.reverse=function(e,o,s,i){var r=this,a=n(this.options,{lat:e.lat,lon:e.lng,zoom:Math.round(Math.log(o/256)/Math.log(2)),addressdetails:1,format:"json"});p(this.options.serviceUrl+"reverse",a,function(e){var o=[];if(e&&e.lat&&e.lon){var n=t.latLng(e.lat,e.lon),a=t.latLngBounds(n,n);o.push({name:e.display_name,html:r.options.htmlTemplate?r.options.htmlTemplate(e):void 0,center:n,bbox:a,properties:e})}s.call(i,o)})},e}(),U=function(){function e(e){t.Util.setOptions(this,e)}var o=e.prototype;return o.geocode=function(e,o,n){try{var s=this.options.OpenLocationCode.decode(e),i={name:e,center:t.latLng(s.latitudeCenter,s.longitudeCenter),bbox:t.latLngBounds(t.latLng(s.latitudeLo,s.longitudeLo),t.latLng(s.latitudeHi,s.longitudeHi))};o.call(n,[i])}catch(t){console.warn(t),o.call(n,[])}},o.reverse=function(e,o,n,s){try{var i={name:this.options.OpenLocationCode.encode(e.lat,e.lng,this.options.codeLength),center:t.latLng(e.lat,e.lng),bbox:t.latLngBounds(t.latLng(e.lat,e.lng),t.latLng(e.lat,e.lng))};n.call(s,[i])}catch(t){console.warn(t),n.call(s,[])}},e}(),x=function(){function e(e){this.options={serviceUrl:"https://api.opencagedata.com/geocode/v1/json"},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){var i=o(this.options,{key:this.options.apiKey,q:e});p(this.options.serviceUrl,i,function(e){var o=[];if(e.results&&e.results.length)for(var i=0;i<e.results.length;i++){var r,a=e.results[i],l=t.latLng(a.geometry);r=a.annotations&&a.annotations.bounds?t.latLngBounds(t.latLng(a.annotations.bounds.northeast),t.latLng(a.annotations.bounds.southwest)):t.latLngBounds(l,l),o.push({name:a.formatted,bbox:r,center:l})}n.call(s,o)})},s.suggest=function(t,e,o){return this.geocode(t,e,o)},s.reverse=function(e,o,s,i){var r=n(this.options,{key:this.options.apiKey,q:[e.lat,e.lng].join(",")});p(this.options.serviceUrl,r,function(e){var o=[];if(e.results&&e.results.length)for(var n=0;n<e.results.length;n++){var r,a=e.results[n],l=t.latLng(a.geometry);r=a.annotations&&a.annotations.bounds?t.latLngBounds(t.latLng(a.annotations.bounds.northeast),t.latLng(a.annotations.bounds.southwest)):t.latLngBounds(l,l),o.push({name:a.formatted,bbox:r,center:l})}s.call(i,o)})},e}(),w=function(){function e(e){this.options={serviceUrl:"https://api.geocode.earth/v1"},this._lastSuggest=0,t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(t,e,n){var s=this,i=o(this.options,{api_key:this.options.apiKey,text:t});p(this.options.serviceUrl+"/search",i,function(t){e.call(n,s._parseResults(t,"bbox"))})},s.suggest=function(t,e,n){var s=this,i=o(this.options,{api_key:this.options.apiKey,text:t});p(this.options.serviceUrl+"/autocomplete",i,function(t){t.geocoding.timestamp>s._lastSuggest&&(s._lastSuggest=t.geocoding.timestamp,e.call(n,s._parseResults(t,"bbox")))})},s.reverse=function(t,e,o,s){var i=this,r=n(this.options,{api_key:this.options.apiKey,"point.lat":t.lat,"point.lon":t.lng});p(this.options.serviceUrl+"/reverse",r,function(t){o.call(s,i._parseResults(t,"bounds"))})},s._parseResults=function(e,o){var n=[];return t.geoJSON(e,{pointToLayer:function(e,o){return t.circleMarker(o)},onEachFeature:function(e,s){var i,r,a={};s.getBounds?r=(i=s.getBounds()).getCenter():s.feature.bbox?(r=s.getLatLng(),i=t.latLngBounds(t.GeoJSON.coordsToLatLng(s.feature.bbox.slice(0,2)),t.GeoJSON.coordsToLatLng(s.feature.bbox.slice(2,4)))):(r=s.getLatLng(),i=t.latLngBounds(r,r)),a.name=s.feature.properties.label,a.center=r,a[o]=i,a.properties=s.feature.properties,n.push(a)}}),n},e}();function C(t){return new w(t)}var k=w,D=C,E=w,R=C,B=function(o){function n(e){return o.call(this,t.Util.extend({serviceUrl:"https://api.openrouteservice.org/geocode"},e))||this}return e(n,o),n}(w),F=function(){function e(e){this.options={serviceUrl:"https://photon.komoot.io/api/",reverseUrl:"https://photon.komoot.io/reverse/",nameProperties:["name","street","suburb","hamlet","town","city","state","country"]},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){var i=o(this.options,{q:e});p(this.options.serviceUrl,i,t.Util.bind(function(t){n.call(s,this._decodeFeatures(t))},this))},s.suggest=function(t,e,o){return this.geocode(t,e,o)},s.reverse=function(e,o,s,i){var r=n(this.options,{lat:e.lat,lon:e.lng});p(this.options.reverseUrl,r,t.Util.bind(function(t){s.call(i,this._decodeFeatures(t))},this))},s._decodeFeatures=function(e){var o=[];if(e&&e.features)for(var n=0;n<e.features.length;n++){var s=e.features[n],i=s.geometry.coordinates,r=t.latLng(i[1],i[0]),a=s.properties.extent,l=a?t.latLngBounds([a[1],a[0]],[a[3],a[2]]):t.latLngBounds(r,r);o.push({name:this._decodeFeatureName(s),html:this.options.htmlTemplate?this.options.htmlTemplate(s):void 0,center:r,bbox:l,properties:s.properties})}return o},s._decodeFeatureName=function(t){return(this.options.nameProperties||[]).map(function(e){return t.properties[e]}).filter(function(t){return!!t}).join(", ")},e}(),S=function(){function e(e){this.options={serviceUrl:"https://api.what3words.com/v2/"},t.Util.setOptions(this,e)}var s=e.prototype;return s.geocode=function(e,n,s){p(this.options.serviceUrl+"forward",o(this.options,{key:this.options.apiKey,addr:e.split(/\s+/).join(".")}),function(e){var o=[];if(e.geometry){var i=t.latLng(e.geometry.lat,e.geometry.lng),r=t.latLngBounds(i,i);o[0]={name:e.words,bbox:r,center:i}}n.call(s,o)})},s.suggest=function(t,e,o){return this.geocode(t,e,o)},s.reverse=function(e,o,s,i){p(this.options.serviceUrl+"reverse",n(this.options,{key:this.options.apiKey,coords:[e.lat,e.lng].join(",")}),function(e){var o=[];if(200==e.status.status){var n=t.latLng(e.geometry.lat,e.geometry.lng),r=t.latLngBounds(n,n);o[0]={name:e.words,bbox:r,center:n}}s.call(i,o)})},e}(),T={__proto__:null,geocodingParams:o,reverseParams:n,ArcGis:d,arcgis:function(t){return new d(t)},Bing:h,bing:function(t){return new h(t)},Google:g,google:function(t){return new g(t)},HERE:f,here:function(t){return new f(t)},parseLatLng:m,LatLng:v,latLng:function(t){return new v(t)},Mapbox:_,mapbox:function(t){return new _(t)},MapQuest:b,mapQuest:function(t){return new b(t)},Neutrino:y,neutrino:function(t){return new y(t)},Nominatim:L,nominatim:function(t){return new L(t)},OpenLocationCode:U,openLocationCode:function(t){return new U(t)},OpenCage:x,opencage:function(t){return new x(t)},Pelias:w,pelias:C,GeocodeEarth:k,geocodeEarth:D,Mapzen:E,mapzen:R,Openrouteservice:B,openrouteservice:function(t){return new B(t)},Photon:F,photon:function(t){return new F(t)},What3Words:S,what3words:function(t){return new S(t)}},N=function(){};t.Util.extend(N.prototype,t.Control.prototype),t.Util.extend(N.prototype,t.Evented.prototype);var O=function(o){function n(e){var n;return(n=o.call(this,e)||this).options={showUniqueResult:!0,showResultIcons:!1,collapsed:!0,expand:"touch",position:"topright",placeholder:"Search...",errorMessage:"Nothing found.",iconLabel:"Initiate a new search",query:"",queryMinLength:1,suggestMinLength:3,suggestTimeout:250,defaultMarkGeocode:!0},n._requestCount=0,t.Util.setOptions(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n),e),n.options.geocoder||(n.options.geocoder=new L),n}e(n,o);var s=n.prototype;return s.addThrobberClass=function(){t.DomUtil.addClass(this._container,"leaflet-control-geocoder-throbber")},s.removeThrobberClass=function(){t.DomUtil.removeClass(this._container,"leaflet-control-geocoder-throbber")},s.onAdd=function(e){var o=this,n="leaflet-control-geocoder",s=t.DomUtil.create("div",n+" leaflet-bar"),i=t.DomUtil.create("button",n+"-icon",s),r=this._form=t.DomUtil.create("div",n+"-form",s);this._map=e,this._container=s,i.innerHTML="&nbsp;",i.type="button",i.setAttribute("aria-label",this.options.iconLabel);var a=this._input=t.DomUtil.create("input","",r);return a.type="text",a.value=this.options.query,a.placeholder=this.options.placeholder,t.DomEvent.disableClickPropagation(a),this._errorElement=t.DomUtil.create("div",n+"-form-no-error",s),this._errorElement.innerHTML=this.options.errorMessage,this._alts=t.DomUtil.create("ul",n+"-alternatives leaflet-control-geocoder-alternatives-minimized",s),t.DomEvent.disableClickPropagation(this._alts),t.DomEvent.addListener(a,"keydown",this._keydown,this),this.options.geocoder.suggest&&t.DomEvent.addListener(a,"input",this._change,this),t.DomEvent.addListener(a,"blur",function(){o.options.collapsed&&!o._preventBlurCollapse&&o._collapse(),o._preventBlurCollapse=!1}),this.options.collapsed?"click"===this.options.expand?t.DomEvent.addListener(s,"click",function(t){0===t.button&&2!==t.detail&&o._toggle()}):"touch"===this.options.expand?t.DomEvent.addListener(s,t.Browser.touch?"touchstart mousedown":"mousedown",function(t){o._toggle(),t.preventDefault(),t.stopPropagation()},this):(t.DomEvent.addListener(s,"mouseover",this._expand,this),t.DomEvent.addListener(s,"mouseout",this._collapse,this),this._map.on("movestart",this._collapse,this)):(this._expand(),t.DomEvent.addListener(s,t.Browser.touch?"touchstart":"click",function(){return o._geocode()})),this.options.defaultMarkGeocode&&this.on("markgeocode",this.markGeocode,this),this.on("startgeocode",this.addThrobberClass,this),this.on("finishgeocode",this.removeThrobberClass,this),this.on("startsuggest",this.addThrobberClass,this),this.on("finishsuggest",this.removeThrobberClass,this),t.DomEvent.disableClickPropagation(s),s},s.setQuery=function(t){return this._input.value=t,this},s._geocodeResult=function(e,o){if(!o&&this.options.showUniqueResult&&1===e.length)this._geocodeResultSelected(e[0]);else if(e.length>0){this._alts.innerHTML="",this._results=e,t.DomUtil.removeClass(this._alts,"leaflet-control-geocoder-alternatives-minimized"),t.DomUtil.addClass(this._container,"leaflet-control-geocoder-options-open");for(var n=0;n<e.length;n++)this._alts.appendChild(this._createAlt(e[n],n))}else t.DomUtil.addClass(this._container,"leaflet-control-geocoder-options-error"),t.DomUtil.addClass(this._errorElement,"leaflet-control-geocoder-error")},s.markGeocode=function(e){return this._map.fitBounds((e=e.geocode||e).bbox),this._geocodeMarker&&this._map.removeLayer(this._geocodeMarker),this._geocodeMarker=new t.Marker(e.center).bindPopup(e.html||e.name).addTo(this._map).openPopup(),this},s._geocode=function(t){var e=this,o=this._input.value;if(t||!(o.length<this.options.queryMinLength)){var n=++this._requestCount,s=function(s){n===e._requestCount&&(e.fire(t?"finishsuggest":"finishgeocode",{input:o,results:s}),e._geocodeResult(s,t))};this._lastGeocode=o,t||this._clearResults(),this.fire(t?"startsuggest":"startgeocode",{input:o}),t?this.options.geocoder.suggest(o,s):this.options.geocoder.geocode(o,s)}},s._geocodeResultSelected=function(t){this.fire("markgeocode",{geocode:t})},s._toggle=function(){t.DomUtil.hasClass(this._container,"leaflet-control-geocoder-expanded")?this._collapse():this._expand()},s._expand=function(){t.DomUtil.addClass(this._container,"leaflet-control-geocoder-expanded"),this._input.select(),this.fire("expand")},s._collapse=function(){t.DomUtil.removeClass(this._container,"leaflet-control-geocoder-expanded"),t.DomUtil.addClass(this._alts,"leaflet-control-geocoder-alternatives-minimized"),t.DomUtil.removeClass(this._errorElement,"leaflet-control-geocoder-error"),t.DomUtil.removeClass(this._container,"leaflet-control-geocoder-options-open"),t.DomUtil.removeClass(this._container,"leaflet-control-geocoder-options-error"),this._input.blur(),this.fire("collapse")},s._clearResults=function(){t.DomUtil.addClass(this._alts,"leaflet-control-geocoder-alternatives-minimized"),this._selection=null,t.DomUtil.removeClass(this._errorElement,"leaflet-control-geocoder-error"),t.DomUtil.removeClass(this._container,"leaflet-control-geocoder-options-open"),t.DomUtil.removeClass(this._container,"leaflet-control-geocoder-options-error")},s._createAlt=function(e,o){var n=this,s=t.DomUtil.create("li",""),i=t.DomUtil.create("a","",s),r=this.options.showResultIcons&&e.icon?t.DomUtil.create("img","",i):null,a=e.html?void 0:document.createTextNode(e.name);return r&&(r.src=e.icon),s.setAttribute("data-result-index",String(o)),e.html?i.innerHTML=i.innerHTML+e.html:a&&i.appendChild(a),t.DomEvent.addListener(s,"mousedown touchstart",function(o){n._preventBlurCollapse=!0,t.DomEvent.stop(o),n._geocodeResultSelected(e),t.DomEvent.on(s,"click touchend",function(){n.options.collapsed?n._collapse():n._clearResults()})},this),s},s._keydown=function(e){var o=this,n=function(e){o._selection&&(t.DomUtil.removeClass(o._selection,"leaflet-control-geocoder-selected"),o._selection=o._selection[e>0?"nextSibling":"previousSibling"]),o._selection||(o._selection=o._alts[e>0?"firstChild":"lastChild"]),o._selection&&t.DomUtil.addClass(o._selection,"leaflet-control-geocoder-selected")};switch(e.keyCode){case 27:this.options.collapsed?this._collapse():this._clearResults();break;case 38:n(-1);break;case 40:n(1);break;case 13:if(this._selection){var s=parseInt(this._selection.getAttribute("data-result-index"),10);this._geocodeResultSelected(this._results[s]),this._clearResults()}else this._geocode();break;default:return}t.DomEvent.preventDefault(e)},s._change=function(){var t=this,e=this._input.value;e!==this._lastGeocode&&(clearTimeout(this._suggestTimeout),e.length>=this.options.suggestMinLength?this._suggestTimeout=setTimeout(function(){return t._geocode(!0)},this.options.suggestTimeout):this._clearResults())},n}(N);return t.Util.extend(O,T),t.Util.extend(t.Control,{Geocoder:O,geocoder:function(t){return new O(t)}}),O}(L);
//# sourceMappingURL=Control.Geocoder.min.js.map

@@ -1351,6 +1351,21 @@ import { Util, latLng as latLng$1, latLngBounds, geoJSON, circleMarker, GeoJSON, Control, Evented, DomUtil, DomEvent, Browser, Marker } from 'leaflet';

/**
* Leaflet mixins https://leafletjs.com/reference-1.7.1.html#class-includes
* for TypeScript https://www.typescriptlang.org/docs/handbook/mixins.html
* @internal
*/
class EventedControl {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
constructor(...args) {// empty
}
}
Util.extend(EventedControl.prototype, Control.prototype);
Util.extend(EventedControl.prototype, Evented.prototype);
/**
* This is the geocoder control. It works like any other [Leaflet control](https://leafletjs.com/reference.html#control), and is added to the map.
*/
class GeocoderControl extends Control {
class GeocoderControl extends EventedControl {
/**

@@ -1384,42 +1399,3 @@ * Instantiates a geocoder control (to be invoked using `new`)

}
/**
* Adds a listener function to a particular event type of the object.
* @param type the event type
* @param fn the listener function
* @param context the this listener function context
* @see https://leafletjs.com/reference.html#evented-on
*/
on(type, fn, context) {
Evented.prototype.on(type, fn, context);
return this;
}
/**
* Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object.
* @param type the event type
* @param fn the listener function
* @param context the this listener function context
* @see https://leafletjs.com/reference.html#evented-off
*/
off(type, fn, context) {
Evented.prototype.off(type, fn, context);
return this;
}
/**
* Fires an event of the specified type. You can optionally provide an data object.
* @param type the event type
* @param data the event data object
* @param propagate whether to propagate to event parents
* @see https://leafletjs.com/reference.html#evented-fire
*/
fire(type, data, propagate) {
Evented.prototype.fire(type, data, propagate);
return this;
}
addThrobberClass() {

@@ -1426,0 +1402,0 @@ DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber');

{
"name": "leaflet-control-geocoder",
"version": "2.0.0",
"version": "2.0.1",
"description": "Extendable geocoder with builtin support for OpenStreetMap Nominatim, Bing, Google, Mapbox, MapQuest, What3Words, Photon, Pelias, HERE, Neutrino, Plus codes",

@@ -5,0 +5,0 @@ "source": "src/index.ts",

@@ -60,6 +60,26 @@ import * as L from 'leaflet';

/**
* Leaflet mixins https://leafletjs.com/reference-1.7.1.html#class-includes
* for TypeScript https://www.typescriptlang.org/docs/handbook/mixins.html
* @internal
*/
class EventedControl {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
constructor(...args: any[]) {
// empty
}
}
/**
* @internal
*/
interface EventedControl extends L.Control, L.Evented {}
L.Util.extend(EventedControl.prototype, L.Control.prototype);
L.Util.extend(EventedControl.prototype, L.Evented.prototype);
/**
* This is the geocoder control. It works like any other [Leaflet control](https://leafletjs.com/reference.html#control), and is added to the map.
*/
export class GeocoderControl extends L.Control {
export class GeocoderControl extends EventedControl {
options: GeocoderControlOptions = {

@@ -107,38 +127,2 @@ showUniqueResult: true,

/**
* Adds a listener function to a particular event type of the object.
* @param type the event type
* @param fn the listener function
* @param context the this listener function context
* @see https://leafletjs.com/reference.html#evented-on
*/
on(type: string, fn: L.LeafletEventHandlerFn, context?: any): this {
L.Evented.prototype.on(type, fn, context);
return this;
}
/**
* Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object.
* @param type the event type
* @param fn the listener function
* @param context the this listener function context
* @see https://leafletjs.com/reference.html#evented-off
*/
off(type: string, fn?: L.LeafletEventHandlerFn, context?: any): this {
L.Evented.prototype.off(type, fn, context);
return this;
}
/**
* Fires an event of the specified type. You can optionally provide an data object.
* @param type the event type
* @param data the event data object
* @param propagate whether to propagate to event parents
* @see https://leafletjs.com/reference.html#evented-fire
*/
fire(type: string, data?: any, propagate?: boolean): this {
L.Evented.prototype.fire(type, data, propagate);
return this;
}
addThrobberClass() {

@@ -145,0 +129,0 @@ L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber');

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc