diff --git a/README.md b/README.md index 45d5865..24dcd8a 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This package contains following packages: - [Leaflet-omnivore 0.3.4](https://github.com/mapbox/leaflet-omnivore) - [Leaflet.loading 0.1.24](https://github.com/ebrelsford/Leaflet.loading) - [Leaflet.Control.FullScreen 1.4.5](https://github.com/brunob/leaflet.fullscreen) - - [Leaflet Control Geocoder 1.6.0](https://github.com/perliedman/leaflet-control-geocoder) + - [Leaflet Control Geocoder 1.13.0](https://github.com/perliedman/leaflet-control-geocoder) - [Leaflet.ExtraMarkers 1.0.8](https://github.com/coryasilva/Leaflet.ExtraMarkers) - [leaflet.pm 0.25.0](https://github.com/codeofsumit/leaflet.pm) - [osmtogeojson 2.2.12](https://github.com/tyrasd/osmtogeojson) diff --git a/assets/control-geocoder/Control.Geocoder.js b/assets/control-geocoder/Control.Geocoder.js index 78408d4..dcbd4b7 100644 --- a/assets/control-geocoder/Control.Geocoder.js +++ b/assets/control-geocoder/Control.Geocoder.js @@ -1,540 +1,210 @@ +/* @preserve + * Leaflet Control Geocoder 1.13.0 + * https://github.com/perliedman/leaflet-control-geocoder + * + * Copyright (c) 2012 sa3m (https://github.com/sa3m) + * Copyright (c) 2018 Per Liedman + * All rights reserved. + */ + this.L = this.L || {}; this.L.Control = this.L.Control || {}; this.L.Control.Geocoder = (function (L) { -'use strict'; + 'use strict'; -L = L && L.hasOwnProperty('default') ? L['default'] : L; + L = L && L.hasOwnProperty('default') ? L['default'] : L; -var lastCallbackId = 0; + var lastCallbackId = 0; -// Adapted from handlebars.js -// https://github.com/wycats/handlebars.js/ -var badChars = /[&<>"'`]/g; -var possible = /[&<>"'`]/; -var escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' -}; - -function escapeChar(chr) { - return escape[chr]; -} - -function htmlEscape(string) { - if (string == null) { - return ''; - } else if (!string) { - return string + ''; - } - - // Force a string conversion as this will be done by the append regardless and - // the regex test will do this transparently behind the scenes, causing issues if - // an object's to string has escaped characters in it. - string = '' + string; - - if (!possible.test(string)) { - return string; - } - return string.replace(badChars, escapeChar); -} - -function jsonp(url, params, callback, context, jsonpParam) { - var callbackId = '_l_geocoder_' + lastCallbackId++; - params[jsonpParam || 'callback'] = callbackId; - window[callbackId] = L.Util.bind(callback, context); - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.src = url + L.Util.getParamString(params); - script.id = callbackId; - document.getElementsByTagName('head')[0].appendChild(script); -} - -function getJSON(url, params, callback) { - var xmlHttp = new XMLHttpRequest(); - xmlHttp.onreadystatechange = function() { - if (xmlHttp.readyState !== 4) { - return; - } - if (xmlHttp.status !== 200 && xmlHttp.status !== 304) { - callback(''); - return; - } - callback(JSON.parse(xmlHttp.response)); + // Adapted from handlebars.js + // https://github.com/wycats/handlebars.js/ + var badChars = /[&<>"'`]/g; + var possible = /[&<>"'`]/; + var escape = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' }; - xmlHttp.open('GET', url + L.Util.getParamString(params), true); - xmlHttp.setRequestHeader('Accept', 'application/json'); - xmlHttp.send(null); -} -function template(str, data) { - return str.replace(/\{ *([\w_]+) *\}/g, function(str, key) { - var value = data[key]; - if (value === undefined) { - value = ''; - } else if (typeof value === 'function') { - value = value(data); + function escapeChar(chr) { + return escape[chr]; + } + + function htmlEscape(string) { + if (string == null) { + return ''; + } else if (!string) { + return string + ''; } - return htmlEscape(value); - }); -} -var Nominatim = { - class: L.Class.extend({ - options: { - serviceUrl: 'https://nominatim.openstreetmap.org/', - geocodingQueryParams: {}, - reverseQueryParams: {}, - htmlTemplate: function(r) { - var a = r.address, - parts = []; - if (a.road || a.building) { - parts.push('{building} {road} {house_number}'); - } + // Force a string conversion as this will be done by the append regardless and + // the regex test will do this transparently behind the scenes, causing issues if + // an object's to string has escaped characters in it. + string = '' + string; - if (a.city || a.town || a.village || a.hamlet) { - parts.push( - '{postcode} {city} {town} {village} {hamlet}' - ); - } + if (!possible.test(string)) { + return string; + } + return string.replace(badChars, escapeChar); + } - if (a.state || a.country) { - parts.push( - '{state} {country}' - ); - } + function jsonp(url, params, callback, context, jsonpParam) { + var callbackId = '_l_geocoder_' + lastCallbackId++; + params[jsonpParam || 'callback'] = callbackId; + window[callbackId] = L.Util.bind(callback, context); + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = url + getParamString(params); + script.id = callbackId; + document.getElementsByTagName('head')[0].appendChild(script); + } - return template(parts.join('
'), a, true); + function getJSON(url, params, callback) { + var xmlHttp = new XMLHttpRequest(); + xmlHttp.onreadystatechange = function() { + if (xmlHttp.readyState !== 4) { + return; } + var message; + if (xmlHttp.status !== 200 && xmlHttp.status !== 304) { + message = ''; + } else if (typeof xmlHttp.response === 'string') { + // IE doesn't parse JSON responses even with responseType: 'json'. + try { + message = JSON.parse(xmlHttp.response); + } catch (e) { + // Not a JSON response + message = xmlHttp.response; + } + } else { + message = xmlHttp.response; + } + callback(message); + }; + xmlHttp.open('GET', url + getParamString(params), true); + xmlHttp.responseType = 'json'; + xmlHttp.setRequestHeader('Accept', 'application/json'); + xmlHttp.send(null); + } + + function template(str, data) { + return str.replace(/\{ *([\w_]+) *\}/g, function(str, key) { + var value = data[key]; + if (value === undefined) { + value = ''; + } else if (typeof value === 'function') { + value = value(data); + } + return htmlEscape(value); + }); + } + + function getParamString(obj, existingUrl, uppercase) { + var params = []; + for (var i in obj) { + var key = encodeURIComponent(uppercase ? i.toUpperCase() : i); + var value = obj[i]; + if (!L.Util.isArray(value)) { + params.push(key + '=' + encodeURIComponent(value)); + } else { + for (var j = 0; j < value.length; j++) { + params.push(key + '=' + encodeURIComponent(value[j])); + } + } + } + return (!existingUrl || existingUrl.indexOf('?') === -1 ? '?' : '&') + params.join('&'); + } + + var ArcGis = L.Class.extend({ + options: { + service_url: 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer' }, - initialize: function(options) { - L.Util.setOptions(this, options); + initialize: function(accessToken, options) { + L.setOptions(this, options); + this._accessToken = accessToken; }, geocode: function(query, cb, context) { + var params = { + SingleLine: query, + outFields: 'Addr_Type', + forStorage: false, + maxLocations: 10, + f: 'json' + }; + + if (this._key && this._key.length) { + params.token = this._key; + } + getJSON( - this.options.serviceUrl + 'search', - L.extend( - { - q: query, - limit: 5, - format: 'json', - addressdetails: 1 - }, - this.options.geocodingQueryParams - ), - L.bind(function(data) { - var results = []; - for (var i = data.length - 1; i >= 0; i--) { - var bbox = data[i].boundingbox; - for (var j = 0; j < 4; j++) bbox[j] = parseFloat(bbox[j]); - results[i] = { - icon: data[i].icon, - name: data[i].display_name, - html: this.options.htmlTemplate ? this.options.htmlTemplate(data[i]) : undefined, - bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]), - center: L.latLng(data[i].lat, data[i].lon), - properties: data[i] - }; + this.options.service_url + '/findAddressCandidates', + L.extend(params, this.options.geocodingQueryParams), + function(data) { + var results = [], + loc, + latLng, + latLngBounds; + + if (data.candidates && data.candidates.length) { + for (var i = 0; i <= data.candidates.length - 1; i++) { + loc = data.candidates[i]; + latLng = L.latLng(loc.location.y, loc.location.x); + latLngBounds = L.latLngBounds( + L.latLng(loc.extent.ymax, loc.extent.xmax), + L.latLng(loc.extent.ymin, loc.extent.xmin) + ); + results[i] = { + name: loc.address, + bbox: latLngBounds, + center: latLng + }; + } } + cb.call(context, results); - }, this) + } ); }, + suggest: function(query, cb, context) { + return this.geocode(query, cb, context); + }, + reverse: function(location, scale, cb, context) { - getJSON( - this.options.serviceUrl + 'reverse', - L.extend( - { - lat: location.lat, - lon: location.lng, - zoom: Math.round(Math.log(scale / 256) / Math.log(2)), - addressdetails: 1, - format: 'json' - }, - this.options.reverseQueryParams - ), - L.bind(function(data) { - var result = [], - loc; + var params = { + location: encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat), + distance: 100, + f: 'json' + }; - if (data && data.lat && data.lon) { - loc = L.latLng(data.lat, data.lon); - result.push({ - name: data.display_name, - html: this.options.htmlTemplate ? this.options.htmlTemplate(data) : undefined, - center: loc, - bounds: L.latLngBounds(loc, loc), - properties: data - }); - } + getJSON(this.options.service_url + '/reverseGeocode', params, function(data) { + var result = [], + loc; - cb.call(context, result); - }, this) - ); + if (data && !data.error) { + loc = L.latLng(data.location.y, data.location.x); + result.push({ + name: data.address.Match_addr, + center: loc, + bounds: L.latLngBounds(loc, loc) + }); + } + + cb.call(context, result); + }); } - }), + }); - factory: function(options) { - return new L.Control.Geocoder.Nominatim(options); + function arcgis(accessToken, options) { + return new ArcGis(accessToken, options); } -}; -var Control = { - class: L.Control.extend({ - options: { - showResultIcons: false, - collapsed: true, - expand: 'touch', // options: touch, click, anythingelse - position: 'topright', - placeholder: 'Search...', - errorMessage: 'Nothing found.', - suggestMinLength: 3, - suggestTimeout: 250, - defaultMarkGeocode: true - }, - - includes: L.Evented.prototype || L.Mixin.Events, - - initialize: function(options) { - L.Util.setOptions(this, options); - if (!this.options.geocoder) { - this.options.geocoder = new Nominatim.class(); - } - - this._requestCount = 0; - }, - - onAdd: function(map) { - var className = 'leaflet-control-geocoder', - container = L.DomUtil.create('div', className + ' leaflet-bar'), - icon = L.DomUtil.create('button', className + '-icon', container), - form = (this._form = L.DomUtil.create('div', className + '-form', container)), - input; - - this._map = map; - this._container = container; - - icon.innerHTML = ' '; - icon.type = 'button'; - - input = this._input = L.DomUtil.create('input', '', form); - input.type = 'text'; - input.placeholder = this.options.placeholder; - - this._errorElement = L.DomUtil.create('div', className + '-form-no-error', container); - this._errorElement.innerHTML = this.options.errorMessage; - - this._alts = L.DomUtil.create( - 'ul', - className + '-alternatives leaflet-control-geocoder-alternatives-minimized', - container - ); - L.DomEvent.disableClickPropagation(this._alts); - - L.DomEvent.addListener(input, 'keydown', this._keydown, this); - if (this.options.geocoder.suggest) { - L.DomEvent.addListener(input, 'input', this._change, this); - } - L.DomEvent.addListener( - input, - 'blur', - function() { - if (this.options.collapsed && !this._preventBlurCollapse) { - this._collapse(); - } - this._preventBlurCollapse = false; - }, - this - ); - - if (this.options.collapsed) { - if (this.options.expand === 'click') { - L.DomEvent.addListener( - container, - 'click', - function(e) { - if (e.button === 0 && e.detail !== 2) { - this._toggle(); - } - }, - this - ); - } else if (L.Browser.touch && this.options.expand === 'touch') { - L.DomEvent.addListener( - container, - 'touchstart mousedown', - function(e) { - this._toggle(); - e.preventDefault(); // mobile: clicking focuses the icon, so UI expands and immediately collapses - e.stopPropagation(); - }, - this - ); - } else { - L.DomEvent.addListener(container, 'mouseover', this._expand, this); - L.DomEvent.addListener(container, 'mouseout', this._collapse, this); - this._map.on('movestart', this._collapse, this); - } - } else { - this._expand(); - if (L.Browser.touch) { - L.DomEvent.addListener( - container, - 'touchstart', - function() { - this._geocode(); - }, - this - ); - } else { - L.DomEvent.addListener( - container, - 'click', - function() { - this._geocode(); - }, - this - ); - } - } - - if (this.options.defaultMarkGeocode) { - this.on('markgeocode', this.markGeocode, this); - } - - this.on( - 'startgeocode', - function() { - L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber'); - }, - this - ); - this.on( - 'finishgeocode', - function() { - L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-throbber'); - }, - this - ); - - L.DomEvent.disableClickPropagation(container); - - return container; - }, - - _geocodeResult: function(results, suggest) { - if (!suggest && results.length === 1) { - this._geocodeResultSelected(results[0]); - } else if (results.length > 0) { - this._alts.innerHTML = ''; - this._results = results; - L.DomUtil.removeClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); - for (var i = 0; i < results.length; i++) { - this._alts.appendChild(this._createAlt(results[i], i)); - } - } else { - L.DomUtil.addClass(this._errorElement, 'leaflet-control-geocoder-error'); - } - }, - - markGeocode: function(result) { - result = result.geocode || result; - - this._map.fitBounds(result.bbox); - - if (this._geocodeMarker) { - this._map.removeLayer(this._geocodeMarker); - } - - this._geocodeMarker = new L.Marker(result.center) - .bindPopup(result.html || result.name) - .addTo(this._map) - .openPopup(); - - return this; - }, - - _geocode: function(suggest) { - var requestCount = ++this._requestCount, - mode = suggest ? 'suggest' : 'geocode', - eventData = { input: this._input.value }; - - this._lastGeocode = this._input.value; - if (!suggest) { - this._clearResults(); - } - - this.fire('start' + mode, eventData); - this.options.geocoder[mode]( - this._input.value, - function(results) { - if (requestCount === this._requestCount) { - eventData.results = results; - this.fire('finish' + mode, eventData); - this._geocodeResult(results, suggest); - } - }, - this - ); - }, - - _geocodeResultSelected: function(result) { - this.fire('markgeocode', { geocode: result }); - }, - - _toggle: function() { - if (L.DomUtil.hasClass(this._container, 'leaflet-control-geocoder-expanded')) { - this._collapse(); - } else { - this._expand(); - } - }, - - _expand: function() { - L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-expanded'); - this._input.select(); - this.fire('expand'); - }, - - _collapse: function() { - L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-expanded'); - L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); - L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error'); - this._input.blur(); // mobile: keyboard shouldn't stay expanded - this.fire('collapse'); - }, - - _clearResults: function() { - L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); - this._selection = null; - L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error'); - }, - - _createAlt: function(result, index) { - var li = L.DomUtil.create('li', ''), - a = L.DomUtil.create('a', '', li), - icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null, - text = result.html ? undefined : document.createTextNode(result.name), - mouseDownHandler = function mouseDownHandler(e) { - // In some browsers, a click will fire on the map if the control is - // collapsed directly after mousedown. To work around this, we - // wait until the click is completed, and _then_ collapse the - // control. Messy, but this is the workaround I could come up with - // for #142. - this._preventBlurCollapse = true; - L.DomEvent.stop(e); - this._geocodeResultSelected(result); - L.DomEvent.on( - li, - 'click', - function() { - if (this.options.collapsed) { - this._collapse(); - } else { - this._clearResults(); - } - }, - this - ); - }; - - if (icon) { - icon.src = result.icon; - } - - li.setAttribute('data-result-index', index); - - if (result.html) { - a.innerHTML = a.innerHTML + result.html; - } else { - a.appendChild(text); - } - - // Use mousedown and not click, since click will fire _after_ blur, - // causing the control to have collapsed and removed the items - // before the click can fire. - L.DomEvent.addListener(li, 'mousedown touchstart', mouseDownHandler, this); - - return li; - }, - - _keydown: function(e) { - var _this = this, - select = function select(dir) { - if (_this._selection) { - L.DomUtil.removeClass(_this._selection, 'leaflet-control-geocoder-selected'); - _this._selection = _this._selection[dir > 0 ? 'nextSibling' : 'previousSibling']; - } - if (!_this._selection) { - _this._selection = _this._alts[dir > 0 ? 'firstChild' : 'lastChild']; - } - - if (_this._selection) { - L.DomUtil.addClass(_this._selection, 'leaflet-control-geocoder-selected'); - } - }; - - switch (e.keyCode) { - // Escape - case 27: - if (this.options.collapsed) { - this._collapse(); - } - break; - // Up - case 38: - select(-1); - break; - // Up - case 40: - select(1); - break; - // Enter - case 13: - if (this._selection) { - var index = parseInt(this._selection.getAttribute('data-result-index'), 10); - this._geocodeResultSelected(this._results[index]); - this._clearResults(); - } else { - this._geocode(); - } - break; - } - }, - _change: function() { - var v = this._input.value; - if (v !== this._lastGeocode) { - clearTimeout(this._suggestTimeout); - if (v.length >= this.options.suggestMinLength) { - this._suggestTimeout = setTimeout( - L.bind(function() { - this._geocode(true); - }, this), - this.options.suggestTimeout - ); - } else { - this._clearResults(); - } - } - } - }), - factory: function(options) { - return new L.Control.Geocoder(options); - } -}; - -var Bing = { - class: L.Class.extend({ + var Bing = L.Class.extend({ initialize: function(key) { this.key = key; }, @@ -589,280 +259,13 @@ var Bing = { 'jsonp' ); } - }), + }); - factory: function(key) { - return new L.Control.Geocoder.Bing(key); + function bing(key) { + return new Bing(key); } -}; -var MapQuest = { - class: L.Class.extend({ - options: { - serviceUrl: 'https://www.mapquestapi.com/geocoding/v1' - }, - - initialize: function(key, options) { - // MapQuest seems to provide URI encoded API keys, - // so to avoid encoding them twice, we decode them here - this._key = decodeURIComponent(key); - - L.Util.setOptions(this, options); - }, - - _formatName: function() { - var r = [], - i; - for (i = 0; i < arguments.length; i++) { - if (arguments[i]) { - r.push(arguments[i]); - } - } - - return r.join(', '); - }, - - geocode: function(query, cb, context) { - getJSON( - this.options.serviceUrl + '/address', - { - key: this._key, - location: query, - limit: 5, - outFormat: 'json' - }, - L.bind(function(data) { - var results = [], - loc, - latLng; - if (data.results && data.results[0].locations) { - for (var i = data.results[0].locations.length - 1; i >= 0; i--) { - loc = data.results[0].locations[i]; - latLng = L.latLng(loc.latLng); - results[i] = { - name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1), - bbox: L.latLngBounds(latLng, latLng), - center: latLng - }; - } - } - - cb.call(context, results); - }, this) - ); - }, - - reverse: function(location, scale, cb, context) { - getJSON( - this.options.serviceUrl + '/reverse', - { - key: this._key, - location: location.lat + ',' + location.lng, - outputFormat: 'json' - }, - L.bind(function(data) { - var results = [], - loc, - latLng; - if (data.results && data.results[0].locations) { - for (var i = data.results[0].locations.length - 1; i >= 0; i--) { - loc = data.results[0].locations[i]; - latLng = L.latLng(loc.latLng); - results[i] = { - name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1), - bbox: L.latLngBounds(latLng, latLng), - center: latLng - }; - } - } - - cb.call(context, results); - }, this) - ); - } - }), - - factory: function(key, options) { - return new L.Control.Geocoder.MapQuest(key, options); - } -}; - -var Mapbox = { - class: L.Class.extend({ - options: { - serviceUrl: 'https://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/', - geocodingQueryParams: {}, - reverseQueryParams: {} - }, - - initialize: function(accessToken, options) { - L.setOptions(this, options); - this.options.geocodingQueryParams.access_token = accessToken; - this.options.reverseQueryParams.access_token = accessToken; - }, - - geocode: function(query, cb, context) { - var params = this.options.geocodingQueryParams; - if ( - typeof params.proximity !== 'undefined' && - params.proximity.hasOwnProperty('lat') && - params.proximity.hasOwnProperty('lng') - ) { - params.proximity = params.proximity.lng + ',' + params.proximity.lat; - } - getJSON(this.options.serviceUrl + encodeURIComponent(query) + '.json', params, function( - data - ) { - var results = [], - loc, - latLng, - latLngBounds; - if (data.features && data.features.length) { - for (var i = 0; i <= data.features.length - 1; i++) { - loc = data.features[i]; - latLng = L.latLng(loc.center.reverse()); - if (loc.hasOwnProperty('bbox')) { - latLngBounds = L.latLngBounds( - L.latLng(loc.bbox.slice(0, 2).reverse()), - L.latLng(loc.bbox.slice(2, 4).reverse()) - ); - } else { - latLngBounds = L.latLngBounds(latLng, latLng); - } - results[i] = { - name: loc.place_name, - bbox: latLngBounds, - center: latLng - }; - } - } - - cb.call(context, results); - }); - }, - - suggest: function(query, cb, context) { - return this.geocode(query, cb, context); - }, - - reverse: function(location, scale, cb, context) { - getJSON( - this.options.serviceUrl + - encodeURIComponent(location.lng) + - ',' + - encodeURIComponent(location.lat) + - '.json', - this.options.reverseQueryParams, - function(data) { - var results = [], - loc, - latLng, - latLngBounds; - if (data.features && data.features.length) { - for (var i = 0; i <= data.features.length - 1; i++) { - loc = data.features[i]; - latLng = L.latLng(loc.center.reverse()); - if (loc.hasOwnProperty('bbox')) { - latLngBounds = L.latLngBounds( - L.latLng(loc.bbox.slice(0, 2).reverse()), - L.latLng(loc.bbox.slice(2, 4).reverse()) - ); - } else { - latLngBounds = L.latLngBounds(latLng, latLng); - } - results[i] = { - name: loc.place_name, - bbox: latLngBounds, - center: latLng - }; - } - } - - cb.call(context, results); - } - ); - } - }), - - factory: function(accessToken, options) { - return new L.Control.Geocoder.Mapbox(accessToken, options); - } -}; - -var What3Words = { - class: L.Class.extend({ - options: { - serviceUrl: 'https://api.what3words.com/v2/' - }, - - initialize: function(accessToken) { - this._accessToken = accessToken; - }, - - geocode: function(query, cb, context) { - //get three words and make a dot based string - getJSON( - this.options.serviceUrl + 'forward', - { - key: this._accessToken, - addr: query.split(/\s+/).join('.') - }, - function(data) { - var results = [], - latLng, - latLngBounds; - if (data.hasOwnProperty('geometry')) { - latLng = L.latLng(data.geometry['lat'], data.geometry['lng']); - latLngBounds = L.latLngBounds(latLng, latLng); - results[0] = { - name: data.words, - bbox: latLngBounds, - center: latLng - }; - } - - cb.call(context, results); - } - ); - }, - - suggest: function(query, cb, context) { - return this.geocode(query, cb, context); - }, - - reverse: function(location, scale, cb, context) { - getJSON( - this.options.serviceUrl + 'reverse', - { - key: this._accessToken, - coords: [location.lat, location.lng].join(',') - }, - function(data) { - var results = [], - latLng, - latLngBounds; - if (data.status.status == 200) { - latLng = L.latLng(data.geometry['lat'], data.geometry['lng']); - latLngBounds = L.latLngBounds(latLng, latLng); - results[0] = { - name: data.words, - bbox: latLngBounds, - center: latLng - }; - } - cb.call(context, results); - } - ); - } - }), - - factory: function(accessToken) { - return new L.Control.Geocoder.What3Words(accessToken); - } -}; - -var Google = { - class: L.Class.extend({ + var Google = L.Class.extend({ options: { serviceUrl: 'https://maps.googleapis.com/maps/api/geocode/json', geocodingQueryParams: {}, @@ -947,118 +350,709 @@ var Google = { cb.call(context, results); }); } - }), + }); - factory: function(key, options) { - return new L.Control.Geocoder.Google(key, options); + function google(key, options) { + return new Google(key, options); } -}; -var Photon = { - class: L.Class.extend({ + var HERE = L.Class.extend({ options: { - serviceUrl: 'https://photon.komoot.de/api/', - reverseUrl: 'https://photon.komoot.de/reverse/', - nameProperties: ['name', 'street', 'suburb', 'hamlet', 'town', 'city', 'state', 'country'] + geocodeUrl: 'https://geocoder.api.here.com/6.2/geocode.json', + reverseGeocodeUrl: 'https://reverse.geocoder.api.here.com/6.2/reversegeocode.json', + app_id: '', + app_code: '', + geocodingQueryParams: {}, + reverseQueryParams: {}, + reverseGeocodeProxRadius: null }, - initialize: function(options) { L.setOptions(this, options); }, + geocode: function(query, cb, context) { + var params = { + searchtext: query, + gen: 9, + app_id: this.options.app_id, + app_code: this.options.app_code, + jsonattributes: 1 + }; + params = L.Util.extend(params, this.options.geocodingQueryParams); + this.getJSON(this.options.geocodeUrl, params, cb, context); + }, + reverse: function(location, scale, cb, context) { + var _proxRadius = this.options.reverseGeocodeProxRadius + ? this.options.reverseGeocodeProxRadius + : null; + var proxRadius = _proxRadius ? ',' + encodeURIComponent(_proxRadius) : ''; + var params = { + prox: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng) + proxRadius, + mode: 'retrieveAddresses', + app_id: this.options.app_id, + app_code: this.options.app_code, + gen: 9, + jsonattributes: 1 + }; + params = L.Util.extend(params, this.options.reverseQueryParams); + this.getJSON(this.options.reverseGeocodeUrl, params, cb, context); + }, + getJSON: function(url, params, cb, context) { + getJSON(url, params, function(data) { + var results = [], + loc, + latLng, + latLngBounds; + if (data.response.view && data.response.view.length) { + for (var i = 0; i <= data.response.view[0].result.length - 1; i++) { + loc = data.response.view[0].result[i].location; + latLng = L.latLng(loc.displayPosition.latitude, loc.displayPosition.longitude); + latLngBounds = L.latLngBounds( + L.latLng(loc.mapView.topLeft.latitude, loc.mapView.topLeft.longitude), + L.latLng(loc.mapView.bottomRight.latitude, loc.mapView.bottomRight.longitude) + ); + results[i] = { + name: loc.address.label, + properties: loc.address, + bbox: latLngBounds, + center: latLng + }; + } + } + cb.call(context, results); + }); + } + }); + function here(options) { + return new HERE(options); + } + + var LatLng = L.Class.extend({ + options: { + // the next geocoder to use + next: undefined, + sizeInMeters: 10000 + }, + + initialize: function(options) { + L.Util.setOptions(this, options); + }, geocode: function(query, cb, context) { - var params = L.extend( - { - q: query - }, - this.options.geocodingQueryParams - ); + var match; + var center; + // regex from https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/geocoder_controller.rb + if ((match = query.match(/^([NS])\s*(\d{1,3}(?:\.\d*)?)\W*([EW])\s*(\d{1,3}(?:\.\d*)?)$/))) { + // [NSEW] decimal degrees + center = L.latLng( + (/N/i.test(match[1]) ? 1 : -1) * parseFloat(match[2]), + (/E/i.test(match[3]) ? 1 : -1) * parseFloat(match[4]) + ); + } else if ( + (match = query.match(/^(\d{1,3}(?:\.\d*)?)\s*([NS])\W*(\d{1,3}(?:\.\d*)?)\s*([EW])$/)) + ) { + // decimal degrees [NSEW] + center = L.latLng( + (/N/i.test(match[2]) ? 1 : -1) * parseFloat(match[1]), + (/E/i.test(match[4]) ? 1 : -1) * parseFloat(match[3]) + ); + } else if ( + (match = query.match( + /^([NS])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?$/ + )) + ) { + // [NSEW] degrees, decimal minutes + center = L.latLng( + (/N/i.test(match[1]) ? 1 : -1) * (parseFloat(match[2]) + parseFloat(match[3] / 60)), + (/E/i.test(match[4]) ? 1 : -1) * (parseFloat(match[5]) + parseFloat(match[6] / 60)) + ); + } else if ( + (match = query.match( + /^(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([NS])\W*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([EW])$/ + )) + ) { + // degrees, decimal minutes [NSEW] + center = L.latLng( + (/N/i.test(match[3]) ? 1 : -1) * (parseFloat(match[1]) + parseFloat(match[2] / 60)), + (/E/i.test(match[6]) ? 1 : -1) * (parseFloat(match[4]) + parseFloat(match[5] / 60)) + ); + } else if ( + (match = query.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*)?)?["″]?$/ + )) + ) { + // [NSEW] degrees, minutes, decimal seconds + center = L.latLng( + (/N/i.test(match[1]) ? 1 : -1) * + (parseFloat(match[2]) + parseFloat(match[3] / 60 + parseFloat(match[4] / 3600))), + (/E/i.test(match[5]) ? 1 : -1) * + (parseFloat(match[6]) + parseFloat(match[7] / 60) + parseFloat(match[8] / 3600)) + ); + } else if ( + (match = query.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])$/ + )) + ) { + // degrees, minutes, decimal seconds [NSEW] + center = L.latLng( + (/N/i.test(match[4]) ? 1 : -1) * + (parseFloat(match[1]) + parseFloat(match[2] / 60 + parseFloat(match[3] / 3600))), + (/E/i.test(match[8]) ? 1 : -1) * + (parseFloat(match[5]) + parseFloat(match[6] / 60) + parseFloat(match[7] / 3600)) + ); + } else if ( + (match = query.match(/^\s*([+-]?\d+(?:\.\d*)?)\s*[\s,]\s*([+-]?\d+(?:\.\d*)?)\s*$/)) + ) { + center = L.latLng(parseFloat(match[1]), parseFloat(match[2])); + } + if (center) { + var results = [ + { + name: query, + center: center, + bbox: center.toBounds(this.options.sizeInMeters) + } + ]; + cb.call(context, results); + } else if (this.options.next) { + this.options.next.geocode(query, cb, context); + } + } + }); + function latLng(options) { + return new LatLng(options); + } + + var Mapbox = L.Class.extend({ + options: { + serviceUrl: 'https://api.mapbox.com/geocoding/v5/mapbox.places/', + geocodingQueryParams: {}, + reverseQueryParams: {} + }, + + initialize: function(accessToken, options) { + L.setOptions(this, options); + this.options.geocodingQueryParams.access_token = accessToken; + this.options.reverseQueryParams.access_token = accessToken; + }, + + geocode: function(query, cb, context) { + var params = this.options.geocodingQueryParams; + if ( + params.proximity !== undefined && + params.proximity.lat !== undefined && + params.proximity.lng !== undefined + ) { + params.proximity = params.proximity.lng + ',' + params.proximity.lat; + } + getJSON(this.options.serviceUrl + encodeURIComponent(query) + '.json', params, function(data) { + var results = [], + loc, + latLng, + latLngBounds; + if (data.features && data.features.length) { + for (var i = 0; i <= data.features.length - 1; i++) { + loc = data.features[i]; + latLng = L.latLng(loc.center.reverse()); + if (loc.bbox) { + latLngBounds = L.latLngBounds( + L.latLng(loc.bbox.slice(0, 2).reverse()), + L.latLng(loc.bbox.slice(2, 4).reverse()) + ); + } else { + latLngBounds = L.latLngBounds(latLng, latLng); + } + + var properties = { + text: loc.text, + address: loc.address + }; + + for (var j = 0; j < (loc.context || []).length; j++) { + var id = loc.context[j].id.split('.')[0]; + properties[id] = loc.context[j].text; + + // Get country code when available + if (loc.context[j].short_code) { + properties['countryShortCode'] = loc.context[j].short_code; + } + } + + results[i] = { + name: loc.place_name, + bbox: latLngBounds, + center: latLng, + properties: properties + }; + } + } + + cb.call(context, results); + }); + }, + + suggest: function(query, cb, context) { + return this.geocode(query, cb, context); + }, + + reverse: function(location, scale, cb, context) { getJSON( - this.options.serviceUrl, - params, + this.options.serviceUrl + + encodeURIComponent(location.lng) + + ',' + + encodeURIComponent(location.lat) + + '.json', + this.options.reverseQueryParams, + function(data) { + var results = [], + loc, + latLng, + latLngBounds; + if (data.features && data.features.length) { + for (var i = 0; i <= data.features.length - 1; i++) { + loc = data.features[i]; + latLng = L.latLng(loc.center.reverse()); + if (loc.bbox) { + latLngBounds = L.latLngBounds( + L.latLng(loc.bbox.slice(0, 2).reverse()), + L.latLng(loc.bbox.slice(2, 4).reverse()) + ); + } else { + latLngBounds = L.latLngBounds(latLng, latLng); + } + results[i] = { + name: loc.place_name, + bbox: latLngBounds, + center: latLng + }; + } + } + + cb.call(context, results); + } + ); + } + }); + + function mapbox(accessToken, options) { + return new Mapbox(accessToken, options); + } + + var MapQuest = L.Class.extend({ + options: { + serviceUrl: 'https://www.mapquestapi.com/geocoding/v1' + }, + + initialize: function(key, options) { + // MapQuest seems to provide URI encoded API keys, + // so to avoid encoding them twice, we decode them here + this._key = decodeURIComponent(key); + + L.Util.setOptions(this, options); + }, + + _formatName: function() { + var r = [], + i; + for (i = 0; i < arguments.length; i++) { + if (arguments[i]) { + r.push(arguments[i]); + } + } + + return r.join(', '); + }, + + geocode: function(query, cb, context) { + getJSON( + this.options.serviceUrl + '/address', + { + key: this._key, + location: query, + limit: 5, + outFormat: 'json' + }, L.bind(function(data) { - cb.call(context, this._decodeFeatures(data)); + var results = [], + loc, + latLng; + if (data.results && data.results[0].locations) { + for (var i = data.results[0].locations.length - 1; i >= 0; i--) { + loc = data.results[0].locations[i]; + latLng = L.latLng(loc.latLng); + results[i] = { + name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1), + bbox: L.latLngBounds(latLng, latLng), + center: latLng + }; + } + } + + cb.call(context, results); }, this) ); }, + reverse: function(location, scale, cb, context) { + getJSON( + this.options.serviceUrl + '/reverse', + { + key: this._key, + location: location.lat + ',' + location.lng, + outputFormat: 'json' + }, + L.bind(function(data) { + var results = [], + loc, + latLng; + if (data.results && data.results[0].locations) { + for (var i = data.results[0].locations.length - 1; i >= 0; i--) { + loc = data.results[0].locations[i]; + latLng = L.latLng(loc.latLng); + results[i] = { + name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1), + bbox: L.latLngBounds(latLng, latLng), + center: latLng + }; + } + } + + cb.call(context, results); + }, this) + ); + } + }); + + function mapQuest(key, options) { + return new MapQuest(key, options); + } + + var Neutrino = L.Class.extend({ + options: { + userId: '', + apiKey: '', + serviceUrl: 'https://neutrinoapi.com/' + }, + + initialize: function(options) { + L.Util.setOptions(this, options); + }, + + // https://www.neutrinoapi.com/api/geocode-address/ + geocode: function(query, cb, context) { + getJSON( + this.options.serviceUrl + 'geocode-address', + { + apiKey: this.options.apiKey, + userId: this.options.userId, + //get three words and make a dot based string + address: query.split(/\s+/).join('.') + }, + function(data) { + var results = [], + latLng, + latLngBounds; + if (data.locations) { + data.geometry = data.locations[0]; + latLng = L.latLng(data.geometry['latitude'], data.geometry['longitude']); + latLngBounds = L.latLngBounds(latLng, latLng); + results[0] = { + name: data.geometry.address, + bbox: latLngBounds, + center: latLng + }; + } + + cb.call(context, results); + } + ); + }, + suggest: function(query, cb, context) { return this.geocode(query, cb, context); }, - reverse: function(latLng, scale, cb, context) { - var params = L.extend( - { - lat: latLng.lat, - lon: latLng.lng - }, - this.options.reverseQueryParams - ); - + // https://www.neutrinoapi.com/api/geocode-reverse/ + reverse: function(location, scale, cb, context) { getJSON( - this.options.reverseUrl, - params, + this.options.serviceUrl + 'geocode-reverse', + { + apiKey: this.options.apiKey, + userId: this.options.userId, + latitude: location.lat, + longitude: location.lng + }, + function(data) { + var results = [], + latLng, + latLngBounds; + if (data.status.status == 200 && data.found) { + latLng = L.latLng(location.lat, location.lng); + latLngBounds = L.latLngBounds(latLng, latLng); + results[0] = { + name: data.address, + bbox: latLngBounds, + center: latLng + }; + } + cb.call(context, results); + } + ); + } + }); + + function neutrino(accessToken) { + return new Neutrino(accessToken); + } + + var Nominatim = L.Class.extend({ + options: { + serviceUrl: 'https://nominatim.openstreetmap.org/', + geocodingQueryParams: {}, + reverseQueryParams: {}, + htmlTemplate: function(r) { + var a = r.address, + className, + parts = []; + if (a.road || a.building) { + parts.push('{building} {road} {house_number}'); + } + + if (a.city || a.town || a.village || a.hamlet) { + className = parts.length > 0 ? 'leaflet-control-geocoder-address-detail' : ''; + parts.push( + '{postcode} {city} {town} {village} {hamlet}' + ); + } + + if (a.state || a.country) { + className = parts.length > 0 ? 'leaflet-control-geocoder-address-context' : ''; + parts.push('{state} {country}'); + } + + return template(parts.join('
'), a, true); + } + }, + + initialize: function(options) { + L.Util.setOptions(this, options); + }, + + geocode: function(query, cb, context) { + getJSON( + this.options.serviceUrl + 'search', + L.extend( + { + q: query, + limit: 5, + format: 'json', + addressdetails: 1 + }, + this.options.geocodingQueryParams + ), L.bind(function(data) { - cb.call(context, this._decodeFeatures(data)); + var results = []; + for (var i = data.length - 1; i >= 0; i--) { + var bbox = data[i].boundingbox; + for (var j = 0; j < 4; j++) bbox[j] = parseFloat(bbox[j]); + results[i] = { + icon: data[i].icon, + name: data[i].display_name, + html: this.options.htmlTemplate ? this.options.htmlTemplate(data[i]) : undefined, + bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]), + center: L.latLng(data[i].lat, data[i].lon), + properties: data[i] + }; + } + cb.call(context, results); }, this) ); }, - _decodeFeatures: function(data) { - var results = [], - i, - f, - c, - latLng, - extent, - bbox; + reverse: function(location, scale, cb, context) { + getJSON( + this.options.serviceUrl + 'reverse', + L.extend( + { + lat: location.lat, + lon: location.lng, + zoom: Math.round(Math.log(scale / 256) / Math.log(2)), + addressdetails: 1, + format: 'json' + }, + this.options.reverseQueryParams + ), + L.bind(function(data) { + var result = [], + loc; - if (data && data.features) { - for (i = 0; i < data.features.length; i++) { - f = data.features[i]; - c = f.geometry.coordinates; - latLng = L.latLng(c[1], c[0]); - extent = f.properties.extent; - - if (extent) { - bbox = L.latLngBounds([extent[1], extent[0]], [extent[3], extent[2]]); - } else { - bbox = L.latLngBounds(latLng, latLng); + if (data && data.lat && data.lon) { + loc = L.latLng(data.lat, data.lon); + result.push({ + name: data.display_name, + html: this.options.htmlTemplate ? this.options.htmlTemplate(data) : undefined, + center: loc, + bounds: L.latLngBounds(loc, loc), + properties: data + }); } - results.push({ - name: this._deocodeFeatureName(f), - html: this.options.htmlTemplate ? this.options.htmlTemplate(f) : undefined, - center: latLng, - bbox: bbox, - properties: f.properties - }); - } - } + cb.call(context, result); + }, this) + ); + } + }); - return results; + function nominatim(options) { + return new Nominatim(options); + } + + var OpenLocationCode = L.Class.extend({ + options: { + OpenLocationCode: undefined, + codeLength: undefined }, - _deocodeFeatureName: function(f) { - var j, name; - for (j = 0; !name && j < this.options.nameProperties.length; j++) { - name = f.properties[this.options.nameProperties[j]]; + initialize: function(options) { + L.setOptions(this, options); + }, + + geocode: function(query, cb, context) { + try { + var decoded = this.options.OpenLocationCode.decode(query); + var result = { + name: query, + center: L.latLng(decoded.latitudeCenter, decoded.longitudeCenter), + bbox: L.latLngBounds( + L.latLng(decoded.latitudeLo, decoded.longitudeLo), + L.latLng(decoded.latitudeHi, decoded.longitudeHi) + ) + }; + cb.call(context, [result]); + } catch (e) { + console.warn(e); // eslint-disable-line no-console + cb.call(context, []); + } + }, + reverse: function(location, scale, cb, context) { + try { + var code = this.options.OpenLocationCode.encode( + location.lat, + location.lng, + this.options.codeLength + ); + var result = { + name: code, + center: L.latLng(location.lat, location.lng), + bbox: L.latLngBounds( + L.latLng(location.lat, location.lng), + L.latLng(location.lat, location.lng) + ) + }; + cb.call(context, [result]); + } catch (e) { + console.warn(e); // eslint-disable-line no-console + cb.call(context, []); } - - return name; } - }), + }); - factory: function(options) { - return new L.Control.Geocoder.Photon(options); + function openLocationCode(options) { + return new OpenLocationCode(options); } -}; -var Mapzen = { - class: L.Class.extend({ + var OpenCage = L.Class.extend({ options: { - serviceUrl: 'https://search.mapzen.com/v1', + serviceUrl: 'https://api.opencagedata.com/geocode/v1/json', + geocodingQueryParams: {}, + reverseQueryParams: {} + }, + + initialize: function(apiKey, options) { + L.setOptions(this, options); + this._accessToken = apiKey; + }, + + geocode: function(query, cb, context) { + var params = { + key: this._accessToken, + q: query + }; + params = L.extend(params, this.options.geocodingQueryParams); + getJSON(this.options.serviceUrl, params, function(data) { + var results = [], + latLng, + latLngBounds, + loc; + if (data.results && data.results.length) { + for (var i = 0; i < data.results.length; i++) { + loc = data.results[i]; + latLng = L.latLng(loc.geometry); + if (loc.annotations && loc.annotations.bounds) { + latLngBounds = L.latLngBounds( + L.latLng(loc.annotations.bounds.northeast), + L.latLng(loc.annotations.bounds.southwest) + ); + } else { + latLngBounds = L.latLngBounds(latLng, latLng); + } + results.push({ + name: loc.formatted, + bbox: latLngBounds, + center: latLng + }); + } + } + cb.call(context, results); + }); + }, + + suggest: function(query, cb, context) { + return this.geocode(query, cb, context); + }, + + reverse: function(location, scale, cb, context) { + var params = { + key: this._accessToken, + q: [location.lat, location.lng].join(',') + }; + params = L.extend(params, this.options.reverseQueryParams); + getJSON(this.options.serviceUrl, params, function(data) { + var results = [], + latLng, + latLngBounds, + loc; + if (data.results && data.results.length) { + for (var i = 0; i < data.results.length; i++) { + loc = data.results[i]; + latLng = L.latLng(loc.geometry); + if (loc.annotations && loc.annotations.bounds) { + latLngBounds = L.latLngBounds( + L.latLng(loc.annotations.bounds.northeast), + L.latLng(loc.annotations.bounds.southwest) + ); + } else { + latLngBounds = L.latLngBounds(latLng, latLng); + } + results.push({ + name: loc.formatted, + bbox: latLngBounds, + center: latLng + }); + } + } + cb.call(context, results); + }); + } + }); + + function opencage(apiKey, options) { + return new OpenCage(apiKey, options); + } + + var Pelias = L.Class.extend({ + options: { + serviceUrl: 'https://api.geocode.earth/v1', geocodingQueryParams: {}, reverseQueryParams: {} }, @@ -1138,6 +1132,12 @@ var Mapzen = { if (layer.getBounds) { bbox = layer.getBounds(); center = bbox.getCenter(); + } else if (layer.feature.bbox) { + center = layer.getLatLng(); + bbox = L.latLngBounds( + L.GeoJSON.coordsToLatLng(layer.feature.bbox.slice(0, 2)), + L.GeoJSON.coordsToLatLng(layer.feature.bbox.slice(2, 4)) + ); } else { center = layer.getLatLng(); bbox = L.latLngBounds(center, center); @@ -1152,106 +1152,31 @@ var Mapzen = { }); return results; } - }), + }); - factory: function(apiKey, options) { - return new L.Control.Geocoder.Mapzen(apiKey, options); + function pelias(apiKey, options) { + return new Pelias(apiKey, options); } -}; + var GeocodeEarth = Pelias; + var geocodeEarth = pelias; -var ArcGis = { - class: L.Class.extend({ + var Mapzen = Pelias; // r.i.p. + var mapzen = pelias; + + var Openrouteservice = Mapzen.extend({ options: { - service_url: 'http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer' - }, - - initialize: function(accessToken, options) { - L.setOptions(this, options); - this._accessToken = accessToken; - }, - - geocode: function(query, cb, context) { - var params = { - SingleLine: query, - outFields: 'Addr_Type', - forStorage: false, - maxLocations: 10, - f: 'json' - }; - - if (this._key && this._key.length) { - params.token = this._key; - } - - getJSON(this.options.service_url + '/findAddressCandidates', params, function(data) { - var results = [], - loc, - latLng, - latLngBounds; - - if (data.candidates && data.candidates.length) { - for (var i = 0; i <= data.candidates.length - 1; i++) { - loc = data.candidates[i]; - latLng = L.latLng(loc.location.y, loc.location.x); - latLngBounds = L.latLngBounds( - L.latLng(loc.extent.ymax, loc.extent.xmax), - L.latLng(loc.extent.ymin, loc.extent.xmin) - ); - results[i] = { - name: loc.address, - bbox: latLngBounds, - center: latLng - }; - } - } - - cb.call(context, results); - }); - }, - - suggest: function(query, cb, context) { - return this.geocode(query, cb, context); - }, - - reverse: function(location, scale, cb, context) { - var params = { - location: encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat), - distance: 100, - f: 'json' - }; - - getJSON(this.options.service_url + '/reverseGeocode', params, function(data) { - var result = [], - loc; - - if (data && !data.error) { - loc = L.latLng(data.location.y, data.location.x); - result.push({ - name: data.address.Match_addr, - center: loc, - bounds: L.latLngBounds(loc, loc) - }); - } - - cb.call(context, result); - }); + serviceUrl: 'https://api.openrouteservice.org/geocode' } - }), - - factory: function(accessToken, options) { - return new L.Control.Geocoder.ArcGis(accessToken, options); + }); + function openrouteservice(apiKey, options) { + return new Openrouteservice(apiKey, options); } -}; -var HERE = { - class: L.Class.extend({ + var Photon = L.Class.extend({ options: { - geocodeUrl: 'http://geocoder.api.here.com/6.2/geocode.json', - reverseGeocodeUrl: 'http://reverse.geocoder.api.here.com/6.2/reversegeocode.json', - app_id: '', - app_code: '', - geocodingQueryParams: {}, - reverseQueryParams: {} + serviceUrl: 'https://photon.komoot.de/api/', + reverseUrl: 'https://photon.komoot.de/reverse/', + nameProperties: ['name', 'street', 'suburb', 'hamlet', 'town', 'city', 'state', 'country'] }, initialize: function(options) { @@ -1259,90 +1184,581 @@ var HERE = { }, geocode: function(query, cb, context) { - var params = { - searchtext: query, - gen: 9, - app_id: this.options.app_id, - app_code: this.options.app_code, - jsonattributes: 1 - }; - params = L.Util.extend(params, this.options.geocodingQueryParams); - this.getJSON(this.options.geocodeUrl, params, cb, context); + var params = L.extend( + { + q: query + }, + this.options.geocodingQueryParams + ); + + getJSON( + this.options.serviceUrl, + params, + L.bind(function(data) { + cb.call(context, this._decodeFeatures(data)); + }, this) + ); }, - reverse: function(location, scale, cb, context) { - var params = { - prox: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng), - mode: 'retrieveAddresses', - app_id: this.options.app_id, - app_code: this.options.app_code, - gen: 9, - jsonattributes: 1 - }; - params = L.Util.extend(params, this.options.reverseQueryParams); - this.getJSON(this.options.reverseGeocodeUrl, params, cb, context); + suggest: function(query, cb, context) { + return this.geocode(query, cb, context); }, - getJSON: function(url, params, cb, context) { - getJSON(url, params, function(data) { - var results = [], - loc, - latLng, - latLngBounds; - if (data.response.view && data.response.view.length) { - for (var i = 0; i <= data.response.view[0].result.length - 1; i++) { - loc = data.response.view[0].result[i].location; - latLng = L.latLng(loc.displayPosition.latitude, loc.displayPosition.longitude); - latLngBounds = L.latLngBounds( - L.latLng(loc.mapView.topLeft.latitude, loc.mapView.topLeft.longitude), - L.latLng(loc.mapView.bottomRight.latitude, loc.mapView.bottomRight.longitude) - ); - results[i] = { - name: loc.address.label, + reverse: function(latLng, scale, cb, context) { + var params = L.extend( + { + lat: latLng.lat, + lon: latLng.lng + }, + this.options.reverseQueryParams + ); + + getJSON( + this.options.reverseUrl, + params, + L.bind(function(data) { + cb.call(context, this._decodeFeatures(data)); + }, this) + ); + }, + + _decodeFeatures: function(data) { + var results = [], + i, + f, + c, + latLng, + extent, + bbox; + + if (data && data.features) { + for (i = 0; i < data.features.length; i++) { + f = data.features[i]; + c = f.geometry.coordinates; + latLng = L.latLng(c[1], c[0]); + extent = f.properties.extent; + + if (extent) { + bbox = L.latLngBounds([extent[1], extent[0]], [extent[3], extent[2]]); + } else { + bbox = L.latLngBounds(latLng, latLng); + } + + results.push({ + name: this._decodeFeatureName(f), + html: this.options.htmlTemplate ? this.options.htmlTemplate(f) : undefined, + center: latLng, + bbox: bbox, + properties: f.properties + }); + } + } + + return results; + }, + + _decodeFeatureName: function(f) { + return (this.options.nameProperties || []) + .map(function(p) { + return f.properties[p]; + }) + .filter(function(v) { + return !!v; + }) + .join(', '); + } + }); + + function photon(options) { + return new Photon(options); + } + + var What3Words = L.Class.extend({ + options: { + serviceUrl: 'https://api.what3words.com/v2/' + }, + + initialize: function(accessToken) { + this._accessToken = accessToken; + }, + + geocode: function(query, cb, context) { + //get three words and make a dot based string + getJSON( + this.options.serviceUrl + 'forward', + { + key: this._accessToken, + addr: query.split(/\s+/).join('.') + }, + function(data) { + var results = [], + latLng, + latLngBounds; + if (data.geometry) { + latLng = L.latLng(data.geometry['lat'], data.geometry['lng']); + latLngBounds = L.latLngBounds(latLng, latLng); + results[0] = { + name: data.words, bbox: latLngBounds, center: latLng }; } + + cb.call(context, results); } - cb.call(context, results); - }); + ); + }, + + suggest: function(query, cb, context) { + return this.geocode(query, cb, context); + }, + + reverse: function(location, scale, cb, context) { + getJSON( + this.options.serviceUrl + 'reverse', + { + key: this._accessToken, + coords: [location.lat, location.lng].join(',') + }, + function(data) { + var results = [], + latLng, + latLngBounds; + if (data.status.status == 200) { + latLng = L.latLng(data.geometry['lat'], data.geometry['lng']); + latLngBounds = L.latLngBounds(latLng, latLng); + results[0] = { + name: data.words, + bbox: latLngBounds, + center: latLng + }; + } + cb.call(context, results); + } + ); } - }), + }); - factory: function(options) { - return new L.Control.Geocoder.HERE(options); + function what3words(accessToken) { + return new What3Words(accessToken); } -}; -var Geocoder = L.Util.extend(Control.class, { - Nominatim: Nominatim.class, - nominatim: Nominatim.factory, - Bing: Bing.class, - bing: Bing.factory, - MapQuest: MapQuest.class, - mapQuest: MapQuest.factory, - Mapbox: Mapbox.class, - mapbox: Mapbox.factory, - What3Words: What3Words.class, - what3words: What3Words.factory, - Google: Google.class, - google: Google.factory, - Photon: Photon.class, - photon: Photon.factory, - Mapzen: Mapzen.class, - mapzen: Mapzen.factory, - ArcGis: ArcGis.class, - arcgis: ArcGis.factory, - HERE: HERE.class, - here: HERE.factory -}); -L.Util.extend(L.Control, { - Geocoder: Geocoder, - geocoder: Control.factory -}); -return Geocoder; + var geocoders = /*#__PURE__*/Object.freeze({ + ArcGis: ArcGis, + arcgis: arcgis, + Bing: Bing, + bing: bing, + Google: Google, + google: google, + HERE: HERE, + here: here, + LatLng: LatLng, + latLng: latLng, + Mapbox: Mapbox, + mapbox: mapbox, + MapQuest: MapQuest, + mapQuest: mapQuest, + Neutrino: Neutrino, + neutrino: neutrino, + Nominatim: Nominatim, + nominatim: nominatim, + OpenLocationCode: OpenLocationCode, + openLocationCode: openLocationCode, + OpenCage: OpenCage, + opencage: opencage, + Pelias: Pelias, + pelias: pelias, + GeocodeEarth: GeocodeEarth, + geocodeEarth: geocodeEarth, + Mapzen: Mapzen, + mapzen: mapzen, + Openrouteservice: Openrouteservice, + openrouteservice: openrouteservice, + Photon: Photon, + photon: photon, + What3Words: What3Words, + what3words: what3words + }); + + var Geocoder = L.Control.extend({ + options: { + showUniqueResult: true, + showResultIcons: false, + collapsed: true, + expand: 'touch', // options: touch, click, anythingelse + position: 'topright', + placeholder: 'Search...', + errorMessage: 'Nothing found.', + iconLabel: 'Initiate a new search', + queryMinLength: 1, + suggestMinLength: 3, + suggestTimeout: 250, + defaultMarkGeocode: true + }, + + includes: L.Evented.prototype || L.Mixin.Events, + + initialize: function(options) { + L.Util.setOptions(this, options); + if (!this.options.geocoder) { + this.options.geocoder = new Nominatim(); + } + + this._requestCount = 0; + }, + + addThrobberClass: function() { + L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber'); + }, + + removeThrobberClass: function() { + L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-throbber'); + }, + + onAdd: function(map) { + var className = 'leaflet-control-geocoder', + container = L.DomUtil.create('div', className + ' leaflet-bar'), + icon = L.DomUtil.create('button', className + '-icon', container), + form = (this._form = L.DomUtil.create('div', className + '-form', container)), + input; + + this._map = map; + this._container = container; + + icon.innerHTML = ' '; + icon.type = 'button'; + icon.setAttribute('aria-label', this.options.iconLabel); + + input = this._input = L.DomUtil.create('input', '', form); + input.type = 'text'; + input.value = this.options.query || ''; + input.placeholder = this.options.placeholder; + L.DomEvent.disableClickPropagation(input); + + this._errorElement = L.DomUtil.create('div', className + '-form-no-error', container); + this._errorElement.innerHTML = this.options.errorMessage; + + this._alts = L.DomUtil.create( + 'ul', + className + '-alternatives leaflet-control-geocoder-alternatives-minimized', + container + ); + L.DomEvent.disableClickPropagation(this._alts); + + L.DomEvent.addListener(input, 'keydown', this._keydown, this); + if (this.options.geocoder.suggest) { + L.DomEvent.addListener(input, 'input', this._change, this); + } + L.DomEvent.addListener( + input, + 'blur', + function() { + if (this.options.collapsed && !this._preventBlurCollapse) { + this._collapse(); + } + this._preventBlurCollapse = false; + }, + this + ); + + if (this.options.collapsed) { + if (this.options.expand === 'click') { + L.DomEvent.addListener( + container, + 'click', + function(e) { + if (e.button === 0 && e.detail !== 2) { + this._toggle(); + } + }, + this + ); + } else if (this.options.expand === 'touch') { + L.DomEvent.addListener( + container, + L.Browser.touch ? 'touchstart mousedown' : 'mousedown', + function(e) { + this._toggle(); + e.preventDefault(); // mobile: clicking focuses the icon, so UI expands and immediately collapses + e.stopPropagation(); + }, + this + ); + } else { + L.DomEvent.addListener(container, 'mouseover', this._expand, this); + L.DomEvent.addListener(container, 'mouseout', this._collapse, this); + this._map.on('movestart', this._collapse, this); + } + } else { + this._expand(); + if (L.Browser.touch) { + L.DomEvent.addListener( + container, + 'touchstart', + function() { + this._geocode(); + }, + this + ); + } else { + L.DomEvent.addListener( + container, + 'click', + function() { + this._geocode(); + }, + this + ); + } + } + + if (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); + + L.DomEvent.disableClickPropagation(container); + + return container; + }, + + setQuery: function(string) { + this._input.value = string; + return this; + }, + + _geocodeResult: function(results, suggest) { + if (!suggest && this.options.showUniqueResult && results.length === 1) { + this._geocodeResultSelected(results[0]); + } else if (results.length > 0) { + this._alts.innerHTML = ''; + this._results = results; + L.DomUtil.removeClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); + L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-options-open'); + for (var i = 0; i < results.length; i++) { + this._alts.appendChild(this._createAlt(results[i], i)); + } + } else { + L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-options-error'); + L.DomUtil.addClass(this._errorElement, 'leaflet-control-geocoder-error'); + } + }, + + markGeocode: function(result) { + result = result.geocode || result; + + this._map.fitBounds(result.bbox); + + if (this._geocodeMarker) { + this._map.removeLayer(this._geocodeMarker); + } + + this._geocodeMarker = new L.Marker(result.center) + .bindPopup(result.html || result.name) + .addTo(this._map) + .openPopup(); + + return this; + }, + + _geocode: function(suggest) { + var value = this._input.value; + if (!suggest && value.length < this.options.queryMinLength) { + return; + } + + var requestCount = ++this._requestCount, + mode = suggest ? 'suggest' : 'geocode', + eventData = { input: value }; + + this._lastGeocode = value; + if (!suggest) { + this._clearResults(); + } + + this.fire('start' + mode, eventData); + this.options.geocoder[mode]( + value, + function(results) { + if (requestCount === this._requestCount) { + eventData.results = results; + this.fire('finish' + mode, eventData); + this._geocodeResult(results, suggest); + } + }, + this + ); + }, + + _geocodeResultSelected: function(result) { + this.fire('markgeocode', { geocode: result }); + }, + + _toggle: function() { + if (L.DomUtil.hasClass(this._container, 'leaflet-control-geocoder-expanded')) { + this._collapse(); + } else { + this._expand(); + } + }, + + _expand: function() { + L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-expanded'); + this._input.select(); + this.fire('expand'); + }, + + _collapse: function() { + L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-expanded'); + L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); + L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error'); + L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-open'); + L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-error'); + this._input.blur(); // mobile: keyboard shouldn't stay expanded + this.fire('collapse'); + }, + + _clearResults: function() { + L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); + this._selection = null; + L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error'); + L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-open'); + L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-error'); + }, + + _createAlt: function(result, index) { + var li = L.DomUtil.create('li', ''), + a = L.DomUtil.create('a', '', li), + icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null, + text = result.html ? undefined : document.createTextNode(result.name), + mouseDownHandler = function mouseDownHandler(e) { + // In some browsers, a click will fire on the map if the control is + // collapsed directly after mousedown. To work around this, we + // wait until the click is completed, and _then_ collapse the + // control. Messy, but this is the workaround I could come up with + // for #142. + this._preventBlurCollapse = true; + L.DomEvent.stop(e); + this._geocodeResultSelected(result); + L.DomEvent.on( + li, + 'click touchend', + function() { + if (this.options.collapsed) { + this._collapse(); + } else { + this._clearResults(); + } + }, + this + ); + }; + + if (icon) { + icon.src = result.icon; + } + + li.setAttribute('data-result-index', index); + + if (result.html) { + a.innerHTML = a.innerHTML + result.html; + } else { + a.appendChild(text); + } + + // Use mousedown and not click, since click will fire _after_ blur, + // causing the control to have collapsed and removed the items + // before the click can fire. + L.DomEvent.addListener(li, 'mousedown touchstart', mouseDownHandler, this); + + return li; + }, + + _keydown: function(e) { + var _this = this, + select = function select(dir) { + if (_this._selection) { + L.DomUtil.removeClass(_this._selection, 'leaflet-control-geocoder-selected'); + _this._selection = _this._selection[dir > 0 ? 'nextSibling' : 'previousSibling']; + } + if (!_this._selection) { + _this._selection = _this._alts[dir > 0 ? 'firstChild' : 'lastChild']; + } + + if (_this._selection) { + L.DomUtil.addClass(_this._selection, 'leaflet-control-geocoder-selected'); + } + }; + + switch (e.keyCode) { + // Escape + case 27: + if (this.options.collapsed) { + this._collapse(); + } else { + this._clearResults(); + } + break; + // Up + case 38: + select(-1); + break; + // Up + case 40: + select(1); + break; + // Enter + case 13: + if (this._selection) { + var index = parseInt(this._selection.getAttribute('data-result-index'), 10); + this._geocodeResultSelected(this._results[index]); + this._clearResults(); + } else { + this._geocode(); + } + break; + default: + return; + } + + L.DomEvent.preventDefault(e); + }, + _change: function() { + var v = this._input.value; + if (v !== this._lastGeocode) { + clearTimeout(this._suggestTimeout); + if (v.length >= this.options.suggestMinLength) { + this._suggestTimeout = setTimeout( + L.bind(function() { + this._geocode(true); + }, this), + this.options.suggestTimeout + ); + } else { + this._clearResults(); + } + } + } + }); + + function geocoder(options) { + return new Geocoder(options); + } + + L.Util.extend(Geocoder, geocoders); + + L.Util.extend(L.Control, { + Geocoder: Geocoder, + geocoder: geocoder + }); + + return Geocoder; }(L)); //# sourceMappingURL=Control.Geocoder.js.map diff --git a/assets/control-geocoder/Control.Geocoder.js.map b/assets/control-geocoder/Control.Geocoder.js.map index d655362..0f426c0 100644 --- a/assets/control-geocoder/Control.Geocoder.js.map +++ b/assets/control-geocoder/Control.Geocoder.js.map @@ -1 +1 @@ -{"version":3,"file":"Control.Geocoder.js","sources":["../src/util.js","../src/geocoders/nominatim.js","../src/control.js","../src/geocoders/bing.js","../src/geocoders/mapquest.js","../src/geocoders/mapbox.js","../src/geocoders/what3words.js","../src/geocoders/google.js","../src/geocoders/photon.js","../src/geocoders/mapzen.js","../src/geocoders/arcgis.js","../src/geocoders/here.js","../src/index.js"],"sourcesContent":["import L from 'leaflet';\nvar lastCallbackId = 0;\n\n// Adapted from handlebars.js\n// https://github.com/wycats/handlebars.js/\nvar badChars = /[&<>\"'`]/g;\nvar possible = /[&<>\"'`]/;\nvar escape = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\n\nfunction escapeChar(chr) {\n return escape[chr];\n}\n\nexport function htmlEscape(string) {\n if (string == null) {\n return '';\n } else if (!string) {\n return string + '';\n }\n\n // Force a string conversion as this will be done by the append regardless and\n // the regex test will do this transparently behind the scenes, causing issues if\n // an object's to string has escaped characters in it.\n string = '' + string;\n\n if (!possible.test(string)) {\n return string;\n }\n return string.replace(badChars, escapeChar);\n}\n\nexport function jsonp(url, params, callback, context, jsonpParam) {\n var callbackId = '_l_geocoder_' + lastCallbackId++;\n params[jsonpParam || 'callback'] = callbackId;\n window[callbackId] = L.Util.bind(callback, context);\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url + L.Util.getParamString(params);\n script.id = callbackId;\n document.getElementsByTagName('head')[0].appendChild(script);\n}\n\nexport function getJSON(url, params, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState !== 4) {\n return;\n }\n if (xmlHttp.status !== 200 && xmlHttp.status !== 304) {\n callback('');\n return;\n }\n callback(JSON.parse(xmlHttp.response));\n };\n xmlHttp.open('GET', url + L.Util.getParamString(params), true);\n xmlHttp.setRequestHeader('Accept', 'application/json');\n xmlHttp.send(null);\n}\n\nexport function template(str, data) {\n return str.replace(/\\{ *([\\w_]+) *\\}/g, function(str, key) {\n var value = data[key];\n if (value === undefined) {\n value = '';\n } else if (typeof value === 'function') {\n value = value(data);\n }\n return htmlEscape(value);\n });\n}\n","import L from 'leaflet';\nimport { template, getJSON } from '../util';\n\nexport default {\n class: L.Class.extend({\n options: {\n serviceUrl: 'https://nominatim.openstreetmap.org/',\n geocodingQueryParams: {},\n reverseQueryParams: {},\n htmlTemplate: function(r) {\n var a = r.address,\n parts = [];\n if (a.road || a.building) {\n parts.push('{building} {road} {house_number}');\n }\n\n if (a.city || a.town || a.village || a.hamlet) {\n parts.push(\n ' 0 ? 'leaflet-control-geocoder-address-detail' : '') +\n '\">{postcode} {city} {town} {village} {hamlet}'\n );\n }\n\n if (a.state || a.country) {\n parts.push(\n ' 0 ? 'leaflet-control-geocoder-address-context' : '') +\n '\">{state} {country}'\n );\n }\n\n return template(parts.join('
'), a, true);\n }\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + 'search',\n L.extend(\n {\n q: query,\n limit: 5,\n format: 'json',\n addressdetails: 1\n },\n this.options.geocodingQueryParams\n ),\n L.bind(function(data) {\n var results = [];\n for (var i = data.length - 1; i >= 0; i--) {\n var bbox = data[i].boundingbox;\n for (var j = 0; j < 4; j++) bbox[j] = parseFloat(bbox[j]);\n results[i] = {\n icon: data[i].icon,\n name: data[i].display_name,\n html: this.options.htmlTemplate ? this.options.htmlTemplate(data[i]) : undefined,\n bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]),\n center: L.latLng(data[i].lat, data[i].lon),\n properties: data[i]\n };\n }\n cb.call(context, results);\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'reverse',\n L.extend(\n {\n lat: location.lat,\n lon: location.lng,\n zoom: Math.round(Math.log(scale / 256) / Math.log(2)),\n addressdetails: 1,\n format: 'json'\n },\n this.options.reverseQueryParams\n ),\n L.bind(function(data) {\n var result = [],\n loc;\n\n if (data && data.lat && data.lon) {\n loc = L.latLng(data.lat, data.lon);\n result.push({\n name: data.display_name,\n html: this.options.htmlTemplate ? this.options.htmlTemplate(data) : undefined,\n center: loc,\n bounds: L.latLngBounds(loc, loc),\n properties: data\n });\n }\n\n cb.call(context, result);\n }, this)\n );\n }\n }),\n\n factory: function(options) {\n return new L.Control.Geocoder.Nominatim(options);\n }\n};\n","import L from 'leaflet';\nimport Nominatim from './geocoders/nominatim';\n\nexport default {\n class: L.Control.extend({\n options: {\n showResultIcons: false,\n collapsed: true,\n expand: 'touch', // options: touch, click, anythingelse\n position: 'topright',\n placeholder: 'Search...',\n errorMessage: 'Nothing found.',\n suggestMinLength: 3,\n suggestTimeout: 250,\n defaultMarkGeocode: true\n },\n\n includes: L.Evented.prototype || L.Mixin.Events,\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n if (!this.options.geocoder) {\n this.options.geocoder = new Nominatim.class();\n }\n\n this._requestCount = 0;\n },\n\n onAdd: function(map) {\n var className = 'leaflet-control-geocoder',\n container = L.DomUtil.create('div', className + ' leaflet-bar'),\n icon = L.DomUtil.create('button', className + '-icon', container),\n form = (this._form = L.DomUtil.create('div', className + '-form', container)),\n input;\n\n this._map = map;\n this._container = container;\n\n icon.innerHTML = ' ';\n icon.type = 'button';\n\n input = this._input = L.DomUtil.create('input', '', form);\n input.type = 'text';\n input.placeholder = this.options.placeholder;\n\n this._errorElement = L.DomUtil.create('div', className + '-form-no-error', container);\n this._errorElement.innerHTML = this.options.errorMessage;\n\n this._alts = L.DomUtil.create(\n 'ul',\n className + '-alternatives leaflet-control-geocoder-alternatives-minimized',\n container\n );\n L.DomEvent.disableClickPropagation(this._alts);\n\n L.DomEvent.addListener(input, 'keydown', this._keydown, this);\n if (this.options.geocoder.suggest) {\n L.DomEvent.addListener(input, 'input', this._change, this);\n }\n L.DomEvent.addListener(\n input,\n 'blur',\n function() {\n if (this.options.collapsed && !this._preventBlurCollapse) {\n this._collapse();\n }\n this._preventBlurCollapse = false;\n },\n this\n );\n\n if (this.options.collapsed) {\n if (this.options.expand === 'click') {\n L.DomEvent.addListener(\n container,\n 'click',\n function(e) {\n if (e.button === 0 && e.detail !== 2) {\n this._toggle();\n }\n },\n this\n );\n } else if (L.Browser.touch && this.options.expand === 'touch') {\n L.DomEvent.addListener(\n container,\n 'touchstart mousedown',\n function(e) {\n this._toggle();\n e.preventDefault(); // mobile: clicking focuses the icon, so UI expands and immediately collapses\n e.stopPropagation();\n },\n this\n );\n } else {\n L.DomEvent.addListener(container, 'mouseover', this._expand, this);\n L.DomEvent.addListener(container, 'mouseout', this._collapse, this);\n this._map.on('movestart', this._collapse, this);\n }\n } else {\n this._expand();\n if (L.Browser.touch) {\n L.DomEvent.addListener(\n container,\n 'touchstart',\n function() {\n this._geocode();\n },\n this\n );\n } else {\n L.DomEvent.addListener(\n container,\n 'click',\n function() {\n this._geocode();\n },\n this\n );\n }\n }\n\n if (this.options.defaultMarkGeocode) {\n this.on('markgeocode', this.markGeocode, this);\n }\n\n this.on(\n 'startgeocode',\n function() {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber');\n },\n this\n );\n this.on(\n 'finishgeocode',\n function() {\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-throbber');\n },\n this\n );\n\n L.DomEvent.disableClickPropagation(container);\n\n return container;\n },\n\n _geocodeResult: function(results, suggest) {\n if (!suggest && results.length === 1) {\n this._geocodeResultSelected(results[0]);\n } else if (results.length > 0) {\n this._alts.innerHTML = '';\n this._results = results;\n L.DomUtil.removeClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n for (var i = 0; i < results.length; i++) {\n this._alts.appendChild(this._createAlt(results[i], i));\n }\n } else {\n L.DomUtil.addClass(this._errorElement, 'leaflet-control-geocoder-error');\n }\n },\n\n markGeocode: function(result) {\n result = result.geocode || result;\n\n this._map.fitBounds(result.bbox);\n\n if (this._geocodeMarker) {\n this._map.removeLayer(this._geocodeMarker);\n }\n\n this._geocodeMarker = new L.Marker(result.center)\n .bindPopup(result.html || result.name)\n .addTo(this._map)\n .openPopup();\n\n return this;\n },\n\n _geocode: function(suggest) {\n var requestCount = ++this._requestCount,\n mode = suggest ? 'suggest' : 'geocode',\n eventData = { input: this._input.value };\n\n this._lastGeocode = this._input.value;\n if (!suggest) {\n this._clearResults();\n }\n\n this.fire('start' + mode, eventData);\n this.options.geocoder[mode](\n this._input.value,\n function(results) {\n if (requestCount === this._requestCount) {\n eventData.results = results;\n this.fire('finish' + mode, eventData);\n this._geocodeResult(results, suggest);\n }\n },\n this\n );\n },\n\n _geocodeResultSelected: function(result) {\n this.fire('markgeocode', { geocode: result });\n },\n\n _toggle: function() {\n if (L.DomUtil.hasClass(this._container, 'leaflet-control-geocoder-expanded')) {\n this._collapse();\n } else {\n this._expand();\n }\n },\n\n _expand: function() {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-expanded');\n this._input.select();\n this.fire('expand');\n },\n\n _collapse: function() {\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-expanded');\n L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error');\n this._input.blur(); // mobile: keyboard shouldn't stay expanded\n this.fire('collapse');\n },\n\n _clearResults: function() {\n L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n this._selection = null;\n L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error');\n },\n\n _createAlt: function(result, index) {\n var li = L.DomUtil.create('li', ''),\n a = L.DomUtil.create('a', '', li),\n icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null,\n text = result.html ? undefined : document.createTextNode(result.name),\n mouseDownHandler = function mouseDownHandler(e) {\n // In some browsers, a click will fire on the map if the control is\n // collapsed directly after mousedown. To work around this, we\n // wait until the click is completed, and _then_ collapse the\n // control. Messy, but this is the workaround I could come up with\n // for #142.\n this._preventBlurCollapse = true;\n L.DomEvent.stop(e);\n this._geocodeResultSelected(result);\n L.DomEvent.on(\n li,\n 'click',\n function() {\n if (this.options.collapsed) {\n this._collapse();\n } else {\n this._clearResults();\n }\n },\n this\n );\n };\n\n if (icon) {\n icon.src = result.icon;\n }\n\n li.setAttribute('data-result-index', index);\n\n if (result.html) {\n a.innerHTML = a.innerHTML + result.html;\n } else {\n a.appendChild(text);\n }\n\n // Use mousedown and not click, since click will fire _after_ blur,\n // causing the control to have collapsed and removed the items\n // before the click can fire.\n L.DomEvent.addListener(li, 'mousedown touchstart', mouseDownHandler, this);\n\n return li;\n },\n\n _keydown: function(e) {\n var _this = this,\n select = function select(dir) {\n if (_this._selection) {\n L.DomUtil.removeClass(_this._selection, 'leaflet-control-geocoder-selected');\n _this._selection = _this._selection[dir > 0 ? 'nextSibling' : 'previousSibling'];\n }\n if (!_this._selection) {\n _this._selection = _this._alts[dir > 0 ? 'firstChild' : 'lastChild'];\n }\n\n if (_this._selection) {\n L.DomUtil.addClass(_this._selection, 'leaflet-control-geocoder-selected');\n }\n };\n\n switch (e.keyCode) {\n // Escape\n case 27:\n if (this.options.collapsed) {\n this._collapse();\n }\n break;\n // Up\n case 38:\n select(-1);\n break;\n // Up\n case 40:\n select(1);\n break;\n // Enter\n case 13:\n if (this._selection) {\n var index = parseInt(this._selection.getAttribute('data-result-index'), 10);\n this._geocodeResultSelected(this._results[index]);\n this._clearResults();\n } else {\n this._geocode();\n }\n break;\n }\n },\n _change: function() {\n var v = this._input.value;\n if (v !== this._lastGeocode) {\n clearTimeout(this._suggestTimeout);\n if (v.length >= this.options.suggestMinLength) {\n this._suggestTimeout = setTimeout(\n L.bind(function() {\n this._geocode(true);\n }, this),\n this.options.suggestTimeout\n );\n } else {\n this._clearResults();\n }\n }\n }\n }),\n factory: function(options) {\n return new L.Control.Geocoder(options);\n }\n};\n","import L from 'leaflet';\nimport { jsonp } from '../util';\n\nexport default {\n class: L.Class.extend({\n initialize: function(key) {\n this.key = key;\n },\n\n geocode: function(query, cb, context) {\n jsonp(\n 'https://dev.virtualearth.net/REST/v1/Locations',\n {\n query: query,\n key: this.key\n },\n function(data) {\n var results = [];\n if (data.resourceSets.length > 0) {\n for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) {\n var resource = data.resourceSets[0].resources[i],\n bbox = resource.bbox;\n results[i] = {\n name: resource.name,\n bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]),\n center: L.latLng(resource.point.coordinates)\n };\n }\n }\n cb.call(context, results);\n },\n this,\n 'jsonp'\n );\n },\n\n reverse: function(location, scale, cb, context) {\n jsonp(\n '//dev.virtualearth.net/REST/v1/Locations/' + location.lat + ',' + location.lng,\n {\n key: this.key\n },\n function(data) {\n var results = [];\n for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) {\n var resource = data.resourceSets[0].resources[i],\n bbox = resource.bbox;\n results[i] = {\n name: resource.name,\n bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]),\n center: L.latLng(resource.point.coordinates)\n };\n }\n cb.call(context, results);\n },\n this,\n 'jsonp'\n );\n }\n }),\n\n factory: function(key) {\n return new L.Control.Geocoder.Bing(key);\n }\n};\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport default {\n class: L.Class.extend({\n options: {\n serviceUrl: 'https://www.mapquestapi.com/geocoding/v1'\n },\n\n initialize: function(key, options) {\n // MapQuest seems to provide URI encoded API keys,\n // so to avoid encoding them twice, we decode them here\n this._key = decodeURIComponent(key);\n\n L.Util.setOptions(this, options);\n },\n\n _formatName: function() {\n var r = [],\n i;\n for (i = 0; i < arguments.length; i++) {\n if (arguments[i]) {\n r.push(arguments[i]);\n }\n }\n\n return r.join(', ');\n },\n\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + '/address',\n {\n key: this._key,\n location: query,\n limit: 5,\n outFormat: 'json'\n },\n L.bind(function(data) {\n var results = [],\n loc,\n latLng;\n if (data.results && data.results[0].locations) {\n for (var i = data.results[0].locations.length - 1; i >= 0; i--) {\n loc = data.results[0].locations[i];\n latLng = L.latLng(loc.latLng);\n results[i] = {\n name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1),\n bbox: L.latLngBounds(latLng, latLng),\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + '/reverse',\n {\n key: this._key,\n location: location.lat + ',' + location.lng,\n outputFormat: 'json'\n },\n L.bind(function(data) {\n var results = [],\n loc,\n latLng;\n if (data.results && data.results[0].locations) {\n for (var i = data.results[0].locations.length - 1; i >= 0; i--) {\n loc = data.results[0].locations[i];\n latLng = L.latLng(loc.latLng);\n results[i] = {\n name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1),\n bbox: L.latLngBounds(latLng, latLng),\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }, this)\n );\n }\n }),\n\n factory: function(key, options) {\n return new L.Control.Geocoder.MapQuest(key, options);\n }\n};\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport default {\n class: L.Class.extend({\n options: {\n serviceUrl: 'https://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(accessToken, options) {\n L.setOptions(this, options);\n this.options.geocodingQueryParams.access_token = accessToken;\n this.options.reverseQueryParams.access_token = accessToken;\n },\n\n geocode: function(query, cb, context) {\n var params = this.options.geocodingQueryParams;\n if (\n typeof params.proximity !== 'undefined' &&\n params.proximity.hasOwnProperty('lat') &&\n params.proximity.hasOwnProperty('lng')\n ) {\n params.proximity = params.proximity.lng + ',' + params.proximity.lat;\n }\n getJSON(this.options.serviceUrl + encodeURIComponent(query) + '.json', params, function(\n data\n ) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.features && data.features.length) {\n for (var i = 0; i <= data.features.length - 1; i++) {\n loc = data.features[i];\n latLng = L.latLng(loc.center.reverse());\n if (loc.hasOwnProperty('bbox')) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.bbox.slice(0, 2).reverse()),\n L.latLng(loc.bbox.slice(2, 4).reverse())\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results[i] = {\n name: loc.place_name,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n });\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl +\n encodeURIComponent(location.lng) +\n ',' +\n encodeURIComponent(location.lat) +\n '.json',\n this.options.reverseQueryParams,\n function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.features && data.features.length) {\n for (var i = 0; i <= data.features.length - 1; i++) {\n loc = data.features[i];\n latLng = L.latLng(loc.center.reverse());\n if (loc.hasOwnProperty('bbox')) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.bbox.slice(0, 2).reverse()),\n L.latLng(loc.bbox.slice(2, 4).reverse())\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results[i] = {\n name: loc.place_name,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }\n );\n }\n }),\n\n factory: function(accessToken, options) {\n return new L.Control.Geocoder.Mapbox(accessToken, options);\n }\n};\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport default {\n class: L.Class.extend({\n options: {\n serviceUrl: 'https://api.what3words.com/v2/'\n },\n\n initialize: function(accessToken) {\n this._accessToken = accessToken;\n },\n\n geocode: function(query, cb, context) {\n //get three words and make a dot based string\n getJSON(\n this.options.serviceUrl + 'forward',\n {\n key: this._accessToken,\n addr: query.split(/\\s+/).join('.')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.hasOwnProperty('geometry')) {\n latLng = L.latLng(data.geometry['lat'], data.geometry['lng']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.words,\n bbox: latLngBounds,\n center: latLng\n };\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'reverse',\n {\n key: this._accessToken,\n coords: [location.lat, location.lng].join(',')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.status.status == 200) {\n latLng = L.latLng(data.geometry['lat'], data.geometry['lng']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.words,\n bbox: latLngBounds,\n center: latLng\n };\n }\n cb.call(context, results);\n }\n );\n }\n }),\n\n factory: function(accessToken) {\n return new L.Control.Geocoder.What3Words(accessToken);\n }\n};\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport default {\n class: L.Class.extend({\n options: {\n serviceUrl: 'https://maps.googleapis.com/maps/api/geocode/json',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(key, options) {\n this._key = key;\n L.setOptions(this, options);\n // Backwards compatibility\n this.options.serviceUrl = this.options.service_url || this.options.serviceUrl;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n address: query\n };\n\n if (this._key && this._key.length) {\n params.key = this._key;\n }\n\n params = L.Util.extend(params, this.options.geocodingQueryParams);\n\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.results && data.results.length) {\n for (var i = 0; i <= data.results.length - 1; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry.location);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.geometry.viewport.northeast),\n L.latLng(loc.geometry.viewport.southwest)\n );\n results[i] = {\n name: loc.formatted_address,\n bbox: latLngBounds,\n center: latLng,\n properties: loc.address_components\n };\n }\n }\n\n cb.call(context, results);\n });\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n latlng: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng)\n };\n params = L.Util.extend(params, this.options.reverseQueryParams);\n if (this._key && this._key.length) {\n params.key = this._key;\n }\n\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.results && data.results.length) {\n for (var i = 0; i <= data.results.length - 1; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry.location);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.geometry.viewport.northeast),\n L.latLng(loc.geometry.viewport.southwest)\n );\n results[i] = {\n name: loc.formatted_address,\n bbox: latLngBounds,\n center: latLng,\n properties: loc.address_components\n };\n }\n }\n\n cb.call(context, results);\n });\n }\n }),\n\n factory: function(key, options) {\n return new L.Control.Geocoder.Google(key, options);\n }\n};\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport default {\n class: L.Class.extend({\n options: {\n serviceUrl: 'https://photon.komoot.de/api/',\n reverseUrl: 'https://photon.komoot.de/reverse/',\n nameProperties: ['name', 'street', 'suburb', 'hamlet', 'town', 'city', 'state', 'country']\n },\n\n initialize: function(options) {\n L.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n var params = L.extend(\n {\n q: query\n },\n this.options.geocodingQueryParams\n );\n\n getJSON(\n this.options.serviceUrl,\n params,\n L.bind(function(data) {\n cb.call(context, this._decodeFeatures(data));\n }, this)\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(latLng, scale, cb, context) {\n var params = L.extend(\n {\n lat: latLng.lat,\n lon: latLng.lng\n },\n this.options.reverseQueryParams\n );\n\n getJSON(\n this.options.reverseUrl,\n params,\n L.bind(function(data) {\n cb.call(context, this._decodeFeatures(data));\n }, this)\n );\n },\n\n _decodeFeatures: function(data) {\n var results = [],\n i,\n f,\n c,\n latLng,\n extent,\n bbox;\n\n if (data && data.features) {\n for (i = 0; i < data.features.length; i++) {\n f = data.features[i];\n c = f.geometry.coordinates;\n latLng = L.latLng(c[1], c[0]);\n extent = f.properties.extent;\n\n if (extent) {\n bbox = L.latLngBounds([extent[1], extent[0]], [extent[3], extent[2]]);\n } else {\n bbox = L.latLngBounds(latLng, latLng);\n }\n\n results.push({\n name: this._deocodeFeatureName(f),\n html: this.options.htmlTemplate ? this.options.htmlTemplate(f) : undefined,\n center: latLng,\n bbox: bbox,\n properties: f.properties\n });\n }\n }\n\n return results;\n },\n\n _deocodeFeatureName: function(f) {\n var j, name;\n for (j = 0; !name && j < this.options.nameProperties.length; j++) {\n name = f.properties[this.options.nameProperties[j]];\n }\n\n return name;\n }\n }),\n\n factory: function(options) {\n return new L.Control.Geocoder.Photon(options);\n }\n};\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport default {\n class: L.Class.extend({\n options: {\n serviceUrl: 'https://search.mapzen.com/v1',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(apiKey, options) {\n L.Util.setOptions(this, options);\n this._apiKey = apiKey;\n this._lastSuggest = 0;\n },\n\n geocode: function(query, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/search',\n L.extend(\n {\n api_key: this._apiKey,\n text: query\n },\n this.options.geocodingQueryParams\n ),\n function(data) {\n cb.call(context, _this._parseResults(data, 'bbox'));\n }\n );\n },\n\n suggest: function(query, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/autocomplete',\n L.extend(\n {\n api_key: this._apiKey,\n text: query\n },\n this.options.geocodingQueryParams\n ),\n L.bind(function(data) {\n if (data.geocoding.timestamp > this._lastSuggest) {\n this._lastSuggest = data.geocoding.timestamp;\n cb.call(context, _this._parseResults(data, 'bbox'));\n }\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/reverse',\n L.extend(\n {\n api_key: this._apiKey,\n 'point.lat': location.lat,\n 'point.lon': location.lng\n },\n this.options.reverseQueryParams\n ),\n function(data) {\n cb.call(context, _this._parseResults(data, 'bounds'));\n }\n );\n },\n\n _parseResults: function(data, bboxname) {\n var results = [];\n L.geoJson(data, {\n pointToLayer: function(feature, latlng) {\n return L.circleMarker(latlng);\n },\n onEachFeature: function(feature, layer) {\n var result = {},\n bbox,\n center;\n\n if (layer.getBounds) {\n bbox = layer.getBounds();\n center = bbox.getCenter();\n } else {\n center = layer.getLatLng();\n bbox = L.latLngBounds(center, center);\n }\n\n result.name = layer.feature.properties.label;\n result.center = center;\n result[bboxname] = bbox;\n result.properties = layer.feature.properties;\n results.push(result);\n }\n });\n return results;\n }\n }),\n\n factory: function(apiKey, options) {\n return new L.Control.Geocoder.Mapzen(apiKey, options);\n }\n};\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport default {\n class: L.Class.extend({\n options: {\n service_url: 'http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer'\n },\n\n initialize: function(accessToken, options) {\n L.setOptions(this, options);\n this._accessToken = accessToken;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n SingleLine: query,\n outFields: 'Addr_Type',\n forStorage: false,\n maxLocations: 10,\n f: 'json'\n };\n\n if (this._key && this._key.length) {\n params.token = this._key;\n }\n\n getJSON(this.options.service_url + '/findAddressCandidates', params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n\n if (data.candidates && data.candidates.length) {\n for (var i = 0; i <= data.candidates.length - 1; i++) {\n loc = data.candidates[i];\n latLng = L.latLng(loc.location.y, loc.location.x);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.extent.ymax, loc.extent.xmax),\n L.latLng(loc.extent.ymin, loc.extent.xmin)\n );\n results[i] = {\n name: loc.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n });\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n location: encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat),\n distance: 100,\n f: 'json'\n };\n\n getJSON(this.options.service_url + '/reverseGeocode', params, function(data) {\n var result = [],\n loc;\n\n if (data && !data.error) {\n loc = L.latLng(data.location.y, data.location.x);\n result.push({\n name: data.address.Match_addr,\n center: loc,\n bounds: L.latLngBounds(loc, loc)\n });\n }\n\n cb.call(context, result);\n });\n }\n }),\n\n factory: function(accessToken, options) {\n return new L.Control.Geocoder.ArcGis(accessToken, options);\n }\n};\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport default {\n class: L.Class.extend({\n options: {\n geocodeUrl: 'http://geocoder.api.here.com/6.2/geocode.json',\n reverseGeocodeUrl: 'http://reverse.geocoder.api.here.com/6.2/reversegeocode.json',\n app_id: '',\n app_code: '',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(options) {\n L.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n var params = {\n searchtext: query,\n gen: 9,\n app_id: this.options.app_id,\n app_code: this.options.app_code,\n jsonattributes: 1\n };\n params = L.Util.extend(params, this.options.geocodingQueryParams);\n this.getJSON(this.options.geocodeUrl, params, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n prox: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng),\n mode: 'retrieveAddresses',\n app_id: this.options.app_id,\n app_code: this.options.app_code,\n gen: 9,\n jsonattributes: 1\n };\n params = L.Util.extend(params, this.options.reverseQueryParams);\n this.getJSON(this.options.reverseGeocodeUrl, params, cb, context);\n },\n\n getJSON: function(url, params, cb, context) {\n getJSON(url, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.response.view && data.response.view.length) {\n for (var i = 0; i <= data.response.view[0].result.length - 1; i++) {\n loc = data.response.view[0].result[i].location;\n latLng = L.latLng(loc.displayPosition.latitude, loc.displayPosition.longitude);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.mapView.topLeft.latitude, loc.mapView.topLeft.longitude),\n L.latLng(loc.mapView.bottomRight.latitude, loc.mapView.bottomRight.longitude)\n );\n results[i] = {\n name: loc.address.label,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n cb.call(context, results);\n });\n }\n }),\n\n factory: function(options) {\n return new L.Control.Geocoder.HERE(options);\n }\n};\n","import L from 'leaflet';\nimport Control from './control';\nimport Nominatim from './geocoders/nominatim';\nimport Bing from './geocoders/bing';\nimport MapQuest from './geocoders/mapquest';\nimport Mapbox from './geocoders/mapbox';\nimport What3Words from './geocoders/what3words';\nimport Google from './geocoders/google';\nimport Photon from './geocoders/photon';\nimport Mapzen from './geocoders/mapzen';\nimport ArcGis from './geocoders/arcgis';\nimport HERE from './geocoders/here';\n\nvar Geocoder = L.Util.extend(Control.class, {\n Nominatim: Nominatim.class,\n nominatim: Nominatim.factory,\n Bing: Bing.class,\n bing: Bing.factory,\n MapQuest: MapQuest.class,\n mapQuest: MapQuest.factory,\n Mapbox: Mapbox.class,\n mapbox: Mapbox.factory,\n What3Words: What3Words.class,\n what3words: What3Words.factory,\n Google: Google.class,\n google: Google.factory,\n Photon: Photon.class,\n photon: Photon.factory,\n Mapzen: Mapzen.class,\n mapzen: Mapzen.factory,\n ArcGis: ArcGis.class,\n arcgis: ArcGis.factory,\n HERE: HERE.class,\n here: HERE.factory\n});\n\nexport default Geocoder;\n\nL.Util.extend(L.Control, {\n Geocoder: Geocoder,\n geocoder: Control.factory\n});\n"],"names":[],"mappings":";;;;;;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IAAI,EAAE,IAAI,CAAC,OAAO;EAClB,QAAQ,EAAE,QAAQ,CAAC,KAAK;EACxB,QAAQ,EAAE,QAAQ,CAAC,OAAO;EAC1B,MAAM,EAAE,MAAM,CAAC,KAAK;EACpB,MAAM,EAAE,MAAM,CAAC,OAAO;EACtB,UAAU,EAAE,UAAU,CAAC,KAAK;EAC5B,UAAU,EAAE,UAAU,CAAC,OAAO;EAC9B,MAAM,EAAE,MAAM,CAAC,KAAK;EACpB,MAAM,EAAE,MAAM,CAAC,OAAO;EACtB,MAAM,EAAE,MAAM,CAAC,KAAK;EACpB,MAAM,EAAE,MAAM,CAAC,OAAO;EACtB,MAAM,EAAE,MAAM,CAAC,KAAK;EACpB,MAAM,EAAE,MAAM,CAAC,OAAO;EACtB,MAAM,EAAE,MAAM,CAAC,KAAK;EACpB,MAAM,EAAE,MAAM,CAAC,OAAO;EACtB,IAAI,EAAE,IAAI,CAAC,KAAK;EAChB,IAAI,EAAE,IAAI,CAAC,OAAO;CACnB,CAAC,CAAC;;AAEH,AAEA,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE;EACvB,QAAQ,EAAE,QAAQ;EAClB,QAAQ,EAAE,OAAO,CAAC,OAAO;CAC1B,CAAC,CAAC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"Control.Geocoder.js","sources":["../src/util.js","../src/geocoders/arcgis.js","../src/geocoders/bing.js","../src/geocoders/google.js","../src/geocoders/here.js","../src/geocoders/latlng.js","../src/geocoders/mapbox.js","../src/geocoders/mapquest.js","../src/geocoders/neutrino.js","../src/geocoders/nominatim.js","../src/geocoders/open-location-code.js","../src/geocoders/opencage.js","../src/geocoders/pelias.js","../src/geocoders/photon.js","../src/geocoders/what3words.js","../src/control.js","../src/index.js"],"sourcesContent":["import L from 'leaflet';\nvar lastCallbackId = 0;\n\n// Adapted from handlebars.js\n// https://github.com/wycats/handlebars.js/\nvar badChars = /[&<>\"'`]/g;\nvar possible = /[&<>\"'`]/;\nvar escape = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\n\nfunction escapeChar(chr) {\n return escape[chr];\n}\n\nexport function htmlEscape(string) {\n if (string == null) {\n return '';\n } else if (!string) {\n return string + '';\n }\n\n // Force a string conversion as this will be done by the append regardless and\n // the regex test will do this transparently behind the scenes, causing issues if\n // an object's to string has escaped characters in it.\n string = '' + string;\n\n if (!possible.test(string)) {\n return string;\n }\n return string.replace(badChars, escapeChar);\n}\n\nexport function jsonp(url, params, callback, context, jsonpParam) {\n var callbackId = '_l_geocoder_' + lastCallbackId++;\n params[jsonpParam || 'callback'] = callbackId;\n window[callbackId] = L.Util.bind(callback, context);\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url + getParamString(params);\n script.id = callbackId;\n document.getElementsByTagName('head')[0].appendChild(script);\n}\n\nexport function getJSON(url, params, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState !== 4) {\n return;\n }\n var message;\n if (xmlHttp.status !== 200 && xmlHttp.status !== 304) {\n message = '';\n } else if (typeof xmlHttp.response === 'string') {\n // IE doesn't parse JSON responses even with responseType: 'json'.\n try {\n message = JSON.parse(xmlHttp.response);\n } catch (e) {\n // Not a JSON response\n message = xmlHttp.response;\n }\n } else {\n message = xmlHttp.response;\n }\n callback(message);\n };\n xmlHttp.open('GET', url + getParamString(params), true);\n xmlHttp.responseType = 'json';\n xmlHttp.setRequestHeader('Accept', 'application/json');\n xmlHttp.send(null);\n}\n\nexport function template(str, data) {\n return str.replace(/\\{ *([\\w_]+) *\\}/g, function(str, key) {\n var value = data[key];\n if (value === undefined) {\n value = '';\n } else if (typeof value === 'function') {\n value = value(data);\n }\n return htmlEscape(value);\n });\n}\n\nexport function getParamString(obj, existingUrl, uppercase) {\n var params = [];\n for (var i in obj) {\n var key = encodeURIComponent(uppercase ? i.toUpperCase() : i);\n var value = obj[i];\n if (!L.Util.isArray(value)) {\n params.push(key + '=' + encodeURIComponent(value));\n } else {\n for (var j = 0; j < value.length; j++) {\n params.push(key + '=' + encodeURIComponent(value[j]));\n }\n }\n }\n return (!existingUrl || existingUrl.indexOf('?') === -1 ? '?' : '&') + params.join('&');\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var ArcGis = L.Class.extend({\n options: {\n service_url: 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer'\n },\n\n initialize: function(accessToken, options) {\n L.setOptions(this, options);\n this._accessToken = accessToken;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n SingleLine: query,\n outFields: 'Addr_Type',\n forStorage: false,\n maxLocations: 10,\n f: 'json'\n };\n\n if (this._key && this._key.length) {\n params.token = this._key;\n }\n\n getJSON(\n this.options.service_url + '/findAddressCandidates',\n L.extend(params, this.options.geocodingQueryParams),\n function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n\n if (data.candidates && data.candidates.length) {\n for (var i = 0; i <= data.candidates.length - 1; i++) {\n loc = data.candidates[i];\n latLng = L.latLng(loc.location.y, loc.location.x);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.extent.ymax, loc.extent.xmax),\n L.latLng(loc.extent.ymin, loc.extent.xmin)\n );\n results[i] = {\n name: loc.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n location: encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat),\n distance: 100,\n f: 'json'\n };\n\n getJSON(this.options.service_url + '/reverseGeocode', params, function(data) {\n var result = [],\n loc;\n\n if (data && !data.error) {\n loc = L.latLng(data.location.y, data.location.x);\n result.push({\n name: data.address.Match_addr,\n center: loc,\n bounds: L.latLngBounds(loc, loc)\n });\n }\n\n cb.call(context, result);\n });\n }\n});\n\nexport function arcgis(accessToken, options) {\n return new ArcGis(accessToken, options);\n}\n","import L from 'leaflet';\nimport { jsonp } from '../util';\n\nexport var Bing = L.Class.extend({\n initialize: function(key) {\n this.key = key;\n },\n\n geocode: function(query, cb, context) {\n jsonp(\n 'https://dev.virtualearth.net/REST/v1/Locations',\n {\n query: query,\n key: this.key\n },\n function(data) {\n var results = [];\n if (data.resourceSets.length > 0) {\n for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) {\n var resource = data.resourceSets[0].resources[i],\n bbox = resource.bbox;\n results[i] = {\n name: resource.name,\n bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]),\n center: L.latLng(resource.point.coordinates)\n };\n }\n }\n cb.call(context, results);\n },\n this,\n 'jsonp'\n );\n },\n\n reverse: function(location, scale, cb, context) {\n jsonp(\n '//dev.virtualearth.net/REST/v1/Locations/' + location.lat + ',' + location.lng,\n {\n key: this.key\n },\n function(data) {\n var results = [];\n for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) {\n var resource = data.resourceSets[0].resources[i],\n bbox = resource.bbox;\n results[i] = {\n name: resource.name,\n bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]),\n center: L.latLng(resource.point.coordinates)\n };\n }\n cb.call(context, results);\n },\n this,\n 'jsonp'\n );\n }\n});\n\nexport function bing(key) {\n return new Bing(key);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Google = L.Class.extend({\n options: {\n serviceUrl: 'https://maps.googleapis.com/maps/api/geocode/json',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(key, options) {\n this._key = key;\n L.setOptions(this, options);\n // Backwards compatibility\n this.options.serviceUrl = this.options.service_url || this.options.serviceUrl;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n address: query\n };\n\n if (this._key && this._key.length) {\n params.key = this._key;\n }\n\n params = L.Util.extend(params, this.options.geocodingQueryParams);\n\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.results && data.results.length) {\n for (var i = 0; i <= data.results.length - 1; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry.location);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.geometry.viewport.northeast),\n L.latLng(loc.geometry.viewport.southwest)\n );\n results[i] = {\n name: loc.formatted_address,\n bbox: latLngBounds,\n center: latLng,\n properties: loc.address_components\n };\n }\n }\n\n cb.call(context, results);\n });\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n latlng: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng)\n };\n params = L.Util.extend(params, this.options.reverseQueryParams);\n if (this._key && this._key.length) {\n params.key = this._key;\n }\n\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.results && data.results.length) {\n for (var i = 0; i <= data.results.length - 1; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry.location);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.geometry.viewport.northeast),\n L.latLng(loc.geometry.viewport.southwest)\n );\n results[i] = {\n name: loc.formatted_address,\n bbox: latLngBounds,\n center: latLng,\n properties: loc.address_components\n };\n }\n }\n\n cb.call(context, results);\n });\n }\n});\n\nexport function google(key, options) {\n return new Google(key, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\nexport var HERE = L.Class.extend({\n options: {\n geocodeUrl: 'https://geocoder.api.here.com/6.2/geocode.json',\n reverseGeocodeUrl: 'https://reverse.geocoder.api.here.com/6.2/reversegeocode.json',\n app_id: '',\n app_code: '',\n geocodingQueryParams: {},\n reverseQueryParams: {},\n reverseGeocodeProxRadius: null\n },\n initialize: function(options) {\n L.setOptions(this, options);\n },\n geocode: function(query, cb, context) {\n var params = {\n searchtext: query,\n gen: 9,\n app_id: this.options.app_id,\n app_code: this.options.app_code,\n jsonattributes: 1\n };\n params = L.Util.extend(params, this.options.geocodingQueryParams);\n this.getJSON(this.options.geocodeUrl, params, cb, context);\n },\n reverse: function(location, scale, cb, context) {\n var _proxRadius = this.options.reverseGeocodeProxRadius\n ? this.options.reverseGeocodeProxRadius\n : null;\n var proxRadius = _proxRadius ? ',' + encodeURIComponent(_proxRadius) : '';\n var params = {\n prox: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng) + proxRadius,\n mode: 'retrieveAddresses',\n app_id: this.options.app_id,\n app_code: this.options.app_code,\n gen: 9,\n jsonattributes: 1\n };\n params = L.Util.extend(params, this.options.reverseQueryParams);\n this.getJSON(this.options.reverseGeocodeUrl, params, cb, context);\n },\n getJSON: function(url, params, cb, context) {\n getJSON(url, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.response.view && data.response.view.length) {\n for (var i = 0; i <= data.response.view[0].result.length - 1; i++) {\n loc = data.response.view[0].result[i].location;\n latLng = L.latLng(loc.displayPosition.latitude, loc.displayPosition.longitude);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.mapView.topLeft.latitude, loc.mapView.topLeft.longitude),\n L.latLng(loc.mapView.bottomRight.latitude, loc.mapView.bottomRight.longitude)\n );\n results[i] = {\n name: loc.address.label,\n properties: loc.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n cb.call(context, results);\n });\n }\n});\nexport function here(options) {\n return new HERE(options);\n}\n","import L from 'leaflet';\n\nexport var LatLng = L.Class.extend({\n options: {\n // the next geocoder to use\n next: undefined,\n sizeInMeters: 10000\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n var match;\n var center;\n // regex from https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/geocoder_controller.rb\n if ((match = query.match(/^([NS])\\s*(\\d{1,3}(?:\\.\\d*)?)\\W*([EW])\\s*(\\d{1,3}(?:\\.\\d*)?)$/))) {\n // [NSEW] decimal degrees\n center = L.latLng(\n (/N/i.test(match[1]) ? 1 : -1) * parseFloat(match[2]),\n (/E/i.test(match[3]) ? 1 : -1) * parseFloat(match[4])\n );\n } else if (\n (match = query.match(/^(\\d{1,3}(?:\\.\\d*)?)\\s*([NS])\\W*(\\d{1,3}(?:\\.\\d*)?)\\s*([EW])$/))\n ) {\n // decimal degrees [NSEW]\n center = L.latLng(\n (/N/i.test(match[2]) ? 1 : -1) * parseFloat(match[1]),\n (/E/i.test(match[4]) ? 1 : -1) * parseFloat(match[3])\n );\n } else if (\n (match = query.match(\n /^([NS])\\s*(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?\\W*([EW])\\s*(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?$/\n ))\n ) {\n // [NSEW] degrees, decimal minutes\n center = L.latLng(\n (/N/i.test(match[1]) ? 1 : -1) * (parseFloat(match[2]) + parseFloat(match[3] / 60)),\n (/E/i.test(match[4]) ? 1 : -1) * (parseFloat(match[5]) + parseFloat(match[6] / 60))\n );\n } else if (\n (match = query.match(\n /^(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?\\s*([NS])\\W*(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?\\s*([EW])$/\n ))\n ) {\n // degrees, decimal minutes [NSEW]\n center = L.latLng(\n (/N/i.test(match[3]) ? 1 : -1) * (parseFloat(match[1]) + parseFloat(match[2] / 60)),\n (/E/i.test(match[6]) ? 1 : -1) * (parseFloat(match[4]) + parseFloat(match[5] / 60))\n );\n } else if (\n (match = query.match(\n /^([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*)?)?[\"″]?$/\n ))\n ) {\n // [NSEW] degrees, minutes, decimal seconds\n center = L.latLng(\n (/N/i.test(match[1]) ? 1 : -1) *\n (parseFloat(match[2]) + parseFloat(match[3] / 60 + parseFloat(match[4] / 3600))),\n (/E/i.test(match[5]) ? 1 : -1) *\n (parseFloat(match[6]) + parseFloat(match[7] / 60) + parseFloat(match[8] / 3600))\n );\n } else if (\n (match = query.match(\n /^(\\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])$/\n ))\n ) {\n // degrees, minutes, decimal seconds [NSEW]\n center = L.latLng(\n (/N/i.test(match[4]) ? 1 : -1) *\n (parseFloat(match[1]) + parseFloat(match[2] / 60 + parseFloat(match[3] / 3600))),\n (/E/i.test(match[8]) ? 1 : -1) *\n (parseFloat(match[5]) + parseFloat(match[6] / 60) + parseFloat(match[7] / 3600))\n );\n } else if (\n (match = query.match(/^\\s*([+-]?\\d+(?:\\.\\d*)?)\\s*[\\s,]\\s*([+-]?\\d+(?:\\.\\d*)?)\\s*$/))\n ) {\n center = L.latLng(parseFloat(match[1]), parseFloat(match[2]));\n }\n if (center) {\n var results = [\n {\n name: query,\n center: center,\n bbox: center.toBounds(this.options.sizeInMeters)\n }\n ];\n cb.call(context, results);\n } else if (this.options.next) {\n this.options.next.geocode(query, cb, context);\n }\n }\n});\n\nexport function latLng(options) {\n return new LatLng(options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Mapbox = L.Class.extend({\n options: {\n serviceUrl: 'https://api.mapbox.com/geocoding/v5/mapbox.places/',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(accessToken, options) {\n L.setOptions(this, options);\n this.options.geocodingQueryParams.access_token = accessToken;\n this.options.reverseQueryParams.access_token = accessToken;\n },\n\n geocode: function(query, cb, context) {\n var params = this.options.geocodingQueryParams;\n if (\n params.proximity !== undefined &&\n params.proximity.lat !== undefined &&\n params.proximity.lng !== undefined\n ) {\n params.proximity = params.proximity.lng + ',' + params.proximity.lat;\n }\n getJSON(this.options.serviceUrl + encodeURIComponent(query) + '.json', params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.features && data.features.length) {\n for (var i = 0; i <= data.features.length - 1; i++) {\n loc = data.features[i];\n latLng = L.latLng(loc.center.reverse());\n if (loc.bbox) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.bbox.slice(0, 2).reverse()),\n L.latLng(loc.bbox.slice(2, 4).reverse())\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n\n var properties = {\n text: loc.text,\n address: loc.address\n };\n\n for (var j = 0; j < (loc.context || []).length; j++) {\n var id = loc.context[j].id.split('.')[0];\n properties[id] = loc.context[j].text;\n\n // Get country code when available\n if (loc.context[j].short_code) {\n properties['countryShortCode'] = loc.context[j].short_code\n }\n }\n\n results[i] = {\n name: loc.place_name,\n bbox: latLngBounds,\n center: latLng,\n properties: properties\n };\n }\n }\n\n cb.call(context, results);\n });\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl +\n encodeURIComponent(location.lng) +\n ',' +\n encodeURIComponent(location.lat) +\n '.json',\n this.options.reverseQueryParams,\n function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.features && data.features.length) {\n for (var i = 0; i <= data.features.length - 1; i++) {\n loc = data.features[i];\n latLng = L.latLng(loc.center.reverse());\n if (loc.bbox) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.bbox.slice(0, 2).reverse()),\n L.latLng(loc.bbox.slice(2, 4).reverse())\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results[i] = {\n name: loc.place_name,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }\n );\n }\n});\n\nexport function mapbox(accessToken, options) {\n return new Mapbox(accessToken, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var MapQuest = L.Class.extend({\n options: {\n serviceUrl: 'https://www.mapquestapi.com/geocoding/v1'\n },\n\n initialize: function(key, options) {\n // MapQuest seems to provide URI encoded API keys,\n // so to avoid encoding them twice, we decode them here\n this._key = decodeURIComponent(key);\n\n L.Util.setOptions(this, options);\n },\n\n _formatName: function() {\n var r = [],\n i;\n for (i = 0; i < arguments.length; i++) {\n if (arguments[i]) {\n r.push(arguments[i]);\n }\n }\n\n return r.join(', ');\n },\n\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + '/address',\n {\n key: this._key,\n location: query,\n limit: 5,\n outFormat: 'json'\n },\n L.bind(function(data) {\n var results = [],\n loc,\n latLng;\n if (data.results && data.results[0].locations) {\n for (var i = data.results[0].locations.length - 1; i >= 0; i--) {\n loc = data.results[0].locations[i];\n latLng = L.latLng(loc.latLng);\n results[i] = {\n name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1),\n bbox: L.latLngBounds(latLng, latLng),\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + '/reverse',\n {\n key: this._key,\n location: location.lat + ',' + location.lng,\n outputFormat: 'json'\n },\n L.bind(function(data) {\n var results = [],\n loc,\n latLng;\n if (data.results && data.results[0].locations) {\n for (var i = data.results[0].locations.length - 1; i >= 0; i--) {\n loc = data.results[0].locations[i];\n latLng = L.latLng(loc.latLng);\n results[i] = {\n name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1),\n bbox: L.latLngBounds(latLng, latLng),\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }, this)\n );\n }\n});\n\nexport function mapQuest(key, options) {\n return new MapQuest(key, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Neutrino = L.Class.extend({\n options: {\n userId: '',\n apiKey: '',\n serviceUrl: 'https://neutrinoapi.com/'\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n // https://www.neutrinoapi.com/api/geocode-address/\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + 'geocode-address',\n {\n apiKey: this.options.apiKey,\n userId: this.options.userId,\n //get three words and make a dot based string\n address: query.split(/\\s+/).join('.')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.locations) {\n data.geometry = data.locations[0];\n latLng = L.latLng(data.geometry['latitude'], data.geometry['longitude']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.geometry.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n // https://www.neutrinoapi.com/api/geocode-reverse/\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'geocode-reverse',\n {\n apiKey: this.options.apiKey,\n userId: this.options.userId,\n latitude: location.lat,\n longitude: location.lng\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.status.status == 200 && data.found) {\n latLng = L.latLng(location.lat, location.lng);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n cb.call(context, results);\n }\n );\n }\n});\n\nexport function neutrino(accessToken) {\n return new Neutrino(accessToken);\n}\n","import L from 'leaflet';\nimport { template, getJSON } from '../util';\n\nexport var Nominatim = L.Class.extend({\n options: {\n serviceUrl: 'https://nominatim.openstreetmap.org/',\n geocodingQueryParams: {},\n reverseQueryParams: {},\n htmlTemplate: function(r) {\n var a = r.address,\n className,\n parts = [];\n if (a.road || a.building) {\n parts.push('{building} {road} {house_number}');\n }\n\n if (a.city || a.town || a.village || a.hamlet) {\n className = parts.length > 0 ? 'leaflet-control-geocoder-address-detail' : '';\n parts.push(\n '{postcode} {city} {town} {village} {hamlet}'\n );\n }\n\n if (a.state || a.country) {\n className = parts.length > 0 ? 'leaflet-control-geocoder-address-context' : '';\n parts.push('{state} {country}');\n }\n\n return template(parts.join('
'), a, true);\n }\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + 'search',\n L.extend(\n {\n q: query,\n limit: 5,\n format: 'json',\n addressdetails: 1\n },\n this.options.geocodingQueryParams\n ),\n L.bind(function(data) {\n var results = [];\n for (var i = data.length - 1; i >= 0; i--) {\n var bbox = data[i].boundingbox;\n for (var j = 0; j < 4; j++) bbox[j] = parseFloat(bbox[j]);\n results[i] = {\n icon: data[i].icon,\n name: data[i].display_name,\n html: this.options.htmlTemplate ? this.options.htmlTemplate(data[i]) : undefined,\n bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]),\n center: L.latLng(data[i].lat, data[i].lon),\n properties: data[i]\n };\n }\n cb.call(context, results);\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'reverse',\n L.extend(\n {\n lat: location.lat,\n lon: location.lng,\n zoom: Math.round(Math.log(scale / 256) / Math.log(2)),\n addressdetails: 1,\n format: 'json'\n },\n this.options.reverseQueryParams\n ),\n L.bind(function(data) {\n var result = [],\n loc;\n\n if (data && data.lat && data.lon) {\n loc = L.latLng(data.lat, data.lon);\n result.push({\n name: data.display_name,\n html: this.options.htmlTemplate ? this.options.htmlTemplate(data) : undefined,\n center: loc,\n bounds: L.latLngBounds(loc, loc),\n properties: data\n });\n }\n\n cb.call(context, result);\n }, this)\n );\n }\n});\n\nexport function nominatim(options) {\n return new Nominatim(options);\n}\n","import L from 'leaflet';\n\nexport var OpenLocationCode = L.Class.extend({\n options: {\n OpenLocationCode: undefined,\n codeLength: undefined\n },\n\n initialize: function(options) {\n L.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n try {\n var decoded = this.options.OpenLocationCode.decode(query);\n var result = {\n name: query,\n center: L.latLng(decoded.latitudeCenter, decoded.longitudeCenter),\n bbox: L.latLngBounds(\n L.latLng(decoded.latitudeLo, decoded.longitudeLo),\n L.latLng(decoded.latitudeHi, decoded.longitudeHi)\n )\n };\n cb.call(context, [result]);\n } catch (e) {\n console.warn(e); // eslint-disable-line no-console\n cb.call(context, []);\n }\n },\n reverse: function(location, scale, cb, context) {\n try {\n var code = this.options.OpenLocationCode.encode(\n location.lat,\n location.lng,\n this.options.codeLength\n );\n var result = {\n name: code,\n center: L.latLng(location.lat, location.lng),\n bbox: L.latLngBounds(\n L.latLng(location.lat, location.lng),\n L.latLng(location.lat, location.lng)\n )\n };\n cb.call(context, [result]);\n } catch (e) {\n console.warn(e); // eslint-disable-line no-console\n cb.call(context, []);\n }\n }\n});\n\nexport function openLocationCode(options) {\n return new OpenLocationCode(options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var OpenCage = L.Class.extend({\n options: {\n serviceUrl: 'https://api.opencagedata.com/geocode/v1/json',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(apiKey, options) {\n L.setOptions(this, options);\n this._accessToken = apiKey;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n key: this._accessToken,\n q: query\n };\n params = L.extend(params, this.options.geocodingQueryParams);\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n latLng,\n latLngBounds,\n loc;\n if (data.results && data.results.length) {\n for (var i = 0; i < data.results.length; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry);\n if (loc.annotations && loc.annotations.bounds) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.annotations.bounds.northeast),\n L.latLng(loc.annotations.bounds.southwest)\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results.push({\n name: loc.formatted,\n bbox: latLngBounds,\n center: latLng\n });\n }\n }\n cb.call(context, results);\n });\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n key: this._accessToken,\n q: [location.lat, location.lng].join(',')\n };\n params = L.extend(params, this.options.reverseQueryParams);\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n latLng,\n latLngBounds,\n loc;\n if (data.results && data.results.length) {\n for (var i = 0; i < data.results.length; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry);\n if (loc.annotations && loc.annotations.bounds) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.annotations.bounds.northeast),\n L.latLng(loc.annotations.bounds.southwest)\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results.push({\n name: loc.formatted,\n bbox: latLngBounds,\n center: latLng\n });\n }\n }\n cb.call(context, results);\n });\n }\n});\n\nexport function opencage(apiKey, options) {\n return new OpenCage(apiKey, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Pelias = L.Class.extend({\n options: {\n serviceUrl: 'https://api.geocode.earth/v1',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(apiKey, options) {\n L.Util.setOptions(this, options);\n this._apiKey = apiKey;\n this._lastSuggest = 0;\n },\n\n geocode: function(query, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/search',\n L.extend(\n {\n api_key: this._apiKey,\n text: query\n },\n this.options.geocodingQueryParams\n ),\n function(data) {\n cb.call(context, _this._parseResults(data, 'bbox'));\n }\n );\n },\n\n suggest: function(query, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/autocomplete',\n L.extend(\n {\n api_key: this._apiKey,\n text: query\n },\n this.options.geocodingQueryParams\n ),\n L.bind(function(data) {\n if (data.geocoding.timestamp > this._lastSuggest) {\n this._lastSuggest = data.geocoding.timestamp;\n cb.call(context, _this._parseResults(data, 'bbox'));\n }\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/reverse',\n L.extend(\n {\n api_key: this._apiKey,\n 'point.lat': location.lat,\n 'point.lon': location.lng\n },\n this.options.reverseQueryParams\n ),\n function(data) {\n cb.call(context, _this._parseResults(data, 'bounds'));\n }\n );\n },\n\n _parseResults: function(data, bboxname) {\n var results = [];\n L.geoJson(data, {\n pointToLayer: function(feature, latlng) {\n return L.circleMarker(latlng);\n },\n onEachFeature: function(feature, layer) {\n var result = {},\n bbox,\n center;\n\n if (layer.getBounds) {\n bbox = layer.getBounds();\n center = bbox.getCenter();\n } else if (layer.feature.bbox) {\n center = layer.getLatLng();\n bbox = L.latLngBounds(\n L.GeoJSON.coordsToLatLng(layer.feature.bbox.slice(0, 2)),\n L.GeoJSON.coordsToLatLng(layer.feature.bbox.slice(2, 4))\n );\n } else {\n center = layer.getLatLng();\n bbox = L.latLngBounds(center, center);\n }\n\n result.name = layer.feature.properties.label;\n result.center = center;\n result[bboxname] = bbox;\n result.properties = layer.feature.properties;\n results.push(result);\n }\n });\n return results;\n }\n});\n\nexport function pelias(apiKey, options) {\n return new Pelias(apiKey, options);\n}\nexport var GeocodeEarth = Pelias;\nexport var geocodeEarth = pelias;\n\nexport var Mapzen = Pelias; // r.i.p.\nexport var mapzen = pelias;\n\nexport var Openrouteservice = Mapzen.extend({\n options: {\n serviceUrl: 'https://api.openrouteservice.org/geocode'\n }\n});\nexport function openrouteservice(apiKey, options) {\n return new Openrouteservice(apiKey, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Photon = L.Class.extend({\n options: {\n serviceUrl: 'https://photon.komoot.de/api/',\n reverseUrl: 'https://photon.komoot.de/reverse/',\n nameProperties: ['name', 'street', 'suburb', 'hamlet', 'town', 'city', 'state', 'country']\n },\n\n initialize: function(options) {\n L.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n var params = L.extend(\n {\n q: query\n },\n this.options.geocodingQueryParams\n );\n\n getJSON(\n this.options.serviceUrl,\n params,\n L.bind(function(data) {\n cb.call(context, this._decodeFeatures(data));\n }, this)\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(latLng, scale, cb, context) {\n var params = L.extend(\n {\n lat: latLng.lat,\n lon: latLng.lng\n },\n this.options.reverseQueryParams\n );\n\n getJSON(\n this.options.reverseUrl,\n params,\n L.bind(function(data) {\n cb.call(context, this._decodeFeatures(data));\n }, this)\n );\n },\n\n _decodeFeatures: function(data) {\n var results = [],\n i,\n f,\n c,\n latLng,\n extent,\n bbox;\n\n if (data && data.features) {\n for (i = 0; i < data.features.length; i++) {\n f = data.features[i];\n c = f.geometry.coordinates;\n latLng = L.latLng(c[1], c[0]);\n extent = f.properties.extent;\n\n if (extent) {\n bbox = L.latLngBounds([extent[1], extent[0]], [extent[3], extent[2]]);\n } else {\n bbox = L.latLngBounds(latLng, latLng);\n }\n\n results.push({\n name: this._decodeFeatureName(f),\n html: this.options.htmlTemplate ? this.options.htmlTemplate(f) : undefined,\n center: latLng,\n bbox: bbox,\n properties: f.properties\n });\n }\n }\n\n return results;\n },\n\n _decodeFeatureName: function(f) {\n return (this.options.nameProperties || [])\n .map(function(p) {\n return f.properties[p];\n })\n .filter(function(v) {\n return !!v;\n })\n .join(', ');\n }\n});\n\nexport function photon(options) {\n return new Photon(options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var What3Words = L.Class.extend({\n options: {\n serviceUrl: 'https://api.what3words.com/v2/'\n },\n\n initialize: function(accessToken) {\n this._accessToken = accessToken;\n },\n\n geocode: function(query, cb, context) {\n //get three words and make a dot based string\n getJSON(\n this.options.serviceUrl + 'forward',\n {\n key: this._accessToken,\n addr: query.split(/\\s+/).join('.')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.geometry) {\n latLng = L.latLng(data.geometry['lat'], data.geometry['lng']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.words,\n bbox: latLngBounds,\n center: latLng\n };\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'reverse',\n {\n key: this._accessToken,\n coords: [location.lat, location.lng].join(',')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.status.status == 200) {\n latLng = L.latLng(data.geometry['lat'], data.geometry['lng']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.words,\n bbox: latLngBounds,\n center: latLng\n };\n }\n cb.call(context, results);\n }\n );\n }\n});\n\nexport function what3words(accessToken) {\n return new What3Words(accessToken);\n}\n","import L from 'leaflet';\nimport { Nominatim } from './geocoders/index';\n\nexport var Geocoder = L.Control.extend({\n options: {\n showUniqueResult: true,\n showResultIcons: false,\n collapsed: true,\n expand: 'touch', // options: touch, click, anythingelse\n position: 'topright',\n placeholder: 'Search...',\n errorMessage: 'Nothing found.',\n iconLabel: 'Initiate a new search',\n queryMinLength: 1,\n suggestMinLength: 3,\n suggestTimeout: 250,\n defaultMarkGeocode: true\n },\n\n includes: L.Evented.prototype || L.Mixin.Events,\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n if (!this.options.geocoder) {\n this.options.geocoder = new Nominatim();\n }\n\n this._requestCount = 0;\n },\n\n addThrobberClass: function() {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber');\n },\n\n removeThrobberClass: function() {\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-throbber');\n },\n\n onAdd: function(map) {\n var className = 'leaflet-control-geocoder',\n container = L.DomUtil.create('div', className + ' leaflet-bar'),\n icon = L.DomUtil.create('button', className + '-icon', container),\n form = (this._form = L.DomUtil.create('div', className + '-form', container)),\n input;\n\n this._map = map;\n this._container = container;\n\n icon.innerHTML = ' ';\n icon.type = 'button';\n icon.setAttribute('aria-label', this.options.iconLabel);\n\n input = this._input = L.DomUtil.create('input', '', form);\n input.type = 'text';\n input.value = this.options.query || '';\n input.placeholder = this.options.placeholder;\n L.DomEvent.disableClickPropagation(input);\n\n this._errorElement = L.DomUtil.create('div', className + '-form-no-error', container);\n this._errorElement.innerHTML = this.options.errorMessage;\n\n this._alts = L.DomUtil.create(\n 'ul',\n className + '-alternatives leaflet-control-geocoder-alternatives-minimized',\n container\n );\n L.DomEvent.disableClickPropagation(this._alts);\n\n L.DomEvent.addListener(input, 'keydown', this._keydown, this);\n if (this.options.geocoder.suggest) {\n L.DomEvent.addListener(input, 'input', this._change, this);\n }\n L.DomEvent.addListener(\n input,\n 'blur',\n function() {\n if (this.options.collapsed && !this._preventBlurCollapse) {\n this._collapse();\n }\n this._preventBlurCollapse = false;\n },\n this\n );\n\n if (this.options.collapsed) {\n if (this.options.expand === 'click') {\n L.DomEvent.addListener(\n container,\n 'click',\n function(e) {\n if (e.button === 0 && e.detail !== 2) {\n this._toggle();\n }\n },\n this\n );\n } else if (this.options.expand === 'touch') {\n L.DomEvent.addListener(\n container,\n L.Browser.touch ? 'touchstart mousedown' : 'mousedown',\n function(e) {\n this._toggle();\n e.preventDefault(); // mobile: clicking focuses the icon, so UI expands and immediately collapses\n e.stopPropagation();\n },\n this\n );\n } else {\n L.DomEvent.addListener(container, 'mouseover', this._expand, this);\n L.DomEvent.addListener(container, 'mouseout', this._collapse, this);\n this._map.on('movestart', this._collapse, this);\n }\n } else {\n this._expand();\n if (L.Browser.touch) {\n L.DomEvent.addListener(\n container,\n 'touchstart',\n function() {\n this._geocode();\n },\n this\n );\n } else {\n L.DomEvent.addListener(\n container,\n 'click',\n function() {\n this._geocode();\n },\n this\n );\n }\n }\n\n if (this.options.defaultMarkGeocode) {\n this.on('markgeocode', this.markGeocode, this);\n }\n\n this.on('startgeocode', this.addThrobberClass, this);\n this.on('finishgeocode', this.removeThrobberClass, this);\n this.on('startsuggest', this.addThrobberClass, this);\n this.on('finishsuggest', this.removeThrobberClass, this);\n\n L.DomEvent.disableClickPropagation(container);\n\n return container;\n },\n\n setQuery: function(string) {\n this._input.value = string;\n return this;\n },\n\n _geocodeResult: function(results, suggest) {\n if (!suggest && this.options.showUniqueResult && results.length === 1) {\n this._geocodeResultSelected(results[0]);\n } else if (results.length > 0) {\n this._alts.innerHTML = '';\n this._results = results;\n L.DomUtil.removeClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-options-open');\n for (var i = 0; i < results.length; i++) {\n this._alts.appendChild(this._createAlt(results[i], i));\n }\n } else {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-options-error');\n L.DomUtil.addClass(this._errorElement, 'leaflet-control-geocoder-error');\n }\n },\n\n markGeocode: function(result) {\n result = result.geocode || result;\n\n this._map.fitBounds(result.bbox);\n\n if (this._geocodeMarker) {\n this._map.removeLayer(this._geocodeMarker);\n }\n\n this._geocodeMarker = new L.Marker(result.center)\n .bindPopup(result.html || result.name)\n .addTo(this._map)\n .openPopup();\n\n return this;\n },\n\n _geocode: function(suggest) {\n var value = this._input.value;\n if (!suggest && value.length < this.options.queryMinLength) {\n return;\n }\n\n var requestCount = ++this._requestCount,\n mode = suggest ? 'suggest' : 'geocode',\n eventData = { input: value };\n\n this._lastGeocode = value;\n if (!suggest) {\n this._clearResults();\n }\n\n this.fire('start' + mode, eventData);\n this.options.geocoder[mode](\n value,\n function(results) {\n if (requestCount === this._requestCount) {\n eventData.results = results;\n this.fire('finish' + mode, eventData);\n this._geocodeResult(results, suggest);\n }\n },\n this\n );\n },\n\n _geocodeResultSelected: function(result) {\n this.fire('markgeocode', { geocode: result });\n },\n\n _toggle: function() {\n if (L.DomUtil.hasClass(this._container, 'leaflet-control-geocoder-expanded')) {\n this._collapse();\n } else {\n this._expand();\n }\n },\n\n _expand: function() {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-expanded');\n this._input.select();\n this.fire('expand');\n },\n\n _collapse: function() {\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-expanded');\n L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-open');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-error');\n this._input.blur(); // mobile: keyboard shouldn't stay expanded\n this.fire('collapse');\n },\n\n _clearResults: function() {\n L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n this._selection = null;\n L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-open');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-error');\n },\n\n _createAlt: function(result, index) {\n var li = L.DomUtil.create('li', ''),\n a = L.DomUtil.create('a', '', li),\n icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null,\n text = result.html ? undefined : document.createTextNode(result.name),\n mouseDownHandler = function mouseDownHandler(e) {\n // In some browsers, a click will fire on the map if the control is\n // collapsed directly after mousedown. To work around this, we\n // wait until the click is completed, and _then_ collapse the\n // control. Messy, but this is the workaround I could come up with\n // for #142.\n this._preventBlurCollapse = true;\n L.DomEvent.stop(e);\n this._geocodeResultSelected(result);\n L.DomEvent.on(\n li,\n 'click touchend',\n function() {\n if (this.options.collapsed) {\n this._collapse();\n } else {\n this._clearResults();\n }\n },\n this\n );\n };\n\n if (icon) {\n icon.src = result.icon;\n }\n\n li.setAttribute('data-result-index', index);\n\n if (result.html) {\n a.innerHTML = a.innerHTML + result.html;\n } else {\n a.appendChild(text);\n }\n\n // Use mousedown and not click, since click will fire _after_ blur,\n // causing the control to have collapsed and removed the items\n // before the click can fire.\n L.DomEvent.addListener(li, 'mousedown touchstart', mouseDownHandler, this);\n\n return li;\n },\n\n _keydown: function(e) {\n var _this = this,\n select = function select(dir) {\n if (_this._selection) {\n L.DomUtil.removeClass(_this._selection, 'leaflet-control-geocoder-selected');\n _this._selection = _this._selection[dir > 0 ? 'nextSibling' : 'previousSibling'];\n }\n if (!_this._selection) {\n _this._selection = _this._alts[dir > 0 ? 'firstChild' : 'lastChild'];\n }\n\n if (_this._selection) {\n L.DomUtil.addClass(_this._selection, 'leaflet-control-geocoder-selected');\n }\n };\n\n switch (e.keyCode) {\n // Escape\n case 27:\n if (this.options.collapsed) {\n this._collapse();\n } else {\n this._clearResults();\n }\n break;\n // Up\n case 38:\n select(-1);\n break;\n // Up\n case 40:\n select(1);\n break;\n // Enter\n case 13:\n if (this._selection) {\n var index = parseInt(this._selection.getAttribute('data-result-index'), 10);\n this._geocodeResultSelected(this._results[index]);\n this._clearResults();\n } else {\n this._geocode();\n }\n break;\n default:\n return;\n }\n\n L.DomEvent.preventDefault(e);\n },\n _change: function() {\n var v = this._input.value;\n if (v !== this._lastGeocode) {\n clearTimeout(this._suggestTimeout);\n if (v.length >= this.options.suggestMinLength) {\n this._suggestTimeout = setTimeout(\n L.bind(function() {\n this._geocode(true);\n }, this),\n this.options.suggestTimeout\n );\n } else {\n this._clearResults();\n }\n }\n }\n});\n\nexport function geocoder(options) {\n return new Geocoder(options);\n}\n","import L from 'leaflet';\nimport { Geocoder, geocoder } from './control';\nimport * as geocoders from './geocoders/index';\n\nL.Util.extend(Geocoder, geocoders);\nexport default Geocoder;\n\nL.Util.extend(L.Control, {\n Geocoder: Geocoder,\n geocoder: geocoder\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;EACA,IAAI,cAAc,GAAG,CAAC,CAAC;;EAEvB;EACA;EACA,IAAI,QAAQ,GAAG,WAAW,CAAC;EAC3B,IAAI,QAAQ,GAAG,UAAU,CAAC;EAC1B,IAAI,MAAM,GAAG;EACb,EAAE,GAAG,EAAE,OAAO;EACd,EAAE,GAAG,EAAE,MAAM;EACb,EAAE,GAAG,EAAE,MAAM;EACb,EAAE,GAAG,EAAE,QAAQ;EACf,EAAE,GAAG,EAAE,QAAQ;EACf,EAAE,GAAG,EAAE,QAAQ;EACf,CAAC,CAAC;;EAEF,SAAS,UAAU,CAAC,GAAG,EAAE;EACzB,EAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;EACrB,CAAC;;AAED,EAAO,SAAS,UAAU,CAAC,MAAM,EAAE;EACnC,EAAE,IAAI,MAAM,IAAI,I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,CAAC;;EC9WD,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AACnC,AACA;EACA,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE;EACzB,EAAE,QAAQ,EAAE,QAAQ;EACpB,EAAE,QAAQ,EAAE,QAAQ;EACpB,CAAC,CAAC,CAAC;;;;;;;;"} \ No newline at end of file diff --git a/assets/control-geocoder/Control.Geocoder.min.js b/assets/control-geocoder/Control.Geocoder.min.js index c6d1b35..3c5c4ff 100644 --- a/assets/control-geocoder/Control.Geocoder.min.js +++ b/assets/control-geocoder/Control.Geocoder.min.js @@ -1 +1,10 @@ -this.L=this.L||{},this.L.Control=this.L.Control||{},this.L.Control.Geocoder=function(l){"use strict";l=l&&l.hasOwnProperty("default")?l.default:l;var a=0,i=/[&<>"'`]/g,r=/[&<>"'`]/,t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};function c(e){return t[e]}function o(e,t,o,s,n){var i="_l_geocoder_"+a++;t[n||"callback"]=i,window[i]=l.Util.bind(o,s);var r=document.createElement("script");r.type="text/javascript",r.src=e+l.Util.getParamString(t),r.id=i,document.getElementsByTagName("head")[0].appendChild(r)}function d(e,t,o){var s=new XMLHttpRequest;s.onreadystatechange=function(){4===s.readyState&&(200===s.status||304===s.status?o(JSON.parse(s.response)):o(""))},s.open("GET",e+l.Util.getParamString(t),!0),s.setRequestHeader("Accept","application/json"),s.send(null)}function s(e,n){return e.replace(/\{ *([\w_]+) *\}/g,function(e,t){var o,s=n[t];return void 0===s?s="":"function"==typeof s&&(s=s(n)),null==(o=s)?"":o?(o=""+o,r.test(o)?o.replace(i,c):o):o+""})}var n={class:l.Class.extend({options:{serviceUrl:"https://nominatim.openstreetmap.org/",geocodingQueryParams:{},reverseQueryParams:{},htmlTemplate:function(e){var t=e.address,o=[];return(t.road||t.building)&&o.push("{building} {road} {house_number}"),(t.city||t.town||t.village||t.hamlet)&&o.push('{postcode} {city} {town} {village} {hamlet}'),(t.state||t.country)&&o.push('{state} {country}'),s(o.join("
"),t)}},initialize:function(e){l.Util.setOptions(this,e)},geocode:function(e,i,r){d(this.options.serviceUrl+"search",l.extend({q:e,limit:5,format:"json",addressdetails:1},this.options.geocodingQueryParams),l.bind(function(e){for(var t=[],o=e.length-1;0<=o;o--){for(var s=e[o].boundingbox,n=0;n<4;n++)s[n]=parseFloat(s[n]);t[o]={icon:e[o].icon,name:e[o].display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(e[o]):void 0,bbox:l.latLngBounds([s[0],s[2]],[s[1],s[3]]),center:l.latLng(e[o].lat,e[o].lon),properties:e[o]}}i.call(r,t)},this))},reverse:function(e,t,s,n){d(this.options.serviceUrl+"reverse",l.extend({lat:e.lat,lon:e.lng,zoom:Math.round(Math.log(t/256)/Math.log(2)),addressdetails:1,format:"json"},this.options.reverseQueryParams),l.bind(function(e){var t,o=[];e&&e.lat&&e.lon&&(t=l.latLng(e.lat,e.lon),o.push({name:e.display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(e):void 0,center:t,bounds:l.latLngBounds(t,t),properties:e})),s.call(n,o)},this))}}),factory:function(e){return new l.Control.Geocoder.Nominatim(e)}},e={class:l.Control.extend({options:{showResultIcons:!1,collapsed:!0,expand:"touch",position:"topright",placeholder:"Search...",errorMessage:"Nothing found.",suggestMinLength:3,suggestTimeout:250,defaultMarkGeocode:!0},includes:l.Evented.prototype||l.Mixin.Events,initialize:function(e){l.Util.setOptions(this,e),this.options.geocoder||(this.options.geocoder=new n.class),this._requestCount=0},onAdd:function(e){var t,o="leaflet-control-geocoder",s=l.DomUtil.create("div",o+" leaflet-bar"),n=l.DomUtil.create("button",o+"-icon",s),i=this._form=l.DomUtil.create("div",o+"-form",s);return this._map=e,this._container=s,n.innerHTML=" ",n.type="button",(t=this._input=l.DomUtil.create("input","",i)).type="text",t.placeholder=this.options.placeholder,this._errorElement=l.DomUtil.create("div",o+"-form-no-error",s),this._errorElement.innerHTML=this.options.errorMessage,this._alts=l.DomUtil.create("ul",o+"-alternatives leaflet-control-geocoder-alternatives-minimized",s),l.DomEvent.disableClickPropagation(this._alts),l.DomEvent.addListener(t,"keydown",this._keydown,this),this.options.geocoder.suggest&&l.DomEvent.addListener(t,"input",this._change,this),l.DomEvent.addListener(t,"blur",function(){this.options.collapsed&&!this._preventBlurCollapse&&this._collapse(),this._preventBlurCollapse=!1},this),this.options.collapsed?"click"===this.options.expand?l.DomEvent.addListener(s,"click",function(e){0===e.button&&2!==e.detail&&this._toggle()},this):l.Browser.touch&&"touch"===this.options.expand?l.DomEvent.addListener(s,"touchstart mousedown",function(e){this._toggle(),e.preventDefault(),e.stopPropagation()},this):(l.DomEvent.addListener(s,"mouseover",this._expand,this),l.DomEvent.addListener(s,"mouseout",this._collapse,this),this._map.on("movestart",this._collapse,this)):(this._expand(),l.Browser.touch?l.DomEvent.addListener(s,"touchstart",function(){this._geocode()},this):l.DomEvent.addListener(s,"click",function(){this._geocode()},this)),this.options.defaultMarkGeocode&&this.on("markgeocode",this.markGeocode,this),this.on("startgeocode",function(){l.DomUtil.addClass(this._container,"leaflet-control-geocoder-throbber")},this),this.on("finishgeocode",function(){l.DomUtil.removeClass(this._container,"leaflet-control-geocoder-throbber")},this),l.DomEvent.disableClickPropagation(s),s},_geocodeResult:function(e,t){if(t||1!==e.length)if(0=this.options.suggestMinLength?this._suggestTimeout=setTimeout(l.bind(function(){this._geocode(!0)},this),this.options.suggestTimeout):this._clearResults())}}),factory:function(e){return new l.Control.Geocoder(e)}},u={class:l.Class.extend({initialize:function(e){this.key=e},geocode:function(e,i,r){o("https://dev.virtualearth.net/REST/v1/Locations",{query:e,key:this.key},function(e){var t=[];if(0this._lastSuggest&&(this._lastSuggest=e.geocoding.timestamp,t.call(o,s._parseResults(e,"bbox")))},this))},reverse:function(e,t,o,s){var n=this;d(this.options.serviceUrl+"/reverse",l.extend({api_key:this._apiKey,"point.lat":e.lat,"point.lon":e.lng},this.options.reverseQueryParams),function(e){o.call(s,n._parseResults(e,"bounds"))})},_parseResults:function(e,i){var r=[];return l.geoJson(e,{pointToLayer:function(e,t){return l.circleMarker(t)},onEachFeature:function(e,t){var o,s,n={};t.getBounds?s=(o=t.getBounds()).getCenter():(s=t.getLatLng(),o=l.latLngBounds(s,s)),n.name=t.feature.properties.label,n.center=s,n[i]=o,n.properties=t.feature.properties,r.push(n)}}),r}}),factory:function(e,t){return new l.Control.Geocoder.Mapzen(e,t)}},_={class:l.Class.extend({options:{service_url:"http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"},initialize:function(e,t){l.setOptions(this,t),this._accessToken=e},geocode:function(e,r,a){var t={SingleLine:e,outFields:"Addr_Type",forStorage:!1,maxLocations:10,f:"json"};this._key&&this._key.length&&(t.token=this._key),d(this.options.service_url+"/findAddressCandidates",t,function(e){var t,o,s,n=[];if(e.candidates&&e.candidates.length)for(var i=0;i<=e.candidates.length-1;i++)t=e.candidates[i],o=l.latLng(t.location.y,t.location.x),s=l.latLngBounds(l.latLng(t.extent.ymax,t.extent.xmax),l.latLng(t.extent.ymin,t.extent.xmin)),n[i]={name:t.address,bbox:s,center:o};r.call(a,n)})},suggest:function(e,t,o){return this.geocode(e,t,o)},reverse:function(e,t,s,n){var o={location:encodeURIComponent(e.lng)+","+encodeURIComponent(e.lat),distance:100,f:"json"};d(this.options.service_url+"/reverseGeocode",o,function(e){var t,o=[];e&&!e.error&&(t=l.latLng(e.location.y,e.location.x),o.push({name:e.address.Match_addr,center:t,bounds:l.latLngBounds(t,t)})),s.call(n,o)})}}),factory:function(e,t){return new l.Control.Geocoder.ArcGis(e,t)}},y={class:l.Class.extend({options:{geocodeUrl:"http://geocoder.api.here.com/6.2/geocode.json",reverseGeocodeUrl:"http://reverse.geocoder.api.here.com/6.2/reversegeocode.json",app_id:"",app_code:"",geocodingQueryParams:{},reverseQueryParams:{}},initialize:function(e){l.setOptions(this,e)},geocode:function(e,t,o){var s={searchtext:e,gen:9,app_id:this.options.app_id,app_code:this.options.app_code,jsonattributes:1};s=l.Util.extend(s,this.options.geocodingQueryParams),this.getJSON(this.options.geocodeUrl,s,t,o)},reverse:function(e,t,o,s){var n={prox:encodeURIComponent(e.lat)+","+encodeURIComponent(e.lng),mode:"retrieveAddresses",app_id:this.options.app_id,app_code:this.options.app_code,gen:9,jsonattributes:1};n=l.Util.extend(n,this.options.reverseQueryParams),this.getJSON(this.options.reverseGeocodeUrl,n,o,s)},getJSON:function(e,t,r,a){d(e,t,function(e){var t,o,s,n=[];if(e.response.view&&e.response.view.length)for(var i=0;i<=e.response.view[0].result.length-1;i++)t=e.response.view[0].result[i].location,o=l.latLng(t.displayPosition.latitude,t.displayPosition.longitude),s=l.latLngBounds(l.latLng(t.mapView.topLeft.latitude,t.mapView.topLeft.longitude),l.latLng(t.mapView.bottomRight.latitude,t.mapView.bottomRight.longitude)),n[i]={name:t.address.label,bbox:s,center:o};r.call(a,n)})}}),factory:function(e){return new l.Control.Geocoder.HERE(e)}},b=l.Util.extend(e.class,{Nominatim:n.class,nominatim:n.factory,Bing:u.class,bing:u.factory,MapQuest:h.class,mapQuest:h.factory,Mapbox:p.class,mapbox:p.factory,What3Words:g.class,what3words:g.factory,Google:m.class,google:m.factory,Photon:f.class,photon:f.factory,Mapzen:v.class,mapzen:v.factory,ArcGis:_.class,arcgis:_.factory,HERE:y.class,here:y.factory});return l.Util.extend(l.Control,{Geocoder:b,geocoder:e.factory}),b}(L); \ No newline at end of file +/* @preserve + * Leaflet Control Geocoder 1.13.0 + * https://github.com/perliedman/leaflet-control-geocoder + * + * Copyright (c) 2012 sa3m (https://github.com/sa3m) + * Copyright (c) 2018 Per Liedman + * All rights reserved. + */ +this.L=this.L||{},this.L.Control=this.L.Control||{},this.L.Control.Geocoder=function(d){"use strict";d=d&&d.hasOwnProperty("default")?d.default:d;var a=0,i=/[&<>"'`]/g,r=/[&<>"'`]/,t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};function l(e){return t[e]}function o(e,t,o,s,n){var i="_l_geocoder_"+a++;t[n||"callback"]=i,window[i]=d.Util.bind(o,s);var r=document.createElement("script");r.type="text/javascript",r.src=e+c(t),r.id=i,document.getElementsByTagName("head")[0].appendChild(r)}function u(e,t,o){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(4===s.readyState){var t;if(200!==s.status&&304!==s.status)t="";else if("string"==typeof s.response)try{t=JSON.parse(s.response)}catch(e){t=s.response}else t=s.response;o(t)}},s.open("GET",e+c(t),!0),s.responseType="json",s.setRequestHeader("Accept","application/json"),s.send(null)}function n(e,n){return e.replace(/\{ *([\w_]+) *\}/g,function(e,t){var o,s=n[t];return void 0===s?s="":"function"==typeof s&&(s=s(n)),null==(o=s)?"":o?(o=""+o,r.test(o)?o.replace(i,l):o):o+""})}function c(e,t,o){var s=[];for(var n in e){var i=encodeURIComponent(o?n.toUpperCase():n),r=e[n];if(d.Util.isArray(r))for(var a=0;a",app_code:"",geocodingQueryParams:{},reverseQueryParams:{},reverseGeocodeProxRadius:null},initialize:function(e){d.setOptions(this,e)},geocode:function(e,t,o){var s={searchtext:e,gen:9,app_id:this.options.app_id,app_code:this.options.app_code,jsonattributes:1};s=d.Util.extend(s,this.options.geocodingQueryParams),this.getJSON(this.options.geocodeUrl,s,t,o)},reverse:function(e,t,o,s){var n=this.options.reverseGeocodeProxRadius?this.options.reverseGeocodeProxRadius:null,i=n?","+encodeURIComponent(n):"",r={prox:encodeURIComponent(e.lat)+","+encodeURIComponent(e.lng)+i,mode:"retrieveAddresses",app_id:this.options.app_id,app_code:this.options.app_code,gen:9,jsonattributes:1};r=d.Util.extend(r,this.options.reverseQueryParams),this.getJSON(this.options.reverseGeocodeUrl,r,o,s)},getJSON:function(e,t,r,a){u(e,t,function(e){var t,o,s,n=[];if(e.response.view&&e.response.view.length)for(var i=0;i<=e.response.view[0].result.length-1;i++)t=e.response.view[0].result[i].location,o=d.latLng(t.displayPosition.latitude,t.displayPosition.longitude),s=d.latLngBounds(d.latLng(t.mapView.topLeft.latitude,t.mapView.topLeft.longitude),d.latLng(t.mapView.bottomRight.latitude,t.mapView.bottomRight.longitude)),n[i]={name:t.address.label,properties:t.address,bbox:s,center:o};r.call(a,n)})}});var m=d.Class.extend({options:{next:void 0,sizeInMeters:1e4},initialize:function(e){d.Util.setOptions(this,e)},geocode:function(e,t,o){var s,n;if((s=e.match(/^([NS])\s*(\d{1,3}(?:\.\d*)?)\W*([EW])\s*(\d{1,3}(?:\.\d*)?)$/))?n=d.latLng((/N/i.test(s[1])?1:-1)*parseFloat(s[2]),(/E/i.test(s[3])?1:-1)*parseFloat(s[4])):(s=e.match(/^(\d{1,3}(?:\.\d*)?)\s*([NS])\W*(\d{1,3}(?:\.\d*)?)\s*([EW])$/))?n=d.latLng((/N/i.test(s[2])?1:-1)*parseFloat(s[1]),(/E/i.test(s[4])?1:-1)*parseFloat(s[3])):(s=e.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?$/))?n=d.latLng((/N/i.test(s[1])?1:-1)*(parseFloat(s[2])+parseFloat(s[3]/60)),(/E/i.test(s[4])?1:-1)*(parseFloat(s[5])+parseFloat(s[6]/60))):(s=e.match(/^(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([NS])\W*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([EW])$/))?n=d.latLng((/N/i.test(s[3])?1:-1)*(parseFloat(s[1])+parseFloat(s[2]/60)),(/E/i.test(s[6])?1:-1)*(parseFloat(s[4])+parseFloat(s[5]/60))):(s=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*)?)?["″]?$/))?n=d.latLng((/N/i.test(s[1])?1:-1)*(parseFloat(s[2])+parseFloat(s[3]/60+parseFloat(s[4]/3600))),(/E/i.test(s[5])?1:-1)*(parseFloat(s[6])+parseFloat(s[7]/60)+parseFloat(s[8]/3600))):(s=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])$/))?n=d.latLng((/N/i.test(s[4])?1:-1)*(parseFloat(s[1])+parseFloat(s[2]/60+parseFloat(s[3]/3600))),(/E/i.test(s[8])?1:-1)*(parseFloat(s[5])+parseFloat(s[6]/60)+parseFloat(s[7]/3600))):(s=e.match(/^\s*([+-]?\d+(?:\.\d*)?)\s*[\s,]\s*([+-]?\d+(?:\.\d*)?)\s*$/))&&(n=d.latLng(parseFloat(s[1]),parseFloat(s[2]))),n){var i=[{name:e,center:n,bbox:n.toBounds(this.options.sizeInMeters)}];t.call(o,i)}else this.options.next&&this.options.next.geocode(e,t,o)}});var v=d.Class.extend({options:{serviceUrl:"https://api.mapbox.com/geocoding/v5/mapbox.places/",geocodingQueryParams:{},reverseQueryParams:{}},initialize:function(e,t){d.setOptions(this,t),this.options.geocodingQueryParams.access_token=e,this.options.reverseQueryParams.access_token=e},geocode:function(e,l,c){var t=this.options.geocodingQueryParams;void 0!==t.proximity&&void 0!==t.proximity.lat&&void 0!==t.proximity.lng&&(t.proximity=t.proximity.lng+","+t.proximity.lat),u(this.options.serviceUrl+encodeURIComponent(e)+".json",t,function(e){var t,o,s,n=[];if(e.features&&e.features.length)for(var i=0;i<=e.features.length-1;i++){t=e.features[i],o=d.latLng(t.center.reverse()),s=t.bbox?d.latLngBounds(d.latLng(t.bbox.slice(0,2).reverse()),d.latLng(t.bbox.slice(2,4).reverse())):d.latLngBounds(o,o);for(var r={text:t.text,address:t.address},a=0;a<(t.context||[]).length;a++){r[t.context[a].id.split(".")[0]]=t.context[a].text,t.context[a].short_code&&(r.countryShortCode=t.context[a].short_code)}n[i]={name:t.place_name,bbox:s,center:o,properties:r}}l.call(c,n)})},suggest:function(e,t,o){return this.geocode(e,t,o)},reverse:function(e,t,r,a){u(this.options.serviceUrl+encodeURIComponent(e.lng)+","+encodeURIComponent(e.lat)+".json",this.options.reverseQueryParams,function(e){var t,o,s,n=[];if(e.features&&e.features.length)for(var i=0;i<=e.features.length-1;i++)t=e.features[i],o=d.latLng(t.center.reverse()),s=t.bbox?d.latLngBounds(d.latLng(t.bbox.slice(0,2).reverse()),d.latLng(t.bbox.slice(2,4).reverse())):d.latLngBounds(o,o),n[i]={name:t.place_name,bbox:s,center:o};r.call(a,n)})}});var f=d.Class.extend({options:{serviceUrl:"https://www.mapquestapi.com/geocoding/v1"},initialize:function(e,t){this._key=decodeURIComponent(e),d.Util.setOptions(this,t)},_formatName:function(){var e,t=[];for(e=0;e",apiKey:"",serviceUrl:"https://neutrinoapi.com/"},initialize:function(e){d.Util.setOptions(this,e)},geocode:function(e,n,i){u(this.options.serviceUrl+"geocode-address",{apiKey:this.options.apiKey,userId:this.options.userId,address:e.split(/\s+/).join(".")},function(e){var t,o,s=[];e.locations&&(e.geometry=e.locations[0],t=d.latLng(e.geometry.latitude,e.geometry.longitude),o=d.latLngBounds(t,t),s[0]={name:e.geometry.address,bbox:o,center:t}),n.call(i,s)})},suggest:function(e,t,o){return this.geocode(e,t,o)},reverse:function(n,e,i,r){u(this.options.serviceUrl+"geocode-reverse",{apiKey:this.options.apiKey,userId:this.options.userId,latitude:n.lat,longitude:n.lng},function(e){var t,o,s=[];200==e.status.status&&e.found&&(t=d.latLng(n.lat,n.lng),o=d.latLngBounds(t,t),s[0]={name:e.address,bbox:o,center:t}),i.call(r,s)})}});var b=d.Class.extend({options:{serviceUrl:"https://nominatim.openstreetmap.org/",geocodingQueryParams:{},reverseQueryParams:{},htmlTemplate:function(e){var t,o=e.address,s=[];return(o.road||o.building)&&s.push("{building} {road} {house_number}"),(o.city||o.town||o.village||o.hamlet)&&(t=0{postcode} {city} {town} {village} {hamlet}')),(o.state||o.country)&&(t=0{state} {country}')),n(s.join("
"),o)}},initialize:function(e){d.Util.setOptions(this,e)},geocode:function(e,i,r){u(this.options.serviceUrl+"search",d.extend({q:e,limit:5,format:"json",addressdetails:1},this.options.geocodingQueryParams),d.bind(function(e){for(var t=[],o=e.length-1;0<=o;o--){for(var s=e[o].boundingbox,n=0;n<4;n++)s[n]=parseFloat(s[n]);t[o]={icon:e[o].icon,name:e[o].display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(e[o]):void 0,bbox:d.latLngBounds([s[0],s[2]],[s[1],s[3]]),center:d.latLng(e[o].lat,e[o].lon),properties:e[o]}}i.call(r,t)},this))},reverse:function(e,t,s,n){u(this.options.serviceUrl+"reverse",d.extend({lat:e.lat,lon:e.lng,zoom:Math.round(Math.log(t/256)/Math.log(2)),addressdetails:1,format:"json"},this.options.reverseQueryParams),d.bind(function(e){var t,o=[];e&&e.lat&&e.lon&&(t=d.latLng(e.lat,e.lon),o.push({name:e.display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(e):void 0,center:t,bounds:d.latLngBounds(t,t),properties:e})),s.call(n,o)},this))}});var y=d.Class.extend({options:{OpenLocationCode:void 0,codeLength:void 0},initialize:function(e){d.setOptions(this,e)},geocode:function(e,t,o){try{var s=this.options.OpenLocationCode.decode(e),n={name:e,center:d.latLng(s.latitudeCenter,s.longitudeCenter),bbox:d.latLngBounds(d.latLng(s.latitudeLo,s.longitudeLo),d.latLng(s.latitudeHi,s.longitudeHi))};t.call(o,[n])}catch(e){console.warn(e),t.call(o,[])}},reverse:function(e,t,o,s){try{var n={name:this.options.OpenLocationCode.encode(e.lat,e.lng,this.options.codeLength),center:d.latLng(e.lat,e.lng),bbox:d.latLngBounds(d.latLng(e.lat,e.lng),d.latLng(e.lat,e.lng))};o.call(s,[n])}catch(e){console.warn(e),o.call(s,[])}}});var L=d.Class.extend({options:{serviceUrl:"https://api.opencagedata.com/geocode/v1/json",geocodingQueryParams:{},reverseQueryParams:{}},initialize:function(e,t){d.setOptions(this,t),this._accessToken=e},geocode:function(e,r,a){var t={key:this._accessToken,q:e};t=d.extend(t,this.options.geocodingQueryParams),u(this.options.serviceUrl,t,function(e){var t,o,s,n=[];if(e.results&&e.results.length)for(var i=0;ithis._lastSuggest&&(this._lastSuggest=e.geocoding.timestamp,t.call(o,s._parseResults(e,"bbox")))},this))},reverse:function(e,t,o,s){var n=this;u(this.options.serviceUrl+"/reverse",d.extend({api_key:this._apiKey,"point.lat":e.lat,"point.lon":e.lng},this.options.reverseQueryParams),function(e){o.call(s,n._parseResults(e,"bounds"))})},_parseResults:function(e,i){var r=[];return d.geoJson(e,{pointToLayer:function(e,t){return d.circleMarker(t)},onEachFeature:function(e,t){var o,s,n={};t.getBounds?s=(o=t.getBounds()).getCenter():o=t.feature.bbox?(s=t.getLatLng(),d.latLngBounds(d.GeoJSON.coordsToLatLng(t.feature.bbox.slice(0,2)),d.GeoJSON.coordsToLatLng(t.feature.bbox.slice(2,4)))):(s=t.getLatLng(),d.latLngBounds(s,s)),n.name=t.feature.properties.label,n.center=s,n[i]=o,n.properties=t.feature.properties,r.push(n)}}),r}});function e(e,t){return new x(e,t)}var U=x,C=e,k=x,w=e,D=k.extend({options:{serviceUrl:"https://api.openrouteservice.org/geocode"}});var P=d.Class.extend({options:{serviceUrl:"https://photon.komoot.de/api/",reverseUrl:"https://photon.komoot.de/reverse/",nameProperties:["name","street","suburb","hamlet","town","city","state","country"]},initialize:function(e){d.setOptions(this,e)},geocode:function(e,t,o){var s=d.extend({q:e},this.options.geocodingQueryParams);u(this.options.serviceUrl,s,d.bind(function(e){t.call(o,this._decodeFeatures(e))},this))},suggest:function(e,t,o){return this.geocode(e,t,o)},reverse:function(e,t,o,s){var n=d.extend({lat:e.lat,lon:e.lng},this.options.reverseQueryParams);u(this.options.reverseUrl,n,d.bind(function(e){o.call(s,this._decodeFeatures(e))},this))},_decodeFeatures:function(e){var t,o,s,n,i,r,a=[];if(e&&e.features)for(t=0;t=this.options.suggestMinLength?this._suggestTimeout=setTimeout(d.bind(function(){this._geocode(!0)},this),this.options.suggestTimeout):this._clearResults())}});return d.Util.extend(T,R),d.Util.extend(d.Control,{Geocoder:T,geocoder:function(e){return new T(e)}}),T}(L); +//# sourceMappingURL=Control.Geocoder.min.js.map diff --git a/assets/control-geocoder/Control.Geocoder.min.js.map b/assets/control-geocoder/Control.Geocoder.min.js.map new file mode 100644 index 0000000..84c1d46 --- /dev/null +++ b/assets/control-geocoder/Control.Geocoder.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Control.Geocoder.min.js","sources":["../src/util.js","../src/geocoders/arcgis.js","../src/geocoders/bing.js","../src/geocoders/google.js","../src/geocoders/here.js","../src/geocoders/latlng.js","../src/geocoders/mapbox.js","../src/geocoders/mapquest.js","../src/geocoders/neutrino.js","../src/geocoders/nominatim.js","../src/geocoders/open-location-code.js","../src/geocoders/opencage.js","../src/geocoders/pelias.js","../src/geocoders/photon.js","../src/geocoders/what3words.js","../src/control.js","../src/index.js"],"sourcesContent":["import L from 'leaflet';\nvar lastCallbackId = 0;\n\n// Adapted from handlebars.js\n// https://github.com/wycats/handlebars.js/\nvar badChars = /[&<>\"'`]/g;\nvar possible = /[&<>\"'`]/;\nvar escape = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\n\nfunction escapeChar(chr) {\n return escape[chr];\n}\n\nexport function htmlEscape(string) {\n if (string == null) {\n return '';\n } else if (!string) {\n return string + '';\n }\n\n // Force a string conversion as this will be done by the append regardless and\n // the regex test will do this transparently behind the scenes, causing issues if\n // an object's to string has escaped characters in it.\n string = '' + string;\n\n if (!possible.test(string)) {\n return string;\n }\n return string.replace(badChars, escapeChar);\n}\n\nexport function jsonp(url, params, callback, context, jsonpParam) {\n var callbackId = '_l_geocoder_' + lastCallbackId++;\n params[jsonpParam || 'callback'] = callbackId;\n window[callbackId] = L.Util.bind(callback, context);\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url + getParamString(params);\n script.id = callbackId;\n document.getElementsByTagName('head')[0].appendChild(script);\n}\n\nexport function getJSON(url, params, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState !== 4) {\n return;\n }\n var message;\n if (xmlHttp.status !== 200 && xmlHttp.status !== 304) {\n message = '';\n } else if (typeof xmlHttp.response === 'string') {\n // IE doesn't parse JSON responses even with responseType: 'json'.\n try {\n message = JSON.parse(xmlHttp.response);\n } catch (e) {\n // Not a JSON response\n message = xmlHttp.response;\n }\n } else {\n message = xmlHttp.response;\n }\n callback(message);\n };\n xmlHttp.open('GET', url + getParamString(params), true);\n xmlHttp.responseType = 'json';\n xmlHttp.setRequestHeader('Accept', 'application/json');\n xmlHttp.send(null);\n}\n\nexport function template(str, data) {\n return str.replace(/\\{ *([\\w_]+) *\\}/g, function(str, key) {\n var value = data[key];\n if (value === undefined) {\n value = '';\n } else if (typeof value === 'function') {\n value = value(data);\n }\n return htmlEscape(value);\n });\n}\n\nexport function getParamString(obj, existingUrl, uppercase) {\n var params = [];\n for (var i in obj) {\n var key = encodeURIComponent(uppercase ? i.toUpperCase() : i);\n var value = obj[i];\n if (!L.Util.isArray(value)) {\n params.push(key + '=' + encodeURIComponent(value));\n } else {\n for (var j = 0; j < value.length; j++) {\n params.push(key + '=' + encodeURIComponent(value[j]));\n }\n }\n }\n return (!existingUrl || existingUrl.indexOf('?') === -1 ? '?' : '&') + params.join('&');\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var ArcGis = L.Class.extend({\n options: {\n service_url: 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer'\n },\n\n initialize: function(accessToken, options) {\n L.setOptions(this, options);\n this._accessToken = accessToken;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n SingleLine: query,\n outFields: 'Addr_Type',\n forStorage: false,\n maxLocations: 10,\n f: 'json'\n };\n\n if (this._key && this._key.length) {\n params.token = this._key;\n }\n\n getJSON(\n this.options.service_url + '/findAddressCandidates',\n L.extend(params, this.options.geocodingQueryParams),\n function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n\n if (data.candidates && data.candidates.length) {\n for (var i = 0; i <= data.candidates.length - 1; i++) {\n loc = data.candidates[i];\n latLng = L.latLng(loc.location.y, loc.location.x);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.extent.ymax, loc.extent.xmax),\n L.latLng(loc.extent.ymin, loc.extent.xmin)\n );\n results[i] = {\n name: loc.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n location: encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat),\n distance: 100,\n f: 'json'\n };\n\n getJSON(this.options.service_url + '/reverseGeocode', params, function(data) {\n var result = [],\n loc;\n\n if (data && !data.error) {\n loc = L.latLng(data.location.y, data.location.x);\n result.push({\n name: data.address.Match_addr,\n center: loc,\n bounds: L.latLngBounds(loc, loc)\n });\n }\n\n cb.call(context, result);\n });\n }\n});\n\nexport function arcgis(accessToken, options) {\n return new ArcGis(accessToken, options);\n}\n","import L from 'leaflet';\nimport { jsonp } from '../util';\n\nexport var Bing = L.Class.extend({\n initialize: function(key) {\n this.key = key;\n },\n\n geocode: function(query, cb, context) {\n jsonp(\n 'https://dev.virtualearth.net/REST/v1/Locations',\n {\n query: query,\n key: this.key\n },\n function(data) {\n var results = [];\n if (data.resourceSets.length > 0) {\n for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) {\n var resource = data.resourceSets[0].resources[i],\n bbox = resource.bbox;\n results[i] = {\n name: resource.name,\n bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]),\n center: L.latLng(resource.point.coordinates)\n };\n }\n }\n cb.call(context, results);\n },\n this,\n 'jsonp'\n );\n },\n\n reverse: function(location, scale, cb, context) {\n jsonp(\n '//dev.virtualearth.net/REST/v1/Locations/' + location.lat + ',' + location.lng,\n {\n key: this.key\n },\n function(data) {\n var results = [];\n for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) {\n var resource = data.resourceSets[0].resources[i],\n bbox = resource.bbox;\n results[i] = {\n name: resource.name,\n bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]),\n center: L.latLng(resource.point.coordinates)\n };\n }\n cb.call(context, results);\n },\n this,\n 'jsonp'\n );\n }\n});\n\nexport function bing(key) {\n return new Bing(key);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Google = L.Class.extend({\n options: {\n serviceUrl: 'https://maps.googleapis.com/maps/api/geocode/json',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(key, options) {\n this._key = key;\n L.setOptions(this, options);\n // Backwards compatibility\n this.options.serviceUrl = this.options.service_url || this.options.serviceUrl;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n address: query\n };\n\n if (this._key && this._key.length) {\n params.key = this._key;\n }\n\n params = L.Util.extend(params, this.options.geocodingQueryParams);\n\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.results && data.results.length) {\n for (var i = 0; i <= data.results.length - 1; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry.location);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.geometry.viewport.northeast),\n L.latLng(loc.geometry.viewport.southwest)\n );\n results[i] = {\n name: loc.formatted_address,\n bbox: latLngBounds,\n center: latLng,\n properties: loc.address_components\n };\n }\n }\n\n cb.call(context, results);\n });\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n latlng: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng)\n };\n params = L.Util.extend(params, this.options.reverseQueryParams);\n if (this._key && this._key.length) {\n params.key = this._key;\n }\n\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.results && data.results.length) {\n for (var i = 0; i <= data.results.length - 1; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry.location);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.geometry.viewport.northeast),\n L.latLng(loc.geometry.viewport.southwest)\n );\n results[i] = {\n name: loc.formatted_address,\n bbox: latLngBounds,\n center: latLng,\n properties: loc.address_components\n };\n }\n }\n\n cb.call(context, results);\n });\n }\n});\n\nexport function google(key, options) {\n return new Google(key, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\nexport var HERE = L.Class.extend({\n options: {\n geocodeUrl: 'https://geocoder.api.here.com/6.2/geocode.json',\n reverseGeocodeUrl: 'https://reverse.geocoder.api.here.com/6.2/reversegeocode.json',\n app_id: '',\n app_code: '',\n geocodingQueryParams: {},\n reverseQueryParams: {},\n reverseGeocodeProxRadius: null\n },\n initialize: function(options) {\n L.setOptions(this, options);\n },\n geocode: function(query, cb, context) {\n var params = {\n searchtext: query,\n gen: 9,\n app_id: this.options.app_id,\n app_code: this.options.app_code,\n jsonattributes: 1\n };\n params = L.Util.extend(params, this.options.geocodingQueryParams);\n this.getJSON(this.options.geocodeUrl, params, cb, context);\n },\n reverse: function(location, scale, cb, context) {\n var _proxRadius = this.options.reverseGeocodeProxRadius\n ? this.options.reverseGeocodeProxRadius\n : null;\n var proxRadius = _proxRadius ? ',' + encodeURIComponent(_proxRadius) : '';\n var params = {\n prox: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng) + proxRadius,\n mode: 'retrieveAddresses',\n app_id: this.options.app_id,\n app_code: this.options.app_code,\n gen: 9,\n jsonattributes: 1\n };\n params = L.Util.extend(params, this.options.reverseQueryParams);\n this.getJSON(this.options.reverseGeocodeUrl, params, cb, context);\n },\n getJSON: function(url, params, cb, context) {\n getJSON(url, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.response.view && data.response.view.length) {\n for (var i = 0; i <= data.response.view[0].result.length - 1; i++) {\n loc = data.response.view[0].result[i].location;\n latLng = L.latLng(loc.displayPosition.latitude, loc.displayPosition.longitude);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.mapView.topLeft.latitude, loc.mapView.topLeft.longitude),\n L.latLng(loc.mapView.bottomRight.latitude, loc.mapView.bottomRight.longitude)\n );\n results[i] = {\n name: loc.address.label,\n properties: loc.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n cb.call(context, results);\n });\n }\n});\nexport function here(options) {\n return new HERE(options);\n}\n","import L from 'leaflet';\n\nexport var LatLng = L.Class.extend({\n options: {\n // the next geocoder to use\n next: undefined,\n sizeInMeters: 10000\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n var match;\n var center;\n // regex from https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/geocoder_controller.rb\n if ((match = query.match(/^([NS])\\s*(\\d{1,3}(?:\\.\\d*)?)\\W*([EW])\\s*(\\d{1,3}(?:\\.\\d*)?)$/))) {\n // [NSEW] decimal degrees\n center = L.latLng(\n (/N/i.test(match[1]) ? 1 : -1) * parseFloat(match[2]),\n (/E/i.test(match[3]) ? 1 : -1) * parseFloat(match[4])\n );\n } else if (\n (match = query.match(/^(\\d{1,3}(?:\\.\\d*)?)\\s*([NS])\\W*(\\d{1,3}(?:\\.\\d*)?)\\s*([EW])$/))\n ) {\n // decimal degrees [NSEW]\n center = L.latLng(\n (/N/i.test(match[2]) ? 1 : -1) * parseFloat(match[1]),\n (/E/i.test(match[4]) ? 1 : -1) * parseFloat(match[3])\n );\n } else if (\n (match = query.match(\n /^([NS])\\s*(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?\\W*([EW])\\s*(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?$/\n ))\n ) {\n // [NSEW] degrees, decimal minutes\n center = L.latLng(\n (/N/i.test(match[1]) ? 1 : -1) * (parseFloat(match[2]) + parseFloat(match[3] / 60)),\n (/E/i.test(match[4]) ? 1 : -1) * (parseFloat(match[5]) + parseFloat(match[6] / 60))\n );\n } else if (\n (match = query.match(\n /^(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?\\s*([NS])\\W*(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?\\s*([EW])$/\n ))\n ) {\n // degrees, decimal minutes [NSEW]\n center = L.latLng(\n (/N/i.test(match[3]) ? 1 : -1) * (parseFloat(match[1]) + parseFloat(match[2] / 60)),\n (/E/i.test(match[6]) ? 1 : -1) * (parseFloat(match[4]) + parseFloat(match[5] / 60))\n );\n } else if (\n (match = query.match(\n /^([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*)?)?[\"″]?$/\n ))\n ) {\n // [NSEW] degrees, minutes, decimal seconds\n center = L.latLng(\n (/N/i.test(match[1]) ? 1 : -1) *\n (parseFloat(match[2]) + parseFloat(match[3] / 60 + parseFloat(match[4] / 3600))),\n (/E/i.test(match[5]) ? 1 : -1) *\n (parseFloat(match[6]) + parseFloat(match[7] / 60) + parseFloat(match[8] / 3600))\n );\n } else if (\n (match = query.match(\n /^(\\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])$/\n ))\n ) {\n // degrees, minutes, decimal seconds [NSEW]\n center = L.latLng(\n (/N/i.test(match[4]) ? 1 : -1) *\n (parseFloat(match[1]) + parseFloat(match[2] / 60 + parseFloat(match[3] / 3600))),\n (/E/i.test(match[8]) ? 1 : -1) *\n (parseFloat(match[5]) + parseFloat(match[6] / 60) + parseFloat(match[7] / 3600))\n );\n } else if (\n (match = query.match(/^\\s*([+-]?\\d+(?:\\.\\d*)?)\\s*[\\s,]\\s*([+-]?\\d+(?:\\.\\d*)?)\\s*$/))\n ) {\n center = L.latLng(parseFloat(match[1]), parseFloat(match[2]));\n }\n if (center) {\n var results = [\n {\n name: query,\n center: center,\n bbox: center.toBounds(this.options.sizeInMeters)\n }\n ];\n cb.call(context, results);\n } else if (this.options.next) {\n this.options.next.geocode(query, cb, context);\n }\n }\n});\n\nexport function latLng(options) {\n return new LatLng(options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Mapbox = L.Class.extend({\n options: {\n serviceUrl: 'https://api.mapbox.com/geocoding/v5/mapbox.places/',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(accessToken, options) {\n L.setOptions(this, options);\n this.options.geocodingQueryParams.access_token = accessToken;\n this.options.reverseQueryParams.access_token = accessToken;\n },\n\n geocode: function(query, cb, context) {\n var params = this.options.geocodingQueryParams;\n if (\n params.proximity !== undefined &&\n params.proximity.lat !== undefined &&\n params.proximity.lng !== undefined\n ) {\n params.proximity = params.proximity.lng + ',' + params.proximity.lat;\n }\n getJSON(this.options.serviceUrl + encodeURIComponent(query) + '.json', params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.features && data.features.length) {\n for (var i = 0; i <= data.features.length - 1; i++) {\n loc = data.features[i];\n latLng = L.latLng(loc.center.reverse());\n if (loc.bbox) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.bbox.slice(0, 2).reverse()),\n L.latLng(loc.bbox.slice(2, 4).reverse())\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n\n var properties = {\n text: loc.text,\n address: loc.address\n };\n\n for (var j = 0; j < (loc.context || []).length; j++) {\n var id = loc.context[j].id.split('.')[0];\n properties[id] = loc.context[j].text;\n\n // Get country code when available\n if (loc.context[j].short_code) {\n properties['countryShortCode'] = loc.context[j].short_code\n }\n }\n\n results[i] = {\n name: loc.place_name,\n bbox: latLngBounds,\n center: latLng,\n properties: properties\n };\n }\n }\n\n cb.call(context, results);\n });\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl +\n encodeURIComponent(location.lng) +\n ',' +\n encodeURIComponent(location.lat) +\n '.json',\n this.options.reverseQueryParams,\n function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.features && data.features.length) {\n for (var i = 0; i <= data.features.length - 1; i++) {\n loc = data.features[i];\n latLng = L.latLng(loc.center.reverse());\n if (loc.bbox) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.bbox.slice(0, 2).reverse()),\n L.latLng(loc.bbox.slice(2, 4).reverse())\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results[i] = {\n name: loc.place_name,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }\n );\n }\n});\n\nexport function mapbox(accessToken, options) {\n return new Mapbox(accessToken, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var MapQuest = L.Class.extend({\n options: {\n serviceUrl: 'https://www.mapquestapi.com/geocoding/v1'\n },\n\n initialize: function(key, options) {\n // MapQuest seems to provide URI encoded API keys,\n // so to avoid encoding them twice, we decode them here\n this._key = decodeURIComponent(key);\n\n L.Util.setOptions(this, options);\n },\n\n _formatName: function() {\n var r = [],\n i;\n for (i = 0; i < arguments.length; i++) {\n if (arguments[i]) {\n r.push(arguments[i]);\n }\n }\n\n return r.join(', ');\n },\n\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + '/address',\n {\n key: this._key,\n location: query,\n limit: 5,\n outFormat: 'json'\n },\n L.bind(function(data) {\n var results = [],\n loc,\n latLng;\n if (data.results && data.results[0].locations) {\n for (var i = data.results[0].locations.length - 1; i >= 0; i--) {\n loc = data.results[0].locations[i];\n latLng = L.latLng(loc.latLng);\n results[i] = {\n name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1),\n bbox: L.latLngBounds(latLng, latLng),\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + '/reverse',\n {\n key: this._key,\n location: location.lat + ',' + location.lng,\n outputFormat: 'json'\n },\n L.bind(function(data) {\n var results = [],\n loc,\n latLng;\n if (data.results && data.results[0].locations) {\n for (var i = data.results[0].locations.length - 1; i >= 0; i--) {\n loc = data.results[0].locations[i];\n latLng = L.latLng(loc.latLng);\n results[i] = {\n name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1),\n bbox: L.latLngBounds(latLng, latLng),\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }, this)\n );\n }\n});\n\nexport function mapQuest(key, options) {\n return new MapQuest(key, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Neutrino = L.Class.extend({\n options: {\n userId: '',\n apiKey: '',\n serviceUrl: 'https://neutrinoapi.com/'\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n // https://www.neutrinoapi.com/api/geocode-address/\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + 'geocode-address',\n {\n apiKey: this.options.apiKey,\n userId: this.options.userId,\n //get three words and make a dot based string\n address: query.split(/\\s+/).join('.')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.locations) {\n data.geometry = data.locations[0];\n latLng = L.latLng(data.geometry['latitude'], data.geometry['longitude']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.geometry.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n // https://www.neutrinoapi.com/api/geocode-reverse/\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'geocode-reverse',\n {\n apiKey: this.options.apiKey,\n userId: this.options.userId,\n latitude: location.lat,\n longitude: location.lng\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.status.status == 200 && data.found) {\n latLng = L.latLng(location.lat, location.lng);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n cb.call(context, results);\n }\n );\n }\n});\n\nexport function neutrino(accessToken) {\n return new Neutrino(accessToken);\n}\n","import L from 'leaflet';\nimport { template, getJSON } from '../util';\n\nexport var Nominatim = L.Class.extend({\n options: {\n serviceUrl: 'https://nominatim.openstreetmap.org/',\n geocodingQueryParams: {},\n reverseQueryParams: {},\n htmlTemplate: function(r) {\n var a = r.address,\n className,\n parts = [];\n if (a.road || a.building) {\n parts.push('{building} {road} {house_number}');\n }\n\n if (a.city || a.town || a.village || a.hamlet) {\n className = parts.length > 0 ? 'leaflet-control-geocoder-address-detail' : '';\n parts.push(\n '{postcode} {city} {town} {village} {hamlet}'\n );\n }\n\n if (a.state || a.country) {\n className = parts.length > 0 ? 'leaflet-control-geocoder-address-context' : '';\n parts.push('{state} {country}');\n }\n\n return template(parts.join('
'), a, true);\n }\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + 'search',\n L.extend(\n {\n q: query,\n limit: 5,\n format: 'json',\n addressdetails: 1\n },\n this.options.geocodingQueryParams\n ),\n L.bind(function(data) {\n var results = [];\n for (var i = data.length - 1; i >= 0; i--) {\n var bbox = data[i].boundingbox;\n for (var j = 0; j < 4; j++) bbox[j] = parseFloat(bbox[j]);\n results[i] = {\n icon: data[i].icon,\n name: data[i].display_name,\n html: this.options.htmlTemplate ? this.options.htmlTemplate(data[i]) : undefined,\n bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]),\n center: L.latLng(data[i].lat, data[i].lon),\n properties: data[i]\n };\n }\n cb.call(context, results);\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'reverse',\n L.extend(\n {\n lat: location.lat,\n lon: location.lng,\n zoom: Math.round(Math.log(scale / 256) / Math.log(2)),\n addressdetails: 1,\n format: 'json'\n },\n this.options.reverseQueryParams\n ),\n L.bind(function(data) {\n var result = [],\n loc;\n\n if (data && data.lat && data.lon) {\n loc = L.latLng(data.lat, data.lon);\n result.push({\n name: data.display_name,\n html: this.options.htmlTemplate ? this.options.htmlTemplate(data) : undefined,\n center: loc,\n bounds: L.latLngBounds(loc, loc),\n properties: data\n });\n }\n\n cb.call(context, result);\n }, this)\n );\n }\n});\n\nexport function nominatim(options) {\n return new Nominatim(options);\n}\n","import L from 'leaflet';\n\nexport var OpenLocationCode = L.Class.extend({\n options: {\n OpenLocationCode: undefined,\n codeLength: undefined\n },\n\n initialize: function(options) {\n L.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n try {\n var decoded = this.options.OpenLocationCode.decode(query);\n var result = {\n name: query,\n center: L.latLng(decoded.latitudeCenter, decoded.longitudeCenter),\n bbox: L.latLngBounds(\n L.latLng(decoded.latitudeLo, decoded.longitudeLo),\n L.latLng(decoded.latitudeHi, decoded.longitudeHi)\n )\n };\n cb.call(context, [result]);\n } catch (e) {\n console.warn(e); // eslint-disable-line no-console\n cb.call(context, []);\n }\n },\n reverse: function(location, scale, cb, context) {\n try {\n var code = this.options.OpenLocationCode.encode(\n location.lat,\n location.lng,\n this.options.codeLength\n );\n var result = {\n name: code,\n center: L.latLng(location.lat, location.lng),\n bbox: L.latLngBounds(\n L.latLng(location.lat, location.lng),\n L.latLng(location.lat, location.lng)\n )\n };\n cb.call(context, [result]);\n } catch (e) {\n console.warn(e); // eslint-disable-line no-console\n cb.call(context, []);\n }\n }\n});\n\nexport function openLocationCode(options) {\n return new OpenLocationCode(options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var OpenCage = L.Class.extend({\n options: {\n serviceUrl: 'https://api.opencagedata.com/geocode/v1/json',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(apiKey, options) {\n L.setOptions(this, options);\n this._accessToken = apiKey;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n key: this._accessToken,\n q: query\n };\n params = L.extend(params, this.options.geocodingQueryParams);\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n latLng,\n latLngBounds,\n loc;\n if (data.results && data.results.length) {\n for (var i = 0; i < data.results.length; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry);\n if (loc.annotations && loc.annotations.bounds) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.annotations.bounds.northeast),\n L.latLng(loc.annotations.bounds.southwest)\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results.push({\n name: loc.formatted,\n bbox: latLngBounds,\n center: latLng\n });\n }\n }\n cb.call(context, results);\n });\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n key: this._accessToken,\n q: [location.lat, location.lng].join(',')\n };\n params = L.extend(params, this.options.reverseQueryParams);\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n latLng,\n latLngBounds,\n loc;\n if (data.results && data.results.length) {\n for (var i = 0; i < data.results.length; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry);\n if (loc.annotations && loc.annotations.bounds) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.annotations.bounds.northeast),\n L.latLng(loc.annotations.bounds.southwest)\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results.push({\n name: loc.formatted,\n bbox: latLngBounds,\n center: latLng\n });\n }\n }\n cb.call(context, results);\n });\n }\n});\n\nexport function opencage(apiKey, options) {\n return new OpenCage(apiKey, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Pelias = L.Class.extend({\n options: {\n serviceUrl: 'https://api.geocode.earth/v1',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(apiKey, options) {\n L.Util.setOptions(this, options);\n this._apiKey = apiKey;\n this._lastSuggest = 0;\n },\n\n geocode: function(query, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/search',\n L.extend(\n {\n api_key: this._apiKey,\n text: query\n },\n this.options.geocodingQueryParams\n ),\n function(data) {\n cb.call(context, _this._parseResults(data, 'bbox'));\n }\n );\n },\n\n suggest: function(query, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/autocomplete',\n L.extend(\n {\n api_key: this._apiKey,\n text: query\n },\n this.options.geocodingQueryParams\n ),\n L.bind(function(data) {\n if (data.geocoding.timestamp > this._lastSuggest) {\n this._lastSuggest = data.geocoding.timestamp;\n cb.call(context, _this._parseResults(data, 'bbox'));\n }\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/reverse',\n L.extend(\n {\n api_key: this._apiKey,\n 'point.lat': location.lat,\n 'point.lon': location.lng\n },\n this.options.reverseQueryParams\n ),\n function(data) {\n cb.call(context, _this._parseResults(data, 'bounds'));\n }\n );\n },\n\n _parseResults: function(data, bboxname) {\n var results = [];\n L.geoJson(data, {\n pointToLayer: function(feature, latlng) {\n return L.circleMarker(latlng);\n },\n onEachFeature: function(feature, layer) {\n var result = {},\n bbox,\n center;\n\n if (layer.getBounds) {\n bbox = layer.getBounds();\n center = bbox.getCenter();\n } else if (layer.feature.bbox) {\n center = layer.getLatLng();\n bbox = L.latLngBounds(\n L.GeoJSON.coordsToLatLng(layer.feature.bbox.slice(0, 2)),\n L.GeoJSON.coordsToLatLng(layer.feature.bbox.slice(2, 4))\n );\n } else {\n center = layer.getLatLng();\n bbox = L.latLngBounds(center, center);\n }\n\n result.name = layer.feature.properties.label;\n result.center = center;\n result[bboxname] = bbox;\n result.properties = layer.feature.properties;\n results.push(result);\n }\n });\n return results;\n }\n});\n\nexport function pelias(apiKey, options) {\n return new Pelias(apiKey, options);\n}\nexport var GeocodeEarth = Pelias;\nexport var geocodeEarth = pelias;\n\nexport var Mapzen = Pelias; // r.i.p.\nexport var mapzen = pelias;\n\nexport var Openrouteservice = Mapzen.extend({\n options: {\n serviceUrl: 'https://api.openrouteservice.org/geocode'\n }\n});\nexport function openrouteservice(apiKey, options) {\n return new Openrouteservice(apiKey, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Photon = L.Class.extend({\n options: {\n serviceUrl: 'https://photon.komoot.de/api/',\n reverseUrl: 'https://photon.komoot.de/reverse/',\n nameProperties: ['name', 'street', 'suburb', 'hamlet', 'town', 'city', 'state', 'country']\n },\n\n initialize: function(options) {\n L.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n var params = L.extend(\n {\n q: query\n },\n this.options.geocodingQueryParams\n );\n\n getJSON(\n this.options.serviceUrl,\n params,\n L.bind(function(data) {\n cb.call(context, this._decodeFeatures(data));\n }, this)\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(latLng, scale, cb, context) {\n var params = L.extend(\n {\n lat: latLng.lat,\n lon: latLng.lng\n },\n this.options.reverseQueryParams\n );\n\n getJSON(\n this.options.reverseUrl,\n params,\n L.bind(function(data) {\n cb.call(context, this._decodeFeatures(data));\n }, this)\n );\n },\n\n _decodeFeatures: function(data) {\n var results = [],\n i,\n f,\n c,\n latLng,\n extent,\n bbox;\n\n if (data && data.features) {\n for (i = 0; i < data.features.length; i++) {\n f = data.features[i];\n c = f.geometry.coordinates;\n latLng = L.latLng(c[1], c[0]);\n extent = f.properties.extent;\n\n if (extent) {\n bbox = L.latLngBounds([extent[1], extent[0]], [extent[3], extent[2]]);\n } else {\n bbox = L.latLngBounds(latLng, latLng);\n }\n\n results.push({\n name: this._decodeFeatureName(f),\n html: this.options.htmlTemplate ? this.options.htmlTemplate(f) : undefined,\n center: latLng,\n bbox: bbox,\n properties: f.properties\n });\n }\n }\n\n return results;\n },\n\n _decodeFeatureName: function(f) {\n return (this.options.nameProperties || [])\n .map(function(p) {\n return f.properties[p];\n })\n .filter(function(v) {\n return !!v;\n })\n .join(', ');\n }\n});\n\nexport function photon(options) {\n return new Photon(options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var What3Words = L.Class.extend({\n options: {\n serviceUrl: 'https://api.what3words.com/v2/'\n },\n\n initialize: function(accessToken) {\n this._accessToken = accessToken;\n },\n\n geocode: function(query, cb, context) {\n //get three words and make a dot based string\n getJSON(\n this.options.serviceUrl + 'forward',\n {\n key: this._accessToken,\n addr: query.split(/\\s+/).join('.')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.geometry) {\n latLng = L.latLng(data.geometry['lat'], data.geometry['lng']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.words,\n bbox: latLngBounds,\n center: latLng\n };\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'reverse',\n {\n key: this._accessToken,\n coords: [location.lat, location.lng].join(',')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.status.status == 200) {\n latLng = L.latLng(data.geometry['lat'], data.geometry['lng']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.words,\n bbox: latLngBounds,\n center: latLng\n };\n }\n cb.call(context, results);\n }\n );\n }\n});\n\nexport function what3words(accessToken) {\n return new What3Words(accessToken);\n}\n","import L from 'leaflet';\nimport { Nominatim } from './geocoders/index';\n\nexport var Geocoder = L.Control.extend({\n options: {\n showUniqueResult: true,\n showResultIcons: false,\n collapsed: true,\n expand: 'touch', // options: touch, click, anythingelse\n position: 'topright',\n placeholder: 'Search...',\n errorMessage: 'Nothing found.',\n iconLabel: 'Initiate a new search',\n queryMinLength: 1,\n suggestMinLength: 3,\n suggestTimeout: 250,\n defaultMarkGeocode: true\n },\n\n includes: L.Evented.prototype || L.Mixin.Events,\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n if (!this.options.geocoder) {\n this.options.geocoder = new Nominatim();\n }\n\n this._requestCount = 0;\n },\n\n addThrobberClass: function() {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber');\n },\n\n removeThrobberClass: function() {\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-throbber');\n },\n\n onAdd: function(map) {\n var className = 'leaflet-control-geocoder',\n container = L.DomUtil.create('div', className + ' leaflet-bar'),\n icon = L.DomUtil.create('button', className + '-icon', container),\n form = (this._form = L.DomUtil.create('div', className + '-form', container)),\n input;\n\n this._map = map;\n this._container = container;\n\n icon.innerHTML = ' ';\n icon.type = 'button';\n icon.setAttribute('aria-label', this.options.iconLabel);\n\n input = this._input = L.DomUtil.create('input', '', form);\n input.type = 'text';\n input.value = this.options.query || '';\n input.placeholder = this.options.placeholder;\n L.DomEvent.disableClickPropagation(input);\n\n this._errorElement = L.DomUtil.create('div', className + '-form-no-error', container);\n this._errorElement.innerHTML = this.options.errorMessage;\n\n this._alts = L.DomUtil.create(\n 'ul',\n className + '-alternatives leaflet-control-geocoder-alternatives-minimized',\n container\n );\n L.DomEvent.disableClickPropagation(this._alts);\n\n L.DomEvent.addListener(input, 'keydown', this._keydown, this);\n if (this.options.geocoder.suggest) {\n L.DomEvent.addListener(input, 'input', this._change, this);\n }\n L.DomEvent.addListener(\n input,\n 'blur',\n function() {\n if (this.options.collapsed && !this._preventBlurCollapse) {\n this._collapse();\n }\n this._preventBlurCollapse = false;\n },\n this\n );\n\n if (this.options.collapsed) {\n if (this.options.expand === 'click') {\n L.DomEvent.addListener(\n container,\n 'click',\n function(e) {\n if (e.button === 0 && e.detail !== 2) {\n this._toggle();\n }\n },\n this\n );\n } else if (this.options.expand === 'touch') {\n L.DomEvent.addListener(\n container,\n L.Browser.touch ? 'touchstart mousedown' : 'mousedown',\n function(e) {\n this._toggle();\n e.preventDefault(); // mobile: clicking focuses the icon, so UI expands and immediately collapses\n e.stopPropagation();\n },\n this\n );\n } else {\n L.DomEvent.addListener(container, 'mouseover', this._expand, this);\n L.DomEvent.addListener(container, 'mouseout', this._collapse, this);\n this._map.on('movestart', this._collapse, this);\n }\n } else {\n this._expand();\n if (L.Browser.touch) {\n L.DomEvent.addListener(\n container,\n 'touchstart',\n function() {\n this._geocode();\n },\n this\n );\n } else {\n L.DomEvent.addListener(\n container,\n 'click',\n function() {\n this._geocode();\n },\n this\n );\n }\n }\n\n if (this.options.defaultMarkGeocode) {\n this.on('markgeocode', this.markGeocode, this);\n }\n\n this.on('startgeocode', this.addThrobberClass, this);\n this.on('finishgeocode', this.removeThrobberClass, this);\n this.on('startsuggest', this.addThrobberClass, this);\n this.on('finishsuggest', this.removeThrobberClass, this);\n\n L.DomEvent.disableClickPropagation(container);\n\n return container;\n },\n\n setQuery: function(string) {\n this._input.value = string;\n return this;\n },\n\n _geocodeResult: function(results, suggest) {\n if (!suggest && this.options.showUniqueResult && results.length === 1) {\n this._geocodeResultSelected(results[0]);\n } else if (results.length > 0) {\n this._alts.innerHTML = '';\n this._results = results;\n L.DomUtil.removeClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-options-open');\n for (var i = 0; i < results.length; i++) {\n this._alts.appendChild(this._createAlt(results[i], i));\n }\n } else {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-options-error');\n L.DomUtil.addClass(this._errorElement, 'leaflet-control-geocoder-error');\n }\n },\n\n markGeocode: function(result) {\n result = result.geocode || result;\n\n this._map.fitBounds(result.bbox);\n\n if (this._geocodeMarker) {\n this._map.removeLayer(this._geocodeMarker);\n }\n\n this._geocodeMarker = new L.Marker(result.center)\n .bindPopup(result.html || result.name)\n .addTo(this._map)\n .openPopup();\n\n return this;\n },\n\n _geocode: function(suggest) {\n var value = this._input.value;\n if (!suggest && value.length < this.options.queryMinLength) {\n return;\n }\n\n var requestCount = ++this._requestCount,\n mode = suggest ? 'suggest' : 'geocode',\n eventData = { input: value };\n\n this._lastGeocode = value;\n if (!suggest) {\n this._clearResults();\n }\n\n this.fire('start' + mode, eventData);\n this.options.geocoder[mode](\n value,\n function(results) {\n if (requestCount === this._requestCount) {\n eventData.results = results;\n this.fire('finish' + mode, eventData);\n this._geocodeResult(results, suggest);\n }\n },\n this\n );\n },\n\n _geocodeResultSelected: function(result) {\n this.fire('markgeocode', { geocode: result });\n },\n\n _toggle: function() {\n if (L.DomUtil.hasClass(this._container, 'leaflet-control-geocoder-expanded')) {\n this._collapse();\n } else {\n this._expand();\n }\n },\n\n _expand: function() {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-expanded');\n this._input.select();\n this.fire('expand');\n },\n\n _collapse: function() {\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-expanded');\n L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-open');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-error');\n this._input.blur(); // mobile: keyboard shouldn't stay expanded\n this.fire('collapse');\n },\n\n _clearResults: function() {\n L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n this._selection = null;\n L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-open');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-error');\n },\n\n _createAlt: function(result, index) {\n var li = L.DomUtil.create('li', ''),\n a = L.DomUtil.create('a', '', li),\n icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null,\n text = result.html ? undefined : document.createTextNode(result.name),\n mouseDownHandler = function mouseDownHandler(e) {\n // In some browsers, a click will fire on the map if the control is\n // collapsed directly after mousedown. To work around this, we\n // wait until the click is completed, and _then_ collapse the\n // control. Messy, but this is the workaround I could come up with\n // for #142.\n this._preventBlurCollapse = true;\n L.DomEvent.stop(e);\n this._geocodeResultSelected(result);\n L.DomEvent.on(\n li,\n 'click touchend',\n function() {\n if (this.options.collapsed) {\n this._collapse();\n } else {\n this._clearResults();\n }\n },\n this\n );\n };\n\n if (icon) {\n icon.src = result.icon;\n }\n\n li.setAttribute('data-result-index', index);\n\n if (result.html) {\n a.innerHTML = a.innerHTML + result.html;\n } else {\n a.appendChild(text);\n }\n\n // Use mousedown and not click, since click will fire _after_ blur,\n // causing the control to have collapsed and removed the items\n // before the click can fire.\n L.DomEvent.addListener(li, 'mousedown touchstart', mouseDownHandler, this);\n\n return li;\n },\n\n _keydown: function(e) {\n var _this = this,\n select = function select(dir) {\n if (_this._selection) {\n L.DomUtil.removeClass(_this._selection, 'leaflet-control-geocoder-selected');\n _this._selection = _this._selection[dir > 0 ? 'nextSibling' : 'previousSibling'];\n }\n if (!_this._selection) {\n _this._selection = _this._alts[dir > 0 ? 'firstChild' : 'lastChild'];\n }\n\n if (_this._selection) {\n L.DomUtil.addClass(_this._selection, 'leaflet-control-geocoder-selected');\n }\n };\n\n switch (e.keyCode) {\n // Escape\n case 27:\n if (this.options.collapsed) {\n this._collapse();\n } else {\n this._clearResults();\n }\n break;\n // Up\n case 38:\n select(-1);\n break;\n // Up\n case 40:\n select(1);\n break;\n // Enter\n case 13:\n if (this._selection) {\n var index = parseInt(this._selection.getAttribute('data-result-index'), 10);\n this._geocodeResultSelected(this._results[index]);\n this._clearResults();\n } else {\n this._geocode();\n }\n break;\n default:\n return;\n }\n\n L.DomEvent.preventDefault(e);\n },\n _change: function() {\n var v = this._input.value;\n if (v !== this._lastGeocode) {\n clearTimeout(this._suggestTimeout);\n if (v.length >= this.options.suggestMinLength) {\n this._suggestTimeout = setTimeout(\n L.bind(function() {\n this._geocode(true);\n }, this),\n this.options.suggestTimeout\n );\n } else {\n this._clearResults();\n }\n }\n }\n});\n\nexport function geocoder(options) {\n return new Geocoder(options);\n}\n","import L from 'leaflet';\nimport { Geocoder, geocoder } from './control';\nimport * as geocoders from './geocoders/index';\n\nL.Util.extend(Geocoder, geocoders);\nexport default Geocoder;\n\nL.Util.extend(L.Control, {\n Geocoder: Geocoder,\n geocoder: geocoder\n});\n"],"names":["lastCallbackId","badChars","possible","escape","&","<",">","\"","'","`","escapeChar","chr","jsonp","url","params","callback","context","jsonpParam","callbackId","window","L","Util","bind","script","document","createElement","type","src","getParamString","id","getElementsByTagName","appendChild","getJSON","xmlHttp","XMLHttpRequest","onreadystatechange","readyState","message","status","response","JSON","parse","e","open","responseType","setRequestHeader","send","template","str","data","replace","key","string","value","undefined","test","obj","existingUrl","uppercase","i","encodeURIComponent","toUpperCase","isArray","j","length","push","indexOf","join","ArcGis","Class","extend","options","service_url","initialize","accessToken","setOptions","this","_accessToken","geocode","query","cb","SingleLine","outFields","forStorage","maxLocations","f","_key","token","geocodingQueryParams","loc","latLng","latLngBounds","results","candidates","location","y","x","extent","ymax","xmax","ymin","xmin","name","address","bbox","center","call","suggest","reverse","scale","lng","lat","distance","result","error","Match_addr","bounds","Bing","resourceSets","resources","resource","point","coordinates","Google","serviceUrl","reverseQueryParams","geometry","viewport","northeast","southwest","formatted_address","properties","address_components","latlng","HERE","geocodeUrl","reverseGeocodeUrl","app_id","app_code","reverseGeocodeProxRadius","searchtext","gen","jsonattributes","_proxRadius","proxRadius","prox","mode","view","displayPosition","latitude","longitude","mapView","topLeft","bottomRight","label","LatLng","next","sizeInMeters","match","parseFloat","toBounds","Mapbox","access_token","proximity","features","slice","text","split","short_code","place_name","MapQuest","decodeURIComponent","_formatName","r","arguments","limit","outFormat","locations","street","adminArea4","adminArea3","adminArea1","outputFormat","Neutrino","userId","apiKey","found","Nominatim","htmlTemplate","className","a","parts","road","building","city","town","village","hamlet","state","country","q","format","addressdetails","boundingbox","icon","display_name","html","lon","zoom","Math","round","log","OpenLocationCode","codeLength","decoded","decode","latitudeCenter","longitudeCenter","latitudeLo","longitudeLo","latitudeHi","longitudeHi","console","warn","encode","OpenCage","annotations","formatted","Pelias","_apiKey","_lastSuggest","_this","api_key","_parseResults","geocoding","timestamp","point.lat","point.lon","bboxname","geoJson","pointToLayer","feature","circleMarker","onEachFeature","layer","getBounds","getCenter","getLatLng","GeoJSON","coordsToLatLng","pelias","GeocodeEarth","geocodeEarth","Mapzen","mapzen","Openrouteservice","Photon","reverseUrl","nameProperties","_decodeFeatures","c","_decodeFeatureName","map","p","filter","v","What3Words","addr","words","coords","Geocoder","Control","showUniqueResult","showResultIcons","collapsed","expand","position","placeholder","errorMessage","iconLabel","queryMinLength","suggestMinLength","suggestTimeout","defaultMarkGeocode","includes","Evented","prototype","Mixin","Events","geocoder","_requestCount","addThrobberClass","DomUtil","addClass","_container","removeThrobberClass","removeClass","onAdd","input","container","create","form","_form","_map","innerHTML","setAttribute","_input","DomEvent","disableClickPropagation","_errorElement","_alts","addListener","_keydown","_change","_preventBlurCollapse","_collapse","button","detail","_toggle","Browser","touch","preventDefault","stopPropagation","_expand","on","_geocode","markGeocode","setQuery","_geocodeResult","_geocodeResultSelected","_results","_createAlt","fitBounds","_geocodeMarker","removeLayer","Marker","bindPopup","addTo","openPopup","requestCount","eventData","_lastGeocode","_clearResults","fire","hasClass","select","blur","_selection","index","li","createTextNode","stop","dir","keyCode","parseInt","getAttribute","clearTimeout","_suggestTimeout","setTimeout","geocoders"],"mappings":";;;;;;;;kJACA,IAAIA,EAAiB,EAIjBC,EAAW,YACXC,EAAW,WACXC,EAAS,CACXC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,SACLC,IAAK,UAGP,SAASC,EAAWC,GAClB,OAAOR,EAAOQ,GAqBT,SAASC,EAAMC,EAAKC,EAAQC,EAAUC,EAASC,GACpD,IAAIC,EAAa,eAAiBlB,IAClCc,EAAOG,GAAc,YAAcC,EACnCC,OAAOD,GAAcE,EAAEC,KAAKC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C,SAAU,SAAS9Q,GAEN,SAAT+S,EAAyBO,GACnBzH,EAAMoH,aACRvU,EAAEgR,QAAQI,YAAYjE,EAAMoH,WAAY,qCACxCpH,EAAMoH,WAAapH,EAAMoH,WAAiB,EAANK,EAAU,cAAgB,oBAE3DzH,EAAMoH,aACTpH,EAAMoH,WAAapH,EAAM+E,MAAY,EAAN0C,EAAU,aAAe,cAGtDzH,EAAMoH,YACRvU,EAAEgR,QAAQC,SAAS9D,EAAMoH,WAAY,qCAX3C,IAAIpH,EAAQ3J,KAeZ,OAAQlC,EAAEuT,SAER,KAAK,GACCrR,KAAKL,QAAQ2M,UACftM,KAAK+O,YAEL/O,KAAK0Q,gBAEP,MAEF,KAAK,GACHG,GAAQ,GACR,MAEF,KAAK,GACHA,EAAO,GACP,MAEF,KAAK,GACH,GAAI7Q,KAAK+Q,WAAY,CACnB,IAAIC,EAAQM,SAAStR,KAAK+Q,WAAWQ,aAAa,qBAAsB,IACxEvR,KAAK6P,uBAAuB7P,KAAK8P,SAASkB,IAC1ChR,KAAK0Q,qBAEL1Q,KAAKyP,WAEP,MACF,QACE,OAGJjT,EAAE+R,SAASc,eAAevR,IAE5B+Q,QAAS,WACP,IAAIhD,EAAI7L,KAAKsO,OAAO7P,MAChBoN,IAAM7L,KAAKyQ,eACbe,aAAaxR,KAAKyR,iBACd5F,EAAEzM,QAAUY,KAAKL,QAAQkN,iBAC3B7M,KAAKyR,gBAAkBC,WACrBlV,EAAEE,KAAK,WACLsD,KAAKyP,UAAS,IACbzP,MACHA,KAAKL,QAAQmN,gBAGf9M,KAAK0Q,2BCtWblU,EAAEC,KAAKiD,OAAOwM,EAAUyF,GAGxBnV,EAAEC,KAAKiD,OAAOlD,EAAE2P,QAAS,CACvBD,SAAUA,EACVmB,SDuWK,SAAkB1N,GACvB,OAAO,IAAIuM,EAASvM"} \ No newline at end of file diff --git a/assets/control-geocoder/README.md b/assets/control-geocoder/README.md index ca58b2b..6fa2a62 100755 --- a/assets/control-geocoder/README.md +++ b/assets/control-geocoder/README.md @@ -6,28 +6,35 @@ I strongly believe that it is my — and your — duty to make the open While I can't force anyone to do anything, if you happen to disagree with this, I ask of you not to use any of the open source I have published. Nor am I interested in contributions from people who can't accept or act respectfully towards other humans regardless of gender identity, sexual orientation, disability, ethnicity, religion, age, physical appearance, body size, race, or similar personal characteristics. If you think feminism, anti-racism or the LGBT movement is somehow wrong, disturbing or irrelevant, I ask you to go elsewhere to find software. -Leaflet Control Geocoder [![NPM version](https://img.shields.io/npm/v/leaflet-control-geocoder.svg)](https://www.npmjs.com/package/leaflet-control-geocoder) ![Leaflet 1.0.0 compatible!](https://img.shields.io/badge/Leaflet%201.0.0-%E2%9C%93-1EB300.svg?style=flat) -============================= +# Leaflet Control Geocoder [![NPM version](https://img.shields.io/npm/v/leaflet-control-geocoder.svg)](https://www.npmjs.com/package/leaflet-control-geocoder) ![Leaflet 1.0.0 compatible!](https://img.shields.io/badge/Leaflet%201.0.0-%E2%9C%93-1EB300.svg?style=flat) -A simple geocoder for [Leaflet](http://leafletjs.com/) that by default uses [OSM](https://www.openstreetmap.org/)/[Nominatim](https://wiki.openstreetmap.org/wiki/Nominatim). +A simple geocoder for [Leaflet](https://leafletjs.com/) that by default uses [OSM](https://www.openstreetmap.org/)/[Nominatim](https://wiki.openstreetmap.org/wiki/Nominatim). The plugin supports many different data providers: -* [OSM](https://www.openstreetmap.org/)/[Nominatim](https://wiki.openstreetmap.org/wiki/Nominatim) -* [Bing Locations API](http://msdn.microsoft.com/en-us/library/ff701715.aspx) -* [Google Geocoding API](https://developers.google.com/maps/documentation/geocoding/) -* [Mapbox Geocoding](https://www.mapbox.com/developers/api/geocoding/) -* [MapQuest Geocoding API](http://developer.mapquest.com/web/products/dev-services/geocoding-ws) -* [What3Words](http://what3words.com/) -* [Photon](http://photon.komoot.de/) -* [Mapzen Search](https://mapzen.com/projects/search) -* [HERE Geocoder API](https://developer.here.com/documentation/geocoder/topics/introduction.html) +- LatLng to parse basic latitude/longitude strings +- [OSM](https://www.openstreetmap.org/)/[Nominatim](https://wiki.openstreetmap.org/wiki/Nominatim) +- [Bing Locations API](http://msdn.microsoft.com/en-us/library/ff701715.aspx) +- [Google Geocoding API](https://developers.google.com/maps/documentation/geocoding/) +- [Mapbox Geocoding](https://www.mapbox.com/api-documentation/#geocoding) +- [MapQuest Geocoding API](http://developer.mapquest.com/web/products/dev-services/geocoding-ws) +- [What3Words](http://what3words.com/) +- [Photon](http://photon.komoot.de/) +- [Pelias](https://pelias.io/), [geocode.earth](https://geocode.earth/) (formerly Mapzen Search), [Openrouteservice](https://openrouteservice.org/dev/#/api-docs/geocode) +- [HERE Geocoder API](https://developer.here.com/documentation/geocoder/topics/introduction.html) +- [Neutrino API](https://www.neutrinoapi.com/api/geocode-address/) +- [Plus codes](https://plus.codes/) (formerly OpenLocationCode) (requires [open-location-code](https://www.npmjs.com/package/open-location-code)) The plugin can easily be extended to support other providers. Current extensions: -* [DAWA Geocoder](https://github.com/kjoller/leaflet-control-geocoder-dawa/tree/new) - support for Danish Address Web API by [Niels Kjøller Hansen](https://github.com/kjoller) +- [DAWA Geocoder](https://github.com/kjoller/leaflet-control-geocoder-dawa/tree/new) - support for Danish Address Web API by [Niels Kjøller Hansen](https://github.com/kjoller) -See the [Leaflet Control Geocoder Demo](http://perliedman.github.com/leaflet-control-geocoder/). +# Demos + +- [Leaflet Control Geocoder Demo](https://www.liedman.net/leaflet-control-geocoder/) hosted on liedman.net +- See [demo/](https://github.com/perliedman/leaflet-control-geocoder/tree/master/demo) +- See [demo-rollup/](https://github.com/perliedman/leaflet-control-geocoder/tree/master/demo-rollup) using the [rollup.js](https://rollupjs.org/) bundler +- See [demo-webpack/](https://github.com/perliedman/leaflet-control-geocoder/tree/master/demo-rollup) using the [webpack](https://webpack.js.org/) bundler # Usage @@ -42,8 +49,8 @@ Add the control to a map instance: ```javascript var map = L.map('map').setView([0, 0], 2); -L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { - attribution: '© OpenStreetMap contributors' +L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors' }).addTo(map); L.Control.geocoder().addTo(map); ``` @@ -59,19 +66,19 @@ For example: ```javascript var geocoder = L.Control.geocoder({ - defaultMarkGeocode: false - }) - .on('markgeocode', function(e) { - var bbox = e.geocode.bbox; - var poly = L.polygon([ - bbox.getSouthEast(), - bbox.getNorthEast(), - bbox.getNorthWest(), - bbox.getSouthWest() - ]).addTo(map); - map.fitBounds(poly.getBounds()); - }) - .addTo(map); + defaultMarkGeocode: false +}) + .on('markgeocode', function(e) { + var bbox = e.geocode.bbox; + var poly = L.polygon([ + bbox.getSouthEast(), + bbox.getNorthEast(), + bbox.getNorthWest(), + bbox.getSouthWest() + ]).addTo(map); + map.fitBounds(poly.getBounds()); + }) + .addTo(map); ``` This will add a polygon representing the result's boundingbox when a result is selected. @@ -84,80 +91,129 @@ This is the geocoder control. It works like any other Leaflet control, and is ad ### Constructor -This plugin supports the standard JavaScript constructor (to be invoked using `new`) as well as the [class factory methods](http://leafletjs.com/reference.html#class-class-factories) known from Leaflet: +This plugin supports the standard JavaScript constructor (to be invoked using `new`) as well as the [class factory methods](https://leafletjs.com/reference.html#class-class-factories) known from Leaflet: ```js -new L.Control.Geocoder(options) +new L.Control.Geocoder(options); // or -L.Control.geocoder(options) +L.Control.geocoder(options); ``` ### Options -| Option | Type | Default | Description | -| ----------------- | ---------------- | ------------------- | ----------- | -| `collapsed` | Boolean | `true` | Collapse control unless hovered/clicked | -| `expand` | String | `"touch"` | How to expand a collapsed control: `touch` or `click` or `hover` | -| `position` | String | `"topright"` | Control [position](http://leafletjs.com/reference.html#control-positions) | -| `placeholder` | String | `"Search..."` | Placeholder text for text input -| `errorMessage` | String | `"Nothing found."` | Message when no result found / geocoding error occurs | -| `geocoder` | IGeocoder | `new L.Control.Geocoder.Nominatim()` | Object to perform the actual geocoding queries | -| `showResultIcons` | Boolean | `false` | Show icons for geocoding results (if available); supported by Nominatim | +| Option | Type | Default | Description | +| ------------------ | --------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------- | +| `collapsed` | Boolean | `true` | Collapse control unless hovered/clicked | +| `expand` | String | `"touch"` | How to expand a collapsed control: `touch` or `click` or `hover` | +| `position` | String | `"topright"` | Control [position](https://leafletjs.com/reference.html#control-positions) | +| `placeholder` | String | `"Search..."` | Placeholder text for text input | +| `errorMessage` | String | `"Nothing found."` | Message when no result found / geocoding error occurs | +| `iconLabel` | String | `"Initiate a new search"` | Accessibility label for the search icon used by screen readers | +| `geocoder` | IGeocoder | `new L.Control.Geocoder.Nominatim()` | Object to perform the actual geocoding queries | +| `showUniqueResult` | Boolean | `true` | Immediately show the unique result without prompting for alternatives | +| `showResultIcons` | Boolean | `false` | Show icons for geocoding results (if available); supported by Nominatim | +| `suggestMinLength` | Number | `3` | Minimum number characters before suggest functionality is used (if available from geocoder) | +| `suggestTimeout` | Number | `250` | Number of milliseconds after typing stopped before suggest functionality is used (if available from geocoder) | +| `query` | String | `""` | Initial query string for text input | +| `queryMinLength` | Number | `1` | Minimum number of characters in search text before performing a query | ### Methods -| Method | Returns | Description | -| ------------------------------------- | ------------------- | ----------------- | -| `markGeocode( result)` | `this` | Marks a geocoding result on the map | +| Method | Returns | Description | +| --------------------------------------- | ------- | --------------------------------------- | +| `markGeocode( result)` | `this` | Marks a geocoding result on the map | +| `setQuery( query)` | `this` | Sets the query string on the text input | ## L.Control.Geocoder.Nominatim Uses [Nominatim](https://wiki.openstreetmap.org/wiki/Nominatim) to respond to geocoding queries. This is the default -geocoding service used by the control, unless otherwise specified in the options. Implements ```IGeocoder```. +geocoding service used by the control, unless otherwise specified in the options. Implements `IGeocoder`. Unless using your own Nominatim installation, please refer to the [Nominatim usage policy](https://operations.osmfoundation.org/policies/nominatim/). ### Constructor ```js -new L.Control.Geocoder.Nominatim(options) +new L.Control.Geocoder.Nominatim(options); // or -L.Control.Geocoder.nominatim(options) +L.Control.Geocoder.nominatim(options); ``` -## Options +### Options -| Option | Type | Default | Description | -| --------------- | ---------------- | ----------------- | ----------- | -| `serviceUrl` | String | `"https://nominatim.openstreetmap.org/"` | URL of the service | -| `geocodingQueryParams` | Object | `{}` | Additional URL parameters (strings) that will be added to geocoding requests; can be used to restrict results to a specific country for example, by providing the [`countrycodes`](https://wiki.openstreetmap.org/wiki/Nominatim#Parameters) parameter to Nominatim | -| `reverseQueryParams` | Object | `{}` | Additional URL parameters (strings) that will be added to reverse geocoding requests | -| `htmlTemplate` | function | special | A function that takes an GeocodingResult as argument and returns an HTML formatted string that represents the result. Default function breaks up address in parts from most to least specific, in attempt to increase readability compared to Nominatim's naming +| Option | Type | Default | Description | +| ---------------------- | -------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `serviceUrl` | String | `"https://nominatim.openstreetmap.org/"` | URL of the service | +| `geocodingQueryParams` | Object | `{}` | Additional URL parameters (strings) that will be added to geocoding requests; can be used to restrict results to a specific country for example, by providing the [`countrycodes`](https://wiki.openstreetmap.org/wiki/Nominatim#Parameters) parameter to Nominatim | +| `reverseQueryParams` | Object | `{}` | Additional URL parameters (strings) that will be added to reverse geocoding requests | +| `htmlTemplate` | function | special | A function that takes an GeocodingResult as argument and returns an HTML formatted string that represents the result. Default function breaks up address in parts from most to least specific, in attempt to increase readability compared to Nominatim's naming | ## L.Control.Geocoder.Bing -Uses [Bing Locations API](http://msdn.microsoft.com/en-us/library/ff701715.aspx) to respond to geocoding queries. Implements ```IGeocoder```. +Uses [Bing Locations API](http://msdn.microsoft.com/en-us/library/ff701715.aspx) to respond to geocoding queries. Implements `IGeocoder`. Note that you need an API key to use this service. ### Constructor ```ts -new L.Control.Geocoder.Bing( key) +new L.Control.Geocoder.Bing(key); // or -L.Control.Geocoder.bing( key) +L.Control.Geocoder.bing(key); ``` +## L.Control.Geocoder.OpenCage + +Uses [OpenCage Data API](https://opencagedata.com/) to respond to geocoding queries. Implements `IGeocoder`. + +Note that you need an API key to use this service. + +### Constructor + +```ts +new L.Control.Geocoder.OpenCage(key, options); +// or +L.Control.Geocoder.opencage(key, options); +``` + +### Options + +| Option | Type | Default | Description | +| ---------------------- | ------ | ------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `serviceUrl` | String | `"https://api.opencagedata.com/geocode/v1/json"` | URL of the service | +| `geocodingQueryParams` | Object | `{}` | Additional URL parameters (strings) that will be added to geocoding requests | +| `reverseQueryParams` | Object | `{}` | Additional URL parameters (strings) that will be added to reverse geocoding requests | + +## L.Control.Geocoder.LatLng + +Parses basic latitude/longitude strings such as `'50.06773 14.37742'`, `'N50.06773 W14.37742'`, `'S 50° 04.064 E 014° 22.645'`, or `'S 50° 4′ 03.828″, W 14° 22′ 38.712″'`. + +### Constructor + +```ts +new L.Control.Geocoder.LatLng(options); +// or +L.Control.Geocoder.latLng(options); +``` + +### Options + +| Option | Type | Default | Description | +| -------------- | --------- | ------- | --------------------------------------------------------- | +| `next` | IGeocoder | | The next geocoder to use for non-supported queries. | +| `sizeInMeters` | Number | 10000 | The size in meters used for passing to `LatLng.toBounds`. | + ## IGeocoder An interface implemented to respond to geocoding queries. ### Methods -| Method | Returns | Description | -| ------------------------------------- | ------------------- | ----------------- | -| `geocode( query, callback, context)` | `GeocodingResult[]` | Performs a geocoding query and returns the results to the callback in the provided context | -| `reverse( location, scale, callback, context)` | `GeocodingResult[]` | Performs a reverse geocoding query and returns the results to the callback in the provided context | +| Method | Returns | Description | +| ----------------------------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `geocode( query, callback, context)` | `GeocodingResult[]` | Performs a geocoding query and returns the results to the callback in the provided context | +| `suggest( query, callback, context)` | `GeocodingResult[]` | Performs a geocoding query suggestion (this happens while typing) and returns the results to the callback in the provided context | +| `reverse( location, scale, callback, context)` | `GeocodingResult[]` | Performs a reverse geocoding query and returns the results to the callback in the provided context | ## GeocodingResult @@ -165,10 +221,10 @@ An object that represents a result from a geocoding query. ### Properties -| Property | Type | Description | -| ------------ | ---------------- | ------------------------------------- | -| `name` | String | Name of found location | -| `bbox` | L.LatLngBounds | The bounds of the location | -| `center` | L.LatLng | The center coordinate of the location | -| `icon` | String | URL for icon representing result; optional | -| `html` | String | (optional) HTML formatted representation of the name | +| Property | Type | Description | +| -------- | -------------- | ---------------------------------------------------- | +| `name` | String | Name of found location | +| `bbox` | L.LatLngBounds | The bounds of the location | +| `center` | L.LatLng | The center coordinate of the location | +| `icon` | String | URL for icon representing result; optional | +| `html` | String | (optional) HTML formatted representation of the name | diff --git a/assets/control-geocoder/package.json b/assets/control-geocoder/package.json index 605d863..fa9564c 100644 --- a/assets/control-geocoder/package.json +++ b/assets/control-geocoder/package.json @@ -1,40 +1,63 @@ { "name": "leaflet-control-geocoder", - "version": "1.6.0", - "description": "Extendable geocoder with builtin support for Nominatim, Bing, Google, Mapbox, Photon, What3Words, MapQuest, Mapzen, HERE", + "version": "1.13.0", + "description": "Extendable geocoder with builtin support for OpenStreetMap Nominatim, Bing, Google, Mapbox, MapQuest, What3Words, Photon, Pelias, HERE, Neutrino, Plus codes", "main": "dist/Control.Geocoder.js", + "module": "src/index.js", "scripts": { "prepare": "npm run build", - "build": "npm run build:js && npm run build:css && npm run build:img", - "build:js": "rollup --output.format=iife --name=L.Control.Geocoder --globals=leaflet:L src/index.js --output.file=dist/Control.Geocoder.js --sourcemap", - "build:css": "cpr Control.Geocoder.css dist/ --overwrite", + "build": "npm run build:js && npm run build:css && npm run build:img && npm run build:demo-rollup && npm run build:demo-webpack", + "build:js": "rollup -c", + "build:css": "cpr Control.Geocoder.css dist/Control.Geocoder.css --overwrite", "build:img": "cpr images/ dist/images/ --overwrite", - "test": "npm run lint", - "lint": "npm run lint:js && npm run lint:css", - "lint:js": "eslint 'src/**'", - "lint:css": "prettier --list-different '*.css'", - "publish": "sh ./scripts/publish.sh", - "postpublish": "sh ./scripts/postpublish.sh" + "build:demo-rollup": "cd demo-rollup && npm install && npm run build", + "build:demo-webpack": "cd demo-rollup && npm install && npm run build", + "test": "npm run test:karma -- --single-run && npm run lint", + "test:karma": "karma start spec/karma.conf.js", + "lint": "npm run lint:js && npm run lint:style", + "lint:js": "eslint .", + "lint:style": "prettier --check $(npm run ls-files)", + "fix:style": "prettier --write $(npm run ls-files)", + "ls-files": "git ls-files '*.js' '*.json' '*.css' '*.html' '*.yaml' '*.yml' '*.md'" }, "repository": { "type": "git", "url": "git://github.com/perliedman/leaflet-control-geocoder.git" }, + "files": [ + "LICENCE", + "dist/**", + "demo/**", + "images/**", + "src/**", + "*.css" + ], "keywords": [ "leaflet", "geocoder", "locations", + "openstreetmap", "nominatim", "bing", - "google", + "bingmaps", + "googlemaps", + "google-maps", "mapbox", - "photon", - "what3words", "mapquest", + "opencage", + "what3words", + "photon", "mapzen", - "here" + "pelias", + "here", + "neutrino", + "pluscodes", + "open location code" ], "author": "Per Liedman ", + "contributors": [ + "Simon Legner " + ], "license": "BSD-2-Clause", "bugs": { "url": "https://github.com/perliedman/leaflet-control-geocoder/issues" @@ -42,9 +65,23 @@ "dependencies": {}, "devDependencies": { "cpr": "^3.0.1", - "eslint": "^4.15.0", - "eslint-plugin-prettier": "^2.4.0", - "prettier": "^1.9.2", - "rollup": "^0.53.2" + "eslint": "^6.8.0", + "eslint-plugin-prettier": "^3.1.2", + "karma": "^4.4.1", + "karma-expect": "^1.1.3", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.4", + "karma-sinon": "^1.0.5", + "leaflet": "^1.6.0", + "mocha": "^6.2.2", + "phantomjs-prebuilt": "^2.1.16", + "prettier": "^1.19.1", + "rollup": "^0.65.2", + "rollup-plugin-uglify": "^5.0.2", + "sinon": "^7.5.0", + "uglify-js": "^3.7.5" + }, + "optionalDependencies": { + "open-location-code": "^1.0.0" } } diff --git a/module/config/config.php b/module/config/config.php index a4773cb..b071d23 100644 --- a/module/config/config.php +++ b/module/config/config.php @@ -75,7 +75,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-fullscreen'] = array $GLOBALS['LEAFLET_LIBRARIES']['leaflet-control-geocoder'] = array ( 'name' => 'Leaflet Control Geocoder', - 'version' => '1.6.0', + 'version' => '1.13.0', 'license' => 'BSD-2-Clause', 'homepage' => 'https://github.com/perliedman/leaflet-control-geocoder', 'css' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.min.css',