From 03b3331eda44c087400bd62bcc929d89fa5be966 Mon Sep 17 00:00:00 2001 From: Gavin Rehkemper Date: Thu, 23 Feb 2023 13:30:25 -0600 Subject: [PATCH] build 3.1.4 --- dist/esri-leaflet-geocoder-debug.js | 1325 +++++++++++++++++++++++ dist/esri-leaflet-geocoder-debug.js.map | 1 + dist/esri-leaflet-geocoder.css | 1 + dist/esri-leaflet-geocoder.css.map | 1 + dist/esri-leaflet-geocoder.js | 5 + dist/esri-leaflet-geocoder.js.map | 1 + dist/img/loading.gif | Bin 0 -> 1276 bytes dist/img/loading@2x.gif | Bin 0 -> 3973 bytes dist/img/search-disabled.png | Bin 0 -> 386 bytes dist/img/search.png | Bin 0 -> 425 bytes dist/img/search@2x-disabled.png | Bin 0 -> 386 bytes dist/img/search@2x.png | Bin 0 -> 772 bytes dist/siteData.json | 1 + 13 files changed, 1335 insertions(+) create mode 100644 dist/esri-leaflet-geocoder-debug.js create mode 100644 dist/esri-leaflet-geocoder-debug.js.map create mode 100644 dist/esri-leaflet-geocoder.css create mode 100644 dist/esri-leaflet-geocoder.css.map create mode 100644 dist/esri-leaflet-geocoder.js create mode 100644 dist/esri-leaflet-geocoder.js.map create mode 100644 dist/img/loading.gif create mode 100644 dist/img/loading@2x.gif create mode 100644 dist/img/search-disabled.png create mode 100644 dist/img/search.png create mode 100644 dist/img/search@2x-disabled.png create mode 100644 dist/img/search@2x.png create mode 100644 dist/siteData.json diff --git a/dist/esri-leaflet-geocoder-debug.js b/dist/esri-leaflet-geocoder-debug.js new file mode 100644 index 0000000..b761ef4 --- /dev/null +++ b/dist/esri-leaflet-geocoder-debug.js @@ -0,0 +1,1325 @@ +/* esri-leaflet-geocoder - v3.1.4 - Thu Feb 23 2023 13:29:24 GMT-0600 (Central Standard Time) + * Copyright (c) 2023 Environmental Systems Research Institute, Inc. + * Apache-2.0 */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('leaflet'), require('esri-leaflet')) : + typeof define === 'function' && define.amd ? define(['exports', 'leaflet', 'esri-leaflet'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.L = global.L || {}, global.L.esri = global.L.esri || {}, global.L.esri.Geocoding = {}), global.L, global.L.esri)); +})(this, (function (exports, leaflet, esriLeaflet) { 'use strict'; + + var version = "3.1.4"; + + var WorldGeocodingServiceUrl = 'https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/'; + + var Geocode = esriLeaflet.Task.extend({ + path: 'findAddressCandidates', + + params: { + outSr: 4326, + forStorage: false, + outFields: '*', + maxLocations: 20 + }, + + setters: { + address: 'address', + neighborhood: 'neighborhood', + city: 'city', + subregion: 'subregion', + region: 'region', + postal: 'postal', + country: 'country', + text: 'singleLine', + category: 'category', + token: 'token', + apikey: 'apikey', + key: 'magicKey', + fields: 'outFields', + forStorage: 'forStorage', + maxLocations: 'maxLocations', + // World Geocoding Service (only works with singleLine) + countries: 'sourceCountry' + }, + + initialize: function (options) { + options = options || {}; + options.url = options.url || WorldGeocodingServiceUrl; + esriLeaflet.Task.prototype.initialize.call(this, options); + }, + + within: function (bounds) { + bounds = leaflet.latLngBounds(bounds); + this.params.searchExtent = esriLeaflet.Util.boundsToExtent(bounds); + return this; + }, + + nearby: function (coords, radius) { + var centroid = leaflet.latLng(coords); + this.params.location = centroid.lng + ',' + centroid.lat; + if (radius) { + this.params.distance = Math.min(Math.max(radius, 2000), 50000); + } + return this; + }, + + run: function (callback, context) { + if (this.options.token) { + this.params.token = this.options.token; + } + if (this.options.apikey) { + this.params.token = this.options.apikey; + } + if (this.options.customParam) { + this.params[this.options.customParam] = this.params.singleLine; + delete this.params.singleLine; + } + + return this.request(function (error, response) { + var processor = this._processGeocoderResponse; + var results = (!error) ? processor(response) : undefined; + callback.call(context, error, { results: results }, response); + }, this); + }, + + _processGeocoderResponse: function (response) { + var results = []; + + for (var i = 0; i < response.candidates.length; i++) { + var candidate = response.candidates[i]; + if (candidate.extent) { + var bounds = esriLeaflet.Util.extentToBounds(candidate.extent); + } + + results.push({ + text: candidate.address, + bounds: bounds, + score: candidate.score, + latlng: leaflet.latLng(candidate.location.y, candidate.location.x), + properties: candidate.attributes + }); + } + return results; + } + }); + + function geocode (options) { + return new Geocode(options); + } + + var ReverseGeocode = esriLeaflet.Task.extend({ + path: 'reverseGeocode', + + params: { + outSR: 4326, + returnIntersection: false + }, + + setters: { + distance: 'distance', + language: 'langCode', + intersection: 'returnIntersection', + apikey: 'apikey' + }, + + initialize: function (options) { + options = options || {}; + options.url = options.url || WorldGeocodingServiceUrl; + esriLeaflet.Task.prototype.initialize.call(this, options); + }, + + latlng: function (coords) { + var centroid = leaflet.latLng(coords); + this.params.location = centroid.lng + ',' + centroid.lat; + return this; + }, + + run: function (callback, context) { + if (this.options.token) { + this.params.token = this.options.token; + } + if (this.options.apikey) { + this.params.token = this.options.apikey; + } + return this.request(function (error, response) { + var result; + + if (!error) { + result = { + latlng: leaflet.latLng(response.location.y, response.location.x), + address: response.address + }; + } else { + result = undefined; + } + + callback.call(context, error, result, response); + }, this); + } + }); + + function reverseGeocode (options) { + return new ReverseGeocode(options); + } + + var Suggest = esriLeaflet.Task.extend({ + path: 'suggest', + + params: {}, + + setters: { + text: 'text', + category: 'category', + countries: 'countryCode', + maxSuggestions: 'maxSuggestions' + }, + + initialize: function (options) { + options = options || {}; + if (!options.url) { + options.url = WorldGeocodingServiceUrl; + options.supportsSuggest = true; + } + esriLeaflet.Task.prototype.initialize.call(this, options); + }, + + within: function (bounds) { + bounds = leaflet.latLngBounds(bounds); + var center = bounds.getCenter(); + var ne = bounds.getNorthWest(); + this.params.location = center.lng + ',' + center.lat; + this.params.distance = Math.min(Math.max(center.distanceTo(ne), 2000), 50000); + this.params.searchExtent = esriLeaflet.Util.boundsToExtent(bounds); + return this; + }, + + nearby: function (coords, radius) { + var centroid = leaflet.latLng(coords); + this.params.location = centroid.lng + ',' + centroid.lat; + if (radius) { + this.params.distance = Math.min(Math.max(radius, 2000), 50000); + } + return this; + }, + + run: function (callback, context) { + if (this.options.supportsSuggest) { + return this.request(function (error, response) { + callback.call(context, error, response, response); + }, this); + } else { + console.warn('this geocoding service does not support asking for suggestions'); + } + } + + }); + + function suggest (options) { + return new Suggest(options); + } + + var GeocodeService = esriLeaflet.Service.extend({ + initialize: function (options) { + options = options || {}; + if (options.apikey) { + options.token = options.apikey; + } + if (options.url) { + esriLeaflet.Service.prototype.initialize.call(this, options); + this._confirmSuggestSupport(); + } else { + options.url = WorldGeocodingServiceUrl; + options.supportsSuggest = true; + esriLeaflet.Service.prototype.initialize.call(this, options); + } + }, + + geocode: function () { + return geocode(this); + }, + + reverse: function () { + return reverseGeocode(this); + }, + + suggest: function () { + // requires either the Esri World Geocoding Service or a <10.3 ArcGIS Server Geocoding Service that supports suggest. + return suggest(this); + }, + + _confirmSuggestSupport: function () { + this.metadata(function (error, response) { + if (error) { return; } + // pre 10.3 geocoding services dont list capabilities (and dont support maxLocations) + // only SOME individual services have been configured to support asking for suggestions + if (!response.capabilities) { + this.options.supportsSuggest = false; + } else if (response.capabilities.indexOf('Suggest') > -1) { + this.options.supportsSuggest = true; + } else { + this.options.supportsSuggest = false; + } + // whether the service supports suggest or not, utilize the metadata response to determine the appropriate parameter name for single line geocoding requests + this.options.customParam = response.singleLineAddressField.name; + }, this); + } + }); + + function geocodeService (options) { + return new GeocodeService(options); + } + + var GeosearchCore = leaflet.Evented.extend({ + + options: { + zoomToResult: true, + useMapBounds: 12, + searchBounds: null + }, + + initialize: function (control, options) { + leaflet.Util.setOptions(this, options); + this._control = control; + + if (!options || !options.providers || !options.providers.length) { + throw new Error('You must specify at least one provider'); + } + + this._providers = options.providers; + }, + + _geocode: function (text, key, provider) { + var activeRequests = 0; + var allResults = []; + var bounds; + + var callback = leaflet.Util.bind(function (error, results) { + activeRequests--; + if (error) { + return; + } + + if (results) { + allResults = allResults.concat(results); + } + + if (activeRequests <= 0) { + bounds = this._boundsFromResults(allResults); + + this.fire('results', { + results: allResults, + bounds: bounds, + latlng: (bounds) ? bounds.getCenter() : undefined, + text: text + }, true); + + if (this.options.zoomToResult && bounds) { + this._control._map.fitBounds(bounds); + } + + this.fire('load'); + } + }, this); + + if (key) { + activeRequests++; + provider.results(text, key, this._searchBounds(), callback); + } else { + for (var i = 0; i < this._providers.length; i++) { + activeRequests++; + this._providers[i].results(text, key, this._searchBounds(), callback); + } + } + }, + + _suggest: function (text) { + var activeRequests = this._providers.length; + var suggestionsLength = 0; + + var createCallback = leaflet.Util.bind(function (text, provider) { + return leaflet.Util.bind(function (error, suggestions) { + activeRequests = activeRequests - 1; + suggestionsLength += suggestions.length; + + if (error) { + // an error occurred for one of the providers' suggest requests + this._control._clearProviderSuggestions(provider); + + // perform additional cleanup when all requests are finished + this._control._finalizeSuggestions(activeRequests, suggestionsLength); + + return; + } + + if (suggestions.length) { + for (var i = 0; i < suggestions.length; i++) { + suggestions[i].provider = provider; + } + } else { + // we still need to update the UI + this._control._renderSuggestions(suggestions); + } + + if (provider._lastRender !== text) { + this._control._clearProviderSuggestions(provider); + } + + if (suggestions.length && this._control._input.value === text) { + provider._lastRender = text; + this._control._renderSuggestions(suggestions); + } + + // perform additional cleanup when all requests are finished + this._control._finalizeSuggestions(activeRequests, suggestionsLength); + }, this); + }, this); + + this._pendingSuggestions = []; + + for (var i = 0; i < this._providers.length; i++) { + var provider = this._providers[i]; + var request = provider.suggestions(text, this._searchBounds(), createCallback(text, provider)); + this._pendingSuggestions.push(request); + } + }, + + _searchBounds: function () { + if (this.options.searchBounds !== null) { + return this.options.searchBounds; + } + + if (this.options.useMapBounds === false) { + return null; + } + + if (this.options.useMapBounds === true) { + return this._control._map.getBounds(); + } + + if (this.options.useMapBounds <= this._control._map.getZoom()) { + return this._control._map.getBounds(); + } + + return null; + }, + + _boundsFromResults: function (results) { + if (!results.length) { + return; + } + + var nullIsland = leaflet.latLngBounds([0, 0], [0, 0]); + var resultBounds = []; + var resultLatlngs = []; + + // collect the bounds and center of each result + for (var i = results.length - 1; i >= 0; i--) { + var result = results[i]; + + resultLatlngs.push(result.latlng); + + // make sure bounds are valid and not 0,0. sometimes bounds are incorrect or not present + if (result.bounds && result.bounds.isValid() && !result.bounds.equals(nullIsland)) { + resultBounds.push(result.bounds); + } + } + + // form a bounds object containing all center points + var bounds = leaflet.latLngBounds(resultLatlngs); + + // and extend it to contain all bounds objects + for (var j = 0; j < resultBounds.length; j++) { + bounds.extend(resultBounds[j]); + } + + return bounds; + }, + + _getAttribution: function () { + var attribs = []; + var providers = this._providers; + + for (var i = 0; i < providers.length; i++) { + if (providers[i].options.attribution) { + attribs.push(providers[i].options.attribution); + } + } + + return attribs.join(', '); + } + + }); + + function geosearchCore (control, options) { + return new GeosearchCore(control, options); + } + + var ArcgisOnlineProvider = GeocodeService.extend({ + options: { + label: 'Places and Addresses', + maxResults: 5 + }, + + suggestions: function (text, bounds, callback) { + var request = this.suggest().text(text); + + if (bounds) { + request.within(bounds); + } + + if (this.options.nearby) { + // "distance"/"radius" is not supported by the ArcGIS Online Geocoder, + // so that is intentionally not passed here: + request.nearby(this.options.nearby); + } + + if (this.options.countries) { + request.countries(this.options.countries); + } + + if (this.options.categories) { + request.category(this.options.categories); + } + + // 15 is the maximum number of suggestions that can be returned + request.maxSuggestions(this.options.maxResults); + + return request.run(function (error, results, response) { + var suggestions = []; + if (!error) { + while (response.suggestions.length && suggestions.length <= (this.options.maxResults - 1)) { + var suggestion = response.suggestions.shift(); + if (!suggestion.isCollection) { + suggestions.push({ + text: suggestion.text, + unformattedText: suggestion.text, + magicKey: suggestion.magicKey + }); + } + } + } + callback(error, suggestions); + }, this); + }, + + results: function (text, key, bounds, callback) { + var request = this.geocode().text(text); + + if (key) { + request.key(key); + } + // in the future Address/StreetName geocoding requests that include a magicKey will always only return one match + request.maxLocations(this.options.maxResults); + + if (bounds) { + request.within(bounds); + } + + if (this.options.forStorage) { + request.forStorage(true); + } + + if (this.options.nearby) { + // "distance"/"radius" is not supported by the ArcGIS Online Geocoder, + // so that is intentionally not passed here: + request.nearby(this.options.nearby); + } + + if (this.options.countries) { + request.countries(this.options.countries); + } + + if (this.options.categories) { + request.category(this.options.categories); + } + + return request.run(function (error, response) { + callback(error, response.results); + }, this); + } + }); + + function arcgisOnlineProvider (options) { + return new ArcgisOnlineProvider(options); + } + + var Geosearch = leaflet.Control.extend({ + includes: leaflet.Evented.prototype, + + options: { + position: 'topleft', + collapseAfterResult: true, + expanded: false, + allowMultipleResults: true, + placeholder: 'Search for places or addresses', + title: 'Location Search' + }, + + initialize: function (options) { + leaflet.Util.setOptions(this, options); + + if (!options || !options.providers || !options.providers.length) { + if (!options) { + options = {}; + } + options.providers = [arcgisOnlineProvider()]; + } + + // instantiate the underlying class and pass along options + this._geosearchCore = geosearchCore(this, options); + this._geosearchCore._providers = options.providers; + + // bubble each providers events to the control + this._geosearchCore.addEventParent(this); + for (var i = 0; i < this._geosearchCore._providers.length; i++) { + this._geosearchCore._providers[i].addEventParent(this); + } + + this._geosearchCore._pendingSuggestions = []; + + leaflet.Control.prototype.initialize.call(this, options); + }, + + _renderSuggestions: function (suggestions) { + var currentGroup; + + if (suggestions.length > 0) { + this._suggestions.style.display = 'block'; + } + + var list; + var header; + var suggestionTextArray = []; + + for (var i = 0; i < suggestions.length; i++) { + var suggestion = suggestions[i]; + if (!header && this._geosearchCore._providers.length > 1 && currentGroup !== suggestion.provider.options.label) { + header = leaflet.DomUtil.create('div', 'geocoder-control-header', suggestion.provider._contentsElement); + header.textContent = suggestion.provider.options.label; + header.innerText = suggestion.provider.options.label; + currentGroup = suggestion.provider.options.label; + } + + if (!list) { + list = leaflet.DomUtil.create('ul', 'geocoder-control-list', suggestion.provider._contentsElement); + } + + if (suggestionTextArray.indexOf(suggestion.text) === -1) { + var suggestionItem = leaflet.DomUtil.create('li', 'geocoder-control-suggestion', list); + + suggestionItem.innerHTML = suggestion.text; + suggestionItem.provider = suggestion.provider; + suggestionItem['data-magic-key'] = suggestion.magicKey; + suggestionItem.unformattedText = suggestion.unformattedText; + } else { + for (var j = 0; j < list.childNodes.length; j++) { + // if the same text already appears in the list of suggestions, append an additional ObjectID to its magicKey instead + if (list.childNodes[j].innerHTML === suggestion.text) { + list.childNodes[j]['data-magic-key'] += ',' + suggestion.magicKey; + } + } + } + suggestionTextArray.push(suggestion.text); + } + + // when the geocoder position is either "topleft" or "topright": + // set the maxHeight of the suggestions box to: + // map height + // - suggestions offset (distance from top of suggestions to top of control) + // - control offset (distance from top of control to top of map) + // - 10 (extra padding) + if (this.getPosition().indexOf('top') > -1) { + this._suggestions.style.maxHeight = (this._map.getSize().y - this._suggestions.offsetTop - this._wrapper.offsetTop - 10) + 'px'; + } + + // when the geocoder position is either "bottomleft" or "bottomright": + // 1. set the maxHeight of the suggestions box to: + // map height + // - corner control container offsetHeight (height of container of bottom corner) + // - control offsetHeight (height of geocoder control wrapper, the main expandable button) + // 2. to move it up, set the top of the suggestions box to: + // negative offsetHeight of suggestions box (its own negative height now that it has children elements + // - control offsetHeight (height of geocoder control wrapper, the main expandable button) + // + 20 (extra spacing) + if (this.getPosition().indexOf('bottom') > -1) { + this._setSuggestionsBottomPosition(); + } + }, + + _setSuggestionsBottomPosition: function () { + this._suggestions.style.maxHeight = (this._map.getSize().y - this._map._controlCorners[this.getPosition()].offsetHeight - this._wrapper.offsetHeight) + 'px'; + this._suggestions.style.top = (-this._suggestions.offsetHeight - this._wrapper.offsetHeight + 20) + 'px'; + }, + + _boundsFromResults: function (results) { + if (!results.length) { + return; + } + + var nullIsland = leaflet.latLngBounds([0, 0], [0, 0]); + var resultBounds = []; + var resultLatlngs = []; + + // collect the bounds and center of each result + for (var i = results.length - 1; i >= 0; i--) { + var result = results[i]; + + resultLatlngs.push(result.latlng); + + // make sure bounds are valid and not 0,0. sometimes bounds are incorrect or not present + if (result.bounds && result.bounds.isValid() && !result.bounds.equals(nullIsland)) { + resultBounds.push(result.bounds); + } + } + + // form a bounds object containing all center points + var bounds = leaflet.latLngBounds(resultLatlngs); + + // and extend it to contain all bounds objects + for (var j = 0; j < resultBounds.length; j++) { + bounds.extend(resultBounds[j]); + } + + return bounds; + }, + + clear: function () { + this._clearAllSuggestions(); + + if (this.options.collapseAfterResult) { + this._input.value = ''; + this._lastValue = ''; + this._input.placeholder = ''; + leaflet.DomUtil.removeClass(this._wrapper, 'geocoder-control-expanded'); + } + + if (!this._map.scrollWheelZoom.enabled() && this._map.options.scrollWheelZoom) { + this._map.scrollWheelZoom.enable(); + } + }, + + _clearAllSuggestions: function () { + this._suggestions.style.display = 'none'; + + for (var i = 0; i < this.options.providers.length; i++) { + this._clearProviderSuggestions(this.options.providers[i]); + } + }, + + _clearProviderSuggestions: function (provider) { + provider._contentsElement.innerHTML = ''; + }, + + _finalizeSuggestions: function (activeRequests, suggestionsLength) { + // check if all requests are finished to remove the loading indicator + if (!activeRequests) { + leaflet.DomUtil.removeClass(this._input, 'geocoder-control-loading'); + + // when the geocoder position is either "bottomleft" or "bottomright", + // it is necessary in some cases to recalculate the maxHeight and top values of the this._suggestions element, + // even though this is also being done after each provider returns their own suggestions + if (this.getPosition().indexOf('bottom') > -1) { + this._setSuggestionsBottomPosition(); + } + + // also check if there were 0 total suggest results to clear the parent suggestions element + // otherwise its display value may be "block" instead of "none" + if (!suggestionsLength) { + this._clearAllSuggestions(); + } + } + }, + + _setupClick: function () { + leaflet.DomUtil.addClass(this._wrapper, 'geocoder-control-expanded'); + this._input.focus(); + }, + + disable: function () { + this._input.disabled = true; + leaflet.DomUtil.addClass(this._input, 'geocoder-control-input-disabled'); + leaflet.DomEvent.removeListener(this._wrapper, 'click', this._setupClick, this); + }, + + enable: function () { + this._input.disabled = false; + leaflet.DomUtil.removeClass(this._input, 'geocoder-control-input-disabled'); + leaflet.DomEvent.addListener(this._wrapper, 'click', this._setupClick, this); + }, + + getAttribution: function () { + var attribs = []; + + for (var i = 0; i < this._providers.length; i++) { + if (this._providers[i].options.attribution) { + attribs.push(this._providers[i].options.attribution); + } + } + + return attribs.join(', '); + }, + + geocodeSuggestion: function (e) { + var suggestionItem = e.target || e.srcElement; + + if ( + suggestionItem.classList.contains('geocoder-control-suggestions') || + suggestionItem.classList.contains('geocoder-control-header') + ) { + return; + } + + // make sure and point at the actual 'geocoder-control-suggestion' + if (suggestionItem.classList.length < 1) { + suggestionItem = suggestionItem.parentNode; + } + + this._geosearchCore._geocode(suggestionItem.unformattedText, suggestionItem['data-magic-key'], suggestionItem.provider); + this.clear(); + }, + + onAdd: function (map) { + // include 'Powered by Esri' in map attribution + esriLeaflet.Util.setEsriAttribution(map); + + this._map = map; + this._wrapper = leaflet.DomUtil.create('div', 'geocoder-control'); + this._input = leaflet.DomUtil.create('input', 'geocoder-control-input leaflet-bar', this._wrapper); + this._input.title = this.options.title; + + if (this.options.expanded) { + leaflet.DomUtil.addClass(this._wrapper, 'geocoder-control-expanded'); + this._input.placeholder = this.options.placeholder; + } + + // create the main suggested results container element + this._suggestions = leaflet.DomUtil.create('div', 'geocoder-control-suggestions leaflet-bar', this._wrapper); + + // create a child contents container element for each provider inside of this._suggestions + // to maintain the configured order of providers for suggested results + for (var i = 0; i < this.options.providers.length; i++) { + this.options.providers[i]._contentsElement = leaflet.DomUtil.create('div', null, this._suggestions); + } + + var credits = this._geosearchCore._getAttribution(); + + if (map.attributionControl) { + map.attributionControl.addAttribution(credits); + } + + leaflet.DomEvent.addListener(this._input, 'focus', function (e) { + this._input.placeholder = this.options.placeholder; + leaflet.DomUtil.addClass(this._wrapper, 'geocoder-control-expanded'); + }, this); + + leaflet.DomEvent.addListener(this._wrapper, 'click', this._setupClick, this); + + // make sure both click and touch spawn an address/poi search + leaflet.DomEvent.addListener(this._suggestions, 'mousedown', this.geocodeSuggestion, this); + + leaflet.DomEvent.addListener(this._input, 'blur', function (e) { + // TODO: this is too greedy and should not "clear" + // when trying to use the scrollbar or clicking on a non-suggestion item (such as a provider header) + this.clear(); + }, this); + + leaflet.DomEvent.addListener(this._input, 'keydown', function (e) { + var text = (e.target || e.srcElement).value; + + leaflet.DomUtil.addClass(this._wrapper, 'geocoder-control-expanded'); + + var list = this._suggestions.querySelectorAll('.' + 'geocoder-control-suggestion'); + var selected = this._suggestions.querySelectorAll('.' + 'geocoder-control-selected')[0]; + var selectedPosition; + + for (var i = 0; i < list.length; i++) { + if (list[i] === selected) { + selectedPosition = i; + break; + } + } + + switch (e.keyCode) { + case 13: + /* + if an item has been selected, geocode it + if focus is on the input textbox, geocode only if multiple results are allowed and more than two characters are present, or if a single suggestion is displayed. + if less than two characters have been typed, abort the geocode + */ + if (selected) { + this._input.value = selected.innerText; + this._geosearchCore._geocode(selected.unformattedText, selected['data-magic-key'], selected.provider); + this.clear(); + } else if (this.options.allowMultipleResults && text.length >= 2) { + this._geosearchCore._geocode(this._input.value, undefined); + this.clear(); + } else { + if (list.length === 1) { + leaflet.DomUtil.addClass(list[0], 'geocoder-control-selected'); + this._geosearchCore._geocode(list[0].innerHTML, list[0]['data-magic-key'], list[0].provider); + } else { + this.clear(); + this._input.blur(); + } + } + leaflet.DomEvent.preventDefault(e); + break; + case 38: + if (selected) { + leaflet.DomUtil.removeClass(selected, 'geocoder-control-selected'); + } + + var previousItem = list[selectedPosition - 1]; + + if (selected && previousItem) { + leaflet.DomUtil.addClass(previousItem, 'geocoder-control-selected'); + } else { + leaflet.DomUtil.addClass(list[list.length - 1], 'geocoder-control-selected'); + } + leaflet.DomEvent.preventDefault(e); + break; + case 40: + if (selected) { + leaflet.DomUtil.removeClass(selected, 'geocoder-control-selected'); + } + + var nextItem = list[selectedPosition + 1]; + + if (selected && nextItem) { + leaflet.DomUtil.addClass(nextItem, 'geocoder-control-selected'); + } else { + leaflet.DomUtil.addClass(list[0], 'geocoder-control-selected'); + } + leaflet.DomEvent.preventDefault(e); + break; + default: + // when the input changes we should cancel all pending suggestion requests if possible to avoid result collisions + for (var x = 0; x < this._geosearchCore._pendingSuggestions.length; x++) { + var request = this._geosearchCore._pendingSuggestions[x]; + if (request && request.abort && !request.id) { + request.abort(); + } + } + break; + } + }, this); + + leaflet.DomEvent.addListener(this._input, 'keyup', leaflet.Util.throttle(function (e) { + var key = e.which || e.keyCode; + var text = (e.target || e.srcElement).value; + + // require at least 2 characters for suggestions + if (text.length < 2) { + this._lastValue = this._input.value; + this._clearAllSuggestions(); + leaflet.DomUtil.removeClass(this._input, 'geocoder-control-loading'); + return; + } + + // if this is the escape key it will clear the input so clear suggestions + if (key === 27) { + this._clearAllSuggestions(); + return; + } + + // if this is NOT the up/down arrows or enter make a suggestion + if (key !== 13 && key !== 38 && key !== 40) { + if (this._input.value !== this._lastValue) { + this._lastValue = this._input.value; + leaflet.DomUtil.addClass(this._input, 'geocoder-control-loading'); + this._geosearchCore._suggest(text); + } + } + }, 50, this), this); + + leaflet.DomEvent.disableClickPropagation(this._wrapper); + + // when mouse moves over suggestions disable scroll wheel zoom if its enabled + leaflet.DomEvent.addListener(this._suggestions, 'mouseover', function (e) { + if (map.scrollWheelZoom.enabled() && map.options.scrollWheelZoom) { + map.scrollWheelZoom.disable(); + } + }); + + // when mouse moves leaves suggestions enable scroll wheel zoom if its disabled + leaflet.DomEvent.addListener(this._suggestions, 'mouseout', function (e) { + if (!map.scrollWheelZoom.enabled() && map.options.scrollWheelZoom) { + map.scrollWheelZoom.enable(); + } + }); + + this._geosearchCore.on('load', function (e) { + leaflet.DomUtil.removeClass(this._input, 'geocoder-control-loading'); + this.clear(); + this._input.blur(); + }, this); + + return this._wrapper; + } + }); + + function geosearch (options) { + return new Geosearch(options); + } + + var FeatureLayerProvider = esriLeaflet.FeatureLayerService.extend({ + options: { + label: 'Feature Layer', + maxResults: 5, + bufferRadius: 1000, + searchMode: 'contain', + formatSuggestion: function (feature) { + return feature.properties[this.options.searchFields[0]]; + } + }, + + initialize: function (options) { + if (options.apikey) { + options.token = options.apikey; + } + esriLeaflet.FeatureLayerService.prototype.initialize.call(this, options); + if (typeof this.options.searchFields === 'string') { + this.options.searchFields = [this.options.searchFields]; + } + this._suggestionsQuery = this.query(); + this._resultsQuery = this.query(); + }, + + suggestions: function (text, bounds, callback) { + var query = this._suggestionsQuery.where(this._buildQuery(text)) + .returnGeometry(false); + + if (bounds) { + query.intersects(bounds); + } + + if (this.options.idField) { + query.fields([this.options.idField].concat(this.options.searchFields)); + } + + var request = query.run(function (error, results, raw) { + if (error) { + callback(error, []); + } else { + this.options.idField = raw.objectIdFieldName; + var suggestions = []; + for (var i = results.features.length - 1; i >= 0; i--) { + var feature = results.features[i]; + suggestions.push({ + text: this.options.formatSuggestion.call(this, feature), + unformattedText: feature.properties[this.options.searchFields[0]], + magicKey: feature.id + }); + } + callback(error, suggestions.slice(0, this.options.maxResults)); + } + }, this); + + return request; + }, + + results: function (text, key, bounds, callback) { + var query = this._resultsQuery; + + if (key) { + // if there are 1 or more keys available, use query.featureIds() + delete query.params.where; + query.featureIds([key]); + } else { + // if there are no keys available, use query.where() + query.where(this._buildQuery(text)); + } + + if (bounds) { + query.within(bounds); + } + + return query.run(leaflet.Util.bind(function (error, features) { + var results = []; + for (var i = 0; i < features.features.length; i++) { + var feature = features.features[i]; + if (feature) { + var bounds = this._featureBounds(feature); + + var result = { + latlng: bounds.getCenter(), + bounds: bounds, + text: this.options.formatSuggestion.call(this, feature), + properties: feature.properties, + geojson: feature + }; + + results.push(result); + + // clear query parameters for the next search + delete this._resultsQuery.params['objectIds']; + } + } + callback(error, results); + }, this)); + }, + + orderBy: function (fieldName, order) { + this._suggestionsQuery.orderBy(fieldName, order); + }, + + _buildQuery: function (text) { + var queryString = []; + + for (var i = this.options.searchFields.length - 1; i >= 0; i--) { + var field = 'upper("' + this.options.searchFields[i] + '")'; + if (this.options.searchMode === 'contain') { + queryString.push(field + " LIKE upper('%" + text + "%')"); + } else if (this.options.searchMode === 'startWith') { + queryString.push(field + " LIKE upper('" + text + "%')"); + } else if (this.options.searchMode === 'endWith') { + queryString.push(field + " LIKE upper('%" + text + "')"); + } else if (this.options.searchMode === 'strict') { + queryString.push(field + " LIKE upper('" + text + "')"); + } else { + throw new Error('L.esri.Geocoding.featureLayerProvider: Invalid parameter for "searchMode". Use one of "contain", "startWith", "endWith", or "strict"'); + } + } + if (this.options.where) { + return this.options.where + ' AND (' + queryString.join(' OR ') + ')'; + } else { + return queryString.join(' OR '); + } + }, + + _featureBounds: function (feature) { + var geojson = leaflet.geoJson(feature); + if (feature.geometry.type === 'Point') { + var center = geojson.getBounds().getCenter(); + var lngRadius = ((this.options.bufferRadius / 40075017) * 360) / Math.cos((180 / Math.PI) * center.lat); + var latRadius = (this.options.bufferRadius / 40075017) * 360; + return leaflet.latLngBounds([center.lat - latRadius, center.lng - lngRadius], [center.lat + latRadius, center.lng + lngRadius]); + } else { + return geojson.getBounds(); + } + } + }); + + function featureLayerProvider (options) { + return new FeatureLayerProvider(options); + } + + var MapServiceProvider = esriLeaflet.MapService.extend({ + options: { + layers: [0], + label: 'Map Service', + bufferRadius: 1000, + maxResults: 5, + formatSuggestion: function (feature) { + return feature.properties[feature.displayFieldName] + ' ' + feature.layerName + ''; + } + }, + + initialize: function (options) { + if (options.apikey) { + options.token = options.apikey; + } + esriLeaflet.MapService.prototype.initialize.call(this, options); + this._getIdFields(); + }, + + suggestions: function (text, bounds, callback) { + var request = this.find().text(text).fields(this.options.searchFields).returnGeometry(false).layers(this.options.layers); + + return request.run(function (error, results, raw) { + var suggestions = []; + if (!error) { + var count = Math.min(this.options.maxResults, results.features.length); + raw.results = raw.results.reverse(); + for (var i = 0; i < count; i++) { + var feature = results.features[i]; + var result = raw.results[i]; + var layer = result.layerId; + var idField = this._idFields[layer]; + feature.layerId = layer; + feature.layerName = this._layerNames[layer]; + feature.displayFieldName = this._displayFields[layer]; + if (idField) { + suggestions.push({ + text: this.options.formatSuggestion.call(this, feature), + unformattedText: feature.properties[feature.displayFieldName], + magicKey: result.attributes[idField] + ':' + layer + }); + } + } + } + callback(error, suggestions.reverse()); + }, this); + }, + + results: function (text, key, bounds, callback) { + var results = []; + var request; + + if (key && !key.includes(',')) { + // if there is only 1 key available, use query() + var featureId = key.split(':')[0]; + var layer = key.split(':')[1]; + request = this.query().layer(layer).featureIds(featureId); + } else { + // if there are no keys or more than 1 keys available, use find() + request = this.find().text(text).fields(this.options.searchFields).layers(this.options.layers); + } + + return request.run(function (error, features, response) { + if (!error) { + if (response.results) { + response.results = response.results.reverse(); + } + for (var i = 0; i < features.features.length; i++) { + var feature = features.features[i]; + layer = layer || response.results[i].layerId; + + if (feature && layer !== undefined) { + var bounds = this._featureBounds(feature); + feature.layerId = layer; + feature.layerName = this._layerNames[layer]; + feature.displayFieldName = this._displayFields[layer]; + + var result = { + latlng: bounds.getCenter(), + bounds: bounds, + text: this.options.formatSuggestion.call(this, feature), + properties: feature.properties, + geojson: feature + }; + + results.push(result); + } + } + } + callback(error, results.reverse()); + }, this); + }, + + _featureBounds: function (feature) { + var geojson = leaflet.geoJson(feature); + if (feature.geometry.type === 'Point') { + var center = geojson.getBounds().getCenter(); + var lngRadius = ((this.options.bufferRadius / 40075017) * 360) / Math.cos((180 / Math.PI) * center.lat); + var latRadius = (this.options.bufferRadius / 40075017) * 360; + return leaflet.latLngBounds([center.lat - latRadius, center.lng - lngRadius], [center.lat + latRadius, center.lng + lngRadius]); + } else { + return geojson.getBounds(); + } + }, + + _layerMetadataCallback: function (layerid) { + return leaflet.Util.bind(function (error, metadata) { + if (error) { return; } + this._displayFields[layerid] = metadata.displayField; + this._layerNames[layerid] = metadata.name; + for (var i = 0; i < metadata.fields.length; i++) { + var field = metadata.fields[i]; + if (field.type === 'esriFieldTypeOID') { + this._idFields[layerid] = field.name; + break; + } + } + }, this); + }, + + _getIdFields: function () { + this._idFields = {}; + this._displayFields = {}; + this._layerNames = {}; + for (var i = 0; i < this.options.layers.length; i++) { + var layer = this.options.layers[i]; + this.get(layer, {}, this._layerMetadataCallback(layer)); + } + } + }); + + function mapServiceProvider (options) { + return new MapServiceProvider(options); + } + + var GeocodeServiceProvider = GeocodeService.extend({ + options: { + label: 'Geocode Server', + maxResults: 5 + }, + + suggestions: function (text, bounds, callback) { + if (this.options.supportsSuggest) { + var request = this.suggest().text(text); + if (bounds) { + request.within(bounds); + } + + return request.run(function (error, results, response) { + var suggestions = []; + if (!error) { + while (response.suggestions.length && suggestions.length <= (this.options.maxResults - 1)) { + var suggestion = response.suggestions.shift(); + if (!suggestion.isCollection) { + suggestions.push({ + text: suggestion.text, + unformattedText: suggestion.text, + magicKey: suggestion.magicKey + }); + } + } + } + callback(error, suggestions); + }, this); + } else { + callback(null, []); + return false; + } + }, + + results: function (text, key, bounds, callback) { + var request = this.geocode().text(text); + + if (key) { + request.key(key); + } + + request.maxLocations(this.options.maxResults); + + if (bounds) { + request.within(bounds); + } + + return request.run(function (error, response) { + callback(error, response.results); + }, this); + } + }); + + function geocodeServiceProvider (options) { + return new GeocodeServiceProvider(options); + } + + exports.ArcgisOnlineProvider = ArcgisOnlineProvider; + exports.FeatureLayerProvider = FeatureLayerProvider; + exports.Geocode = Geocode; + exports.GeocodeService = GeocodeService; + exports.GeocodeServiceProvider = GeocodeServiceProvider; + exports.Geosearch = Geosearch; + exports.GeosearchCore = GeosearchCore; + exports.MapServiceProvider = MapServiceProvider; + exports.ReverseGeocode = ReverseGeocode; + exports.Suggest = Suggest; + exports.VERSION = version; + exports.WorldGeocodingServiceUrl = WorldGeocodingServiceUrl; + exports.arcgisOnlineProvider = arcgisOnlineProvider; + exports.featureLayerProvider = featureLayerProvider; + exports.geocode = geocode; + exports.geocodeService = geocodeService; + exports.geocodeServiceProvider = geocodeServiceProvider; + exports.geosearch = geosearch; + exports.geosearchCore = geosearchCore; + exports.mapServiceProvider = mapServiceProvider; + exports.reverseGeocode = reverseGeocode; + exports.suggest = suggest; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=esri-leaflet-geocoder-debug.js.map diff --git a/dist/esri-leaflet-geocoder-debug.js.map b/dist/esri-leaflet-geocoder-debug.js.map new file mode 100644 index 0000000..fb87445 --- /dev/null +++ b/dist/esri-leaflet-geocoder-debug.js.map @@ -0,0 +1 @@ +{"version":3,"file":"esri-leaflet-geocoder-debug.js","sources":["../src/helper.js","../src/Tasks/Geocode.js","../src/Tasks/ReverseGeocode.js","../src/Tasks/Suggest.js","../src/Services/Geocode.js","../src/Classes/GeosearchCore.js","../src/Providers/ArcgisOnlineGeocoder.js","../src/Controls/Geosearch.js","../src/Providers/FeatureLayer.js","../src/Providers/MapService.js","../src/Providers/GeocodeService.js"],"sourcesContent":["export var WorldGeocodingServiceUrl = 'https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/';\r\n","import {\r\n latLng,\r\n latLngBounds\r\n} from 'leaflet';\r\nimport { Task, Util as EsriUtil } from 'esri-leaflet';\r\nimport { WorldGeocodingServiceUrl } from '../helper';\r\n\r\nexport var Geocode = Task.extend({\r\n path: 'findAddressCandidates',\r\n\r\n params: {\r\n outSr: 4326,\r\n forStorage: false,\r\n outFields: '*',\r\n maxLocations: 20\r\n },\r\n\r\n setters: {\r\n address: 'address',\r\n neighborhood: 'neighborhood',\r\n city: 'city',\r\n subregion: 'subregion',\r\n region: 'region',\r\n postal: 'postal',\r\n country: 'country',\r\n text: 'singleLine',\r\n category: 'category',\r\n token: 'token',\r\n apikey: 'apikey',\r\n key: 'magicKey',\r\n fields: 'outFields',\r\n forStorage: 'forStorage',\r\n maxLocations: 'maxLocations',\r\n // World Geocoding Service (only works with singleLine)\r\n countries: 'sourceCountry'\r\n },\r\n\r\n initialize: function (options) {\r\n options = options || {};\r\n options.url = options.url || WorldGeocodingServiceUrl;\r\n Task.prototype.initialize.call(this, options);\r\n },\r\n\r\n within: function (bounds) {\r\n bounds = latLngBounds(bounds);\r\n this.params.searchExtent = EsriUtil.boundsToExtent(bounds);\r\n return this;\r\n },\r\n\r\n nearby: function (coords, radius) {\r\n var centroid = latLng(coords);\r\n this.params.location = centroid.lng + ',' + centroid.lat;\r\n if (radius) {\r\n this.params.distance = Math.min(Math.max(radius, 2000), 50000);\r\n }\r\n return this;\r\n },\r\n\r\n run: function (callback, context) {\r\n if (this.options.token) {\r\n this.params.token = this.options.token;\r\n }\r\n if (this.options.apikey) {\r\n this.params.token = this.options.apikey;\r\n }\r\n if (this.options.customParam) {\r\n this.params[this.options.customParam] = this.params.singleLine;\r\n delete this.params.singleLine;\r\n }\r\n\r\n return this.request(function (error, response) {\r\n var processor = this._processGeocoderResponse;\r\n var results = (!error) ? processor(response) : undefined;\r\n callback.call(context, error, { results: results }, response);\r\n }, this);\r\n },\r\n\r\n _processGeocoderResponse: function (response) {\r\n var results = [];\r\n\r\n for (var i = 0; i < response.candidates.length; i++) {\r\n var candidate = response.candidates[i];\r\n if (candidate.extent) {\r\n var bounds = EsriUtil.extentToBounds(candidate.extent);\r\n }\r\n\r\n results.push({\r\n text: candidate.address,\r\n bounds: bounds,\r\n score: candidate.score,\r\n latlng: latLng(candidate.location.y, candidate.location.x),\r\n properties: candidate.attributes\r\n });\r\n }\r\n return results;\r\n }\r\n});\r\n\r\nexport function geocode (options) {\r\n return new Geocode(options);\r\n}\r\n\r\nexport default geocode;\r\n","import { latLng } from 'leaflet';\r\nimport { Task } from 'esri-leaflet';\r\nimport { WorldGeocodingServiceUrl } from '../helper';\r\n\r\nexport var ReverseGeocode = Task.extend({\r\n path: 'reverseGeocode',\r\n\r\n params: {\r\n outSR: 4326,\r\n returnIntersection: false\r\n },\r\n\r\n setters: {\r\n distance: 'distance',\r\n language: 'langCode',\r\n intersection: 'returnIntersection',\r\n apikey: 'apikey'\r\n },\r\n\r\n initialize: function (options) {\r\n options = options || {};\r\n options.url = options.url || WorldGeocodingServiceUrl;\r\n Task.prototype.initialize.call(this, options);\r\n },\r\n\r\n latlng: function (coords) {\r\n var centroid = latLng(coords);\r\n this.params.location = centroid.lng + ',' + centroid.lat;\r\n return this;\r\n },\r\n\r\n run: function (callback, context) {\r\n if (this.options.token) {\r\n this.params.token = this.options.token;\r\n }\r\n if (this.options.apikey) {\r\n this.params.token = this.options.apikey;\r\n }\r\n return this.request(function (error, response) {\r\n var result;\r\n\r\n if (!error) {\r\n result = {\r\n latlng: latLng(response.location.y, response.location.x),\r\n address: response.address\r\n };\r\n } else {\r\n result = undefined;\r\n }\r\n\r\n callback.call(context, error, result, response);\r\n }, this);\r\n }\r\n});\r\n\r\nexport function reverseGeocode (options) {\r\n return new ReverseGeocode(options);\r\n}\r\n\r\nexport default reverseGeocode;\r\n","import {\r\n latLng,\r\n latLngBounds\r\n} from 'leaflet';\r\nimport { Task, Util as EsriUtil } from 'esri-leaflet';\r\nimport { WorldGeocodingServiceUrl } from '../helper';\r\n\r\nexport var Suggest = Task.extend({\r\n path: 'suggest',\r\n\r\n params: {},\r\n\r\n setters: {\r\n text: 'text',\r\n category: 'category',\r\n countries: 'countryCode',\r\n maxSuggestions: 'maxSuggestions'\r\n },\r\n\r\n initialize: function (options) {\r\n options = options || {};\r\n if (!options.url) {\r\n options.url = WorldGeocodingServiceUrl;\r\n options.supportsSuggest = true;\r\n }\r\n Task.prototype.initialize.call(this, options);\r\n },\r\n\r\n within: function (bounds) {\r\n bounds = latLngBounds(bounds);\r\n var center = bounds.getCenter();\r\n var ne = bounds.getNorthWest();\r\n this.params.location = center.lng + ',' + center.lat;\r\n this.params.distance = Math.min(Math.max(center.distanceTo(ne), 2000), 50000);\r\n this.params.searchExtent = EsriUtil.boundsToExtent(bounds);\r\n return this;\r\n },\r\n\r\n nearby: function (coords, radius) {\r\n var centroid = latLng(coords);\r\n this.params.location = centroid.lng + ',' + centroid.lat;\r\n if (radius) {\r\n this.params.distance = Math.min(Math.max(radius, 2000), 50000);\r\n }\r\n return this;\r\n },\r\n\r\n run: function (callback, context) {\r\n if (this.options.supportsSuggest) {\r\n return this.request(function (error, response) {\r\n callback.call(context, error, response, response);\r\n }, this);\r\n } else {\r\n console.warn('this geocoding service does not support asking for suggestions');\r\n }\r\n }\r\n\r\n});\r\n\r\nexport function suggest (options) {\r\n return new Suggest(options);\r\n}\r\n\r\nexport default suggest;\r\n","import { Service } from 'esri-leaflet';\r\nimport { WorldGeocodingServiceUrl } from '../helper';\r\nimport geocode from '../Tasks/Geocode';\r\nimport reverseGeocode from '../Tasks/ReverseGeocode';\r\nimport suggest from '../Tasks/Suggest';\r\n\r\nexport var GeocodeService = Service.extend({\r\n initialize: function (options) {\r\n options = options || {};\r\n if (options.apikey) {\r\n options.token = options.apikey;\r\n }\r\n if (options.url) {\r\n Service.prototype.initialize.call(this, options);\r\n this._confirmSuggestSupport();\r\n } else {\r\n options.url = WorldGeocodingServiceUrl;\r\n options.supportsSuggest = true;\r\n Service.prototype.initialize.call(this, options);\r\n }\r\n },\r\n\r\n geocode: function () {\r\n return geocode(this);\r\n },\r\n\r\n reverse: function () {\r\n return reverseGeocode(this);\r\n },\r\n\r\n suggest: function () {\r\n // requires either the Esri World Geocoding Service or a <10.3 ArcGIS Server Geocoding Service that supports suggest.\r\n return suggest(this);\r\n },\r\n\r\n _confirmSuggestSupport: function () {\r\n this.metadata(function (error, response) {\r\n if (error) { return; }\r\n // pre 10.3 geocoding services dont list capabilities (and dont support maxLocations)\r\n // only SOME individual services have been configured to support asking for suggestions\r\n if (!response.capabilities) {\r\n this.options.supportsSuggest = false;\r\n } else if (response.capabilities.indexOf('Suggest') > -1) {\r\n this.options.supportsSuggest = true;\r\n } else {\r\n this.options.supportsSuggest = false;\r\n }\r\n // whether the service supports suggest or not, utilize the metadata response to determine the appropriate parameter name for single line geocoding requests\r\n this.options.customParam = response.singleLineAddressField.name;\r\n }, this);\r\n }\r\n});\r\n\r\nexport function geocodeService (options) {\r\n return new GeocodeService(options);\r\n}\r\n\r\nexport default geocodeService;\r\n","import { Evented, Util, latLngBounds } from 'leaflet';\r\n\r\nexport var GeosearchCore = Evented.extend({\r\n\r\n options: {\r\n zoomToResult: true,\r\n useMapBounds: 12,\r\n searchBounds: null\r\n },\r\n\r\n initialize: function (control, options) {\r\n Util.setOptions(this, options);\r\n this._control = control;\r\n\r\n if (!options || !options.providers || !options.providers.length) {\r\n throw new Error('You must specify at least one provider');\r\n }\r\n\r\n this._providers = options.providers;\r\n },\r\n\r\n _geocode: function (text, key, provider) {\r\n var activeRequests = 0;\r\n var allResults = [];\r\n var bounds;\r\n\r\n var callback = Util.bind(function (error, results) {\r\n activeRequests--;\r\n if (error) {\r\n return;\r\n }\r\n\r\n if (results) {\r\n allResults = allResults.concat(results);\r\n }\r\n\r\n if (activeRequests <= 0) {\r\n bounds = this._boundsFromResults(allResults);\r\n\r\n this.fire('results', {\r\n results: allResults,\r\n bounds: bounds,\r\n latlng: (bounds) ? bounds.getCenter() : undefined,\r\n text: text\r\n }, true);\r\n\r\n if (this.options.zoomToResult && bounds) {\r\n this._control._map.fitBounds(bounds);\r\n }\r\n\r\n this.fire('load');\r\n }\r\n }, this);\r\n\r\n if (key) {\r\n activeRequests++;\r\n provider.results(text, key, this._searchBounds(), callback);\r\n } else {\r\n for (var i = 0; i < this._providers.length; i++) {\r\n activeRequests++;\r\n this._providers[i].results(text, key, this._searchBounds(), callback);\r\n }\r\n }\r\n },\r\n\r\n _suggest: function (text) {\r\n var activeRequests = this._providers.length;\r\n var suggestionsLength = 0;\r\n\r\n var createCallback = Util.bind(function (text, provider) {\r\n return Util.bind(function (error, suggestions) {\r\n activeRequests = activeRequests - 1;\r\n suggestionsLength += suggestions.length;\r\n\r\n if (error) {\r\n // an error occurred for one of the providers' suggest requests\r\n this._control._clearProviderSuggestions(provider);\r\n\r\n // perform additional cleanup when all requests are finished\r\n this._control._finalizeSuggestions(activeRequests, suggestionsLength);\r\n\r\n return;\r\n }\r\n\r\n if (suggestions.length) {\r\n for (var i = 0; i < suggestions.length; i++) {\r\n suggestions[i].provider = provider;\r\n }\r\n } else {\r\n // we still need to update the UI\r\n this._control._renderSuggestions(suggestions);\r\n }\r\n\r\n if (provider._lastRender !== text) {\r\n this._control._clearProviderSuggestions(provider);\r\n }\r\n\r\n if (suggestions.length && this._control._input.value === text) {\r\n provider._lastRender = text;\r\n this._control._renderSuggestions(suggestions);\r\n }\r\n\r\n // perform additional cleanup when all requests are finished\r\n this._control._finalizeSuggestions(activeRequests, suggestionsLength);\r\n }, this);\r\n }, this);\r\n\r\n this._pendingSuggestions = [];\r\n\r\n for (var i = 0; i < this._providers.length; i++) {\r\n var provider = this._providers[i];\r\n var request = provider.suggestions(text, this._searchBounds(), createCallback(text, provider));\r\n this._pendingSuggestions.push(request);\r\n }\r\n },\r\n\r\n _searchBounds: function () {\r\n if (this.options.searchBounds !== null) {\r\n return this.options.searchBounds;\r\n }\r\n\r\n if (this.options.useMapBounds === false) {\r\n return null;\r\n }\r\n\r\n if (this.options.useMapBounds === true) {\r\n return this._control._map.getBounds();\r\n }\r\n\r\n if (this.options.useMapBounds <= this._control._map.getZoom()) {\r\n return this._control._map.getBounds();\r\n }\r\n\r\n return null;\r\n },\r\n\r\n _boundsFromResults: function (results) {\r\n if (!results.length) {\r\n return;\r\n }\r\n\r\n var nullIsland = latLngBounds([0, 0], [0, 0]);\r\n var resultBounds = [];\r\n var resultLatlngs = [];\r\n\r\n // collect the bounds and center of each result\r\n for (var i = results.length - 1; i >= 0; i--) {\r\n var result = results[i];\r\n\r\n resultLatlngs.push(result.latlng);\r\n\r\n // make sure bounds are valid and not 0,0. sometimes bounds are incorrect or not present\r\n if (result.bounds && result.bounds.isValid() && !result.bounds.equals(nullIsland)) {\r\n resultBounds.push(result.bounds);\r\n }\r\n }\r\n\r\n // form a bounds object containing all center points\r\n var bounds = latLngBounds(resultLatlngs);\r\n\r\n // and extend it to contain all bounds objects\r\n for (var j = 0; j < resultBounds.length; j++) {\r\n bounds.extend(resultBounds[j]);\r\n }\r\n\r\n return bounds;\r\n },\r\n\r\n _getAttribution: function () {\r\n var attribs = [];\r\n var providers = this._providers;\r\n\r\n for (var i = 0; i < providers.length; i++) {\r\n if (providers[i].options.attribution) {\r\n attribs.push(providers[i].options.attribution);\r\n }\r\n }\r\n\r\n return attribs.join(', ');\r\n }\r\n\r\n});\r\n\r\nexport function geosearchCore (control, options) {\r\n return new GeosearchCore(control, options);\r\n}\r\n\r\nexport default geosearchCore;\r\n","import { GeocodeService } from '../Services/Geocode';\r\n\r\nexport var ArcgisOnlineProvider = GeocodeService.extend({\r\n options: {\r\n label: 'Places and Addresses',\r\n maxResults: 5\r\n },\r\n\r\n suggestions: function (text, bounds, callback) {\r\n var request = this.suggest().text(text);\r\n\r\n if (bounds) {\r\n request.within(bounds);\r\n }\r\n\r\n if (this.options.nearby) {\r\n // \"distance\"/\"radius\" is not supported by the ArcGIS Online Geocoder,\r\n // so that is intentionally not passed here:\r\n request.nearby(this.options.nearby);\r\n }\r\n\r\n if (this.options.countries) {\r\n request.countries(this.options.countries);\r\n }\r\n\r\n if (this.options.categories) {\r\n request.category(this.options.categories);\r\n }\r\n\r\n // 15 is the maximum number of suggestions that can be returned\r\n request.maxSuggestions(this.options.maxResults);\r\n\r\n return request.run(function (error, results, response) {\r\n var suggestions = [];\r\n if (!error) {\r\n while (response.suggestions.length && suggestions.length <= (this.options.maxResults - 1)) {\r\n var suggestion = response.suggestions.shift();\r\n if (!suggestion.isCollection) {\r\n suggestions.push({\r\n text: suggestion.text,\r\n unformattedText: suggestion.text,\r\n magicKey: suggestion.magicKey\r\n });\r\n }\r\n }\r\n }\r\n callback(error, suggestions);\r\n }, this);\r\n },\r\n\r\n results: function (text, key, bounds, callback) {\r\n var request = this.geocode().text(text);\r\n\r\n if (key) {\r\n request.key(key);\r\n }\r\n // in the future Address/StreetName geocoding requests that include a magicKey will always only return one match\r\n request.maxLocations(this.options.maxResults);\r\n\r\n if (bounds) {\r\n request.within(bounds);\r\n }\r\n\r\n if (this.options.forStorage) {\r\n request.forStorage(true);\r\n }\r\n\r\n if (this.options.nearby) {\r\n // \"distance\"/\"radius\" is not supported by the ArcGIS Online Geocoder,\r\n // so that is intentionally not passed here:\r\n request.nearby(this.options.nearby);\r\n }\r\n\r\n if (this.options.countries) {\r\n request.countries(this.options.countries);\r\n }\r\n\r\n if (this.options.categories) {\r\n request.category(this.options.categories);\r\n }\r\n\r\n return request.run(function (error, response) {\r\n callback(error, response.results);\r\n }, this);\r\n }\r\n});\r\n\r\nexport function arcgisOnlineProvider (options) {\r\n return new ArcgisOnlineProvider(options);\r\n}\r\n\r\nexport default arcgisOnlineProvider;\r\n","import {\r\n Control,\r\n DomEvent,\r\n DomUtil,\r\n Evented,\r\n Util,\r\n latLngBounds\r\n} from 'leaflet';\r\nimport { geosearchCore } from '../Classes/GeosearchCore';\r\nimport { arcgisOnlineProvider } from '../Providers/ArcgisOnlineGeocoder';\r\nimport { Util as EsriUtil } from 'esri-leaflet';\r\n\r\nexport var Geosearch = Control.extend({\r\n includes: Evented.prototype,\r\n\r\n options: {\r\n position: 'topleft',\r\n collapseAfterResult: true,\r\n expanded: false,\r\n allowMultipleResults: true,\r\n placeholder: 'Search for places or addresses',\r\n title: 'Location Search'\r\n },\r\n\r\n initialize: function (options) {\r\n Util.setOptions(this, options);\r\n\r\n if (!options || !options.providers || !options.providers.length) {\r\n if (!options) {\r\n options = {};\r\n }\r\n options.providers = [arcgisOnlineProvider()];\r\n }\r\n\r\n // instantiate the underlying class and pass along options\r\n this._geosearchCore = geosearchCore(this, options);\r\n this._geosearchCore._providers = options.providers;\r\n\r\n // bubble each providers events to the control\r\n this._geosearchCore.addEventParent(this);\r\n for (var i = 0; i < this._geosearchCore._providers.length; i++) {\r\n this._geosearchCore._providers[i].addEventParent(this);\r\n }\r\n\r\n this._geosearchCore._pendingSuggestions = [];\r\n\r\n Control.prototype.initialize.call(this, options);\r\n },\r\n\r\n _renderSuggestions: function (suggestions) {\r\n var currentGroup;\r\n\r\n if (suggestions.length > 0) {\r\n this._suggestions.style.display = 'block';\r\n }\r\n\r\n var list;\r\n var header;\r\n var suggestionTextArray = [];\r\n\r\n for (var i = 0; i < suggestions.length; i++) {\r\n var suggestion = suggestions[i];\r\n if (!header && this._geosearchCore._providers.length > 1 && currentGroup !== suggestion.provider.options.label) {\r\n header = DomUtil.create('div', 'geocoder-control-header', suggestion.provider._contentsElement);\r\n header.textContent = suggestion.provider.options.label;\r\n header.innerText = suggestion.provider.options.label;\r\n currentGroup = suggestion.provider.options.label;\r\n }\r\n\r\n if (!list) {\r\n list = DomUtil.create('ul', 'geocoder-control-list', suggestion.provider._contentsElement);\r\n }\r\n\r\n if (suggestionTextArray.indexOf(suggestion.text) === -1) {\r\n var suggestionItem = DomUtil.create('li', 'geocoder-control-suggestion', list);\r\n\r\n suggestionItem.innerHTML = suggestion.text;\r\n suggestionItem.provider = suggestion.provider;\r\n suggestionItem['data-magic-key'] = suggestion.magicKey;\r\n suggestionItem.unformattedText = suggestion.unformattedText;\r\n } else {\r\n for (var j = 0; j < list.childNodes.length; j++) {\r\n // if the same text already appears in the list of suggestions, append an additional ObjectID to its magicKey instead\r\n if (list.childNodes[j].innerHTML === suggestion.text) {\r\n list.childNodes[j]['data-magic-key'] += ',' + suggestion.magicKey;\r\n }\r\n }\r\n }\r\n suggestionTextArray.push(suggestion.text);\r\n }\r\n\r\n // when the geocoder position is either \"topleft\" or \"topright\":\r\n // set the maxHeight of the suggestions box to:\r\n // map height\r\n // - suggestions offset (distance from top of suggestions to top of control)\r\n // - control offset (distance from top of control to top of map)\r\n // - 10 (extra padding)\r\n if (this.getPosition().indexOf('top') > -1) {\r\n this._suggestions.style.maxHeight = (this._map.getSize().y - this._suggestions.offsetTop - this._wrapper.offsetTop - 10) + 'px';\r\n }\r\n\r\n // when the geocoder position is either \"bottomleft\" or \"bottomright\":\r\n // 1. set the maxHeight of the suggestions box to:\r\n // map height\r\n // - corner control container offsetHeight (height of container of bottom corner)\r\n // - control offsetHeight (height of geocoder control wrapper, the main expandable button)\r\n // 2. to move it up, set the top of the suggestions box to:\r\n // negative offsetHeight of suggestions box (its own negative height now that it has children elements\r\n // - control offsetHeight (height of geocoder control wrapper, the main expandable button)\r\n // + 20 (extra spacing)\r\n if (this.getPosition().indexOf('bottom') > -1) {\r\n this._setSuggestionsBottomPosition();\r\n }\r\n },\r\n\r\n _setSuggestionsBottomPosition: function () {\r\n this._suggestions.style.maxHeight = (this._map.getSize().y - this._map._controlCorners[this.getPosition()].offsetHeight - this._wrapper.offsetHeight) + 'px';\r\n this._suggestions.style.top = (-this._suggestions.offsetHeight - this._wrapper.offsetHeight + 20) + 'px';\r\n },\r\n\r\n _boundsFromResults: function (results) {\r\n if (!results.length) {\r\n return;\r\n }\r\n\r\n var nullIsland = latLngBounds([0, 0], [0, 0]);\r\n var resultBounds = [];\r\n var resultLatlngs = [];\r\n\r\n // collect the bounds and center of each result\r\n for (var i = results.length - 1; i >= 0; i--) {\r\n var result = results[i];\r\n\r\n resultLatlngs.push(result.latlng);\r\n\r\n // make sure bounds are valid and not 0,0. sometimes bounds are incorrect or not present\r\n if (result.bounds && result.bounds.isValid() && !result.bounds.equals(nullIsland)) {\r\n resultBounds.push(result.bounds);\r\n }\r\n }\r\n\r\n // form a bounds object containing all center points\r\n var bounds = latLngBounds(resultLatlngs);\r\n\r\n // and extend it to contain all bounds objects\r\n for (var j = 0; j < resultBounds.length; j++) {\r\n bounds.extend(resultBounds[j]);\r\n }\r\n\r\n return bounds;\r\n },\r\n\r\n clear: function () {\r\n this._clearAllSuggestions();\r\n\r\n if (this.options.collapseAfterResult) {\r\n this._input.value = '';\r\n this._lastValue = '';\r\n this._input.placeholder = '';\r\n DomUtil.removeClass(this._wrapper, 'geocoder-control-expanded');\r\n }\r\n\r\n if (!this._map.scrollWheelZoom.enabled() && this._map.options.scrollWheelZoom) {\r\n this._map.scrollWheelZoom.enable();\r\n }\r\n },\r\n\r\n _clearAllSuggestions: function () {\r\n this._suggestions.style.display = 'none';\r\n\r\n for (var i = 0; i < this.options.providers.length; i++) {\r\n this._clearProviderSuggestions(this.options.providers[i]);\r\n }\r\n },\r\n\r\n _clearProviderSuggestions: function (provider) {\r\n provider._contentsElement.innerHTML = '';\r\n },\r\n\r\n _finalizeSuggestions: function (activeRequests, suggestionsLength) {\r\n // check if all requests are finished to remove the loading indicator\r\n if (!activeRequests) {\r\n DomUtil.removeClass(this._input, 'geocoder-control-loading');\r\n\r\n // when the geocoder position is either \"bottomleft\" or \"bottomright\",\r\n // it is necessary in some cases to recalculate the maxHeight and top values of the this._suggestions element,\r\n // even though this is also being done after each provider returns their own suggestions\r\n if (this.getPosition().indexOf('bottom') > -1) {\r\n this._setSuggestionsBottomPosition();\r\n }\r\n\r\n // also check if there were 0 total suggest results to clear the parent suggestions element\r\n // otherwise its display value may be \"block\" instead of \"none\"\r\n if (!suggestionsLength) {\r\n this._clearAllSuggestions();\r\n }\r\n }\r\n },\r\n\r\n _setupClick: function () {\r\n DomUtil.addClass(this._wrapper, 'geocoder-control-expanded');\r\n this._input.focus();\r\n },\r\n\r\n disable: function () {\r\n this._input.disabled = true;\r\n DomUtil.addClass(this._input, 'geocoder-control-input-disabled');\r\n DomEvent.removeListener(this._wrapper, 'click', this._setupClick, this);\r\n },\r\n\r\n enable: function () {\r\n this._input.disabled = false;\r\n DomUtil.removeClass(this._input, 'geocoder-control-input-disabled');\r\n DomEvent.addListener(this._wrapper, 'click', this._setupClick, this);\r\n },\r\n\r\n getAttribution: function () {\r\n var attribs = [];\r\n\r\n for (var i = 0; i < this._providers.length; i++) {\r\n if (this._providers[i].options.attribution) {\r\n attribs.push(this._providers[i].options.attribution);\r\n }\r\n }\r\n\r\n return attribs.join(', ');\r\n },\r\n\r\n geocodeSuggestion: function (e) {\r\n var suggestionItem = e.target || e.srcElement;\r\n\r\n if (\r\n suggestionItem.classList.contains('geocoder-control-suggestions') ||\r\n suggestionItem.classList.contains('geocoder-control-header')\r\n ) {\r\n return;\r\n }\r\n\r\n // make sure and point at the actual 'geocoder-control-suggestion'\r\n if (suggestionItem.classList.length < 1) {\r\n suggestionItem = suggestionItem.parentNode;\r\n }\r\n\r\n this._geosearchCore._geocode(suggestionItem.unformattedText, suggestionItem['data-magic-key'], suggestionItem.provider);\r\n this.clear();\r\n },\r\n\r\n onAdd: function (map) {\r\n // include 'Powered by Esri' in map attribution\r\n EsriUtil.setEsriAttribution(map);\r\n\r\n this._map = map;\r\n this._wrapper = DomUtil.create('div', 'geocoder-control');\r\n this._input = DomUtil.create('input', 'geocoder-control-input leaflet-bar', this._wrapper);\r\n this._input.title = this.options.title;\r\n\r\n if (this.options.expanded) {\r\n DomUtil.addClass(this._wrapper, 'geocoder-control-expanded');\r\n this._input.placeholder = this.options.placeholder;\r\n }\r\n\r\n // create the main suggested results container element\r\n this._suggestions = DomUtil.create('div', 'geocoder-control-suggestions leaflet-bar', this._wrapper);\r\n\r\n // create a child contents container element for each provider inside of this._suggestions\r\n // to maintain the configured order of providers for suggested results\r\n for (var i = 0; i < this.options.providers.length; i++) {\r\n this.options.providers[i]._contentsElement = DomUtil.create('div', null, this._suggestions);\r\n }\r\n\r\n var credits = this._geosearchCore._getAttribution();\r\n\r\n if (map.attributionControl) {\r\n map.attributionControl.addAttribution(credits);\r\n }\r\n\r\n DomEvent.addListener(this._input, 'focus', function (e) {\r\n this._input.placeholder = this.options.placeholder;\r\n DomUtil.addClass(this._wrapper, 'geocoder-control-expanded');\r\n }, this);\r\n\r\n DomEvent.addListener(this._wrapper, 'click', this._setupClick, this);\r\n\r\n // make sure both click and touch spawn an address/poi search\r\n DomEvent.addListener(this._suggestions, 'mousedown', this.geocodeSuggestion, this);\r\n\r\n DomEvent.addListener(this._input, 'blur', function (e) {\r\n // TODO: this is too greedy and should not \"clear\"\r\n // when trying to use the scrollbar or clicking on a non-suggestion item (such as a provider header)\r\n this.clear();\r\n }, this);\r\n\r\n DomEvent.addListener(this._input, 'keydown', function (e) {\r\n var text = (e.target || e.srcElement).value;\r\n\r\n DomUtil.addClass(this._wrapper, 'geocoder-control-expanded');\r\n\r\n var list = this._suggestions.querySelectorAll('.' + 'geocoder-control-suggestion');\r\n var selected = this._suggestions.querySelectorAll('.' + 'geocoder-control-selected')[0];\r\n var selectedPosition;\r\n\r\n for (var i = 0; i < list.length; i++) {\r\n if (list[i] === selected) {\r\n selectedPosition = i;\r\n break;\r\n }\r\n }\r\n\r\n switch (e.keyCode) {\r\n case 13:\r\n /*\r\n if an item has been selected, geocode it\r\n if focus is on the input textbox, geocode only if multiple results are allowed and more than two characters are present, or if a single suggestion is displayed.\r\n if less than two characters have been typed, abort the geocode\r\n */\r\n if (selected) {\r\n this._input.value = selected.innerText;\r\n this._geosearchCore._geocode(selected.unformattedText, selected['data-magic-key'], selected.provider);\r\n this.clear();\r\n } else if (this.options.allowMultipleResults && text.length >= 2) {\r\n this._geosearchCore._geocode(this._input.value, undefined);\r\n this.clear();\r\n } else {\r\n if (list.length === 1) {\r\n DomUtil.addClass(list[0], 'geocoder-control-selected');\r\n this._geosearchCore._geocode(list[0].innerHTML, list[0]['data-magic-key'], list[0].provider);\r\n } else {\r\n this.clear();\r\n this._input.blur();\r\n }\r\n }\r\n DomEvent.preventDefault(e);\r\n break;\r\n case 38:\r\n if (selected) {\r\n DomUtil.removeClass(selected, 'geocoder-control-selected');\r\n }\r\n\r\n var previousItem = list[selectedPosition - 1];\r\n\r\n if (selected && previousItem) {\r\n DomUtil.addClass(previousItem, 'geocoder-control-selected');\r\n } else {\r\n DomUtil.addClass(list[list.length - 1], 'geocoder-control-selected');\r\n }\r\n DomEvent.preventDefault(e);\r\n break;\r\n case 40:\r\n if (selected) {\r\n DomUtil.removeClass(selected, 'geocoder-control-selected');\r\n }\r\n\r\n var nextItem = list[selectedPosition + 1];\r\n\r\n if (selected && nextItem) {\r\n DomUtil.addClass(nextItem, 'geocoder-control-selected');\r\n } else {\r\n DomUtil.addClass(list[0], 'geocoder-control-selected');\r\n }\r\n DomEvent.preventDefault(e);\r\n break;\r\n default:\r\n // when the input changes we should cancel all pending suggestion requests if possible to avoid result collisions\r\n for (var x = 0; x < this._geosearchCore._pendingSuggestions.length; x++) {\r\n var request = this._geosearchCore._pendingSuggestions[x];\r\n if (request && request.abort && !request.id) {\r\n request.abort();\r\n }\r\n }\r\n break;\r\n }\r\n }, this);\r\n\r\n DomEvent.addListener(this._input, 'keyup', Util.throttle(function (e) {\r\n var key = e.which || e.keyCode;\r\n var text = (e.target || e.srcElement).value;\r\n\r\n // require at least 2 characters for suggestions\r\n if (text.length < 2) {\r\n this._lastValue = this._input.value;\r\n this._clearAllSuggestions();\r\n DomUtil.removeClass(this._input, 'geocoder-control-loading');\r\n return;\r\n }\r\n\r\n // if this is the escape key it will clear the input so clear suggestions\r\n if (key === 27) {\r\n this._clearAllSuggestions();\r\n return;\r\n }\r\n\r\n // if this is NOT the up/down arrows or enter make a suggestion\r\n if (key !== 13 && key !== 38 && key !== 40) {\r\n if (this._input.value !== this._lastValue) {\r\n this._lastValue = this._input.value;\r\n DomUtil.addClass(this._input, 'geocoder-control-loading');\r\n this._geosearchCore._suggest(text);\r\n }\r\n }\r\n }, 50, this), this);\r\n\r\n DomEvent.disableClickPropagation(this._wrapper);\r\n\r\n // when mouse moves over suggestions disable scroll wheel zoom if its enabled\r\n DomEvent.addListener(this._suggestions, 'mouseover', function (e) {\r\n if (map.scrollWheelZoom.enabled() && map.options.scrollWheelZoom) {\r\n map.scrollWheelZoom.disable();\r\n }\r\n });\r\n\r\n // when mouse moves leaves suggestions enable scroll wheel zoom if its disabled\r\n DomEvent.addListener(this._suggestions, 'mouseout', function (e) {\r\n if (!map.scrollWheelZoom.enabled() && map.options.scrollWheelZoom) {\r\n map.scrollWheelZoom.enable();\r\n }\r\n });\r\n\r\n this._geosearchCore.on('load', function (e) {\r\n DomUtil.removeClass(this._input, 'geocoder-control-loading');\r\n this.clear();\r\n this._input.blur();\r\n }, this);\r\n\r\n return this._wrapper;\r\n }\r\n});\r\n\r\nexport function geosearch (options) {\r\n return new Geosearch(options);\r\n}\r\n\r\nexport default geosearch;\r\n","import { Util, geoJson, latLngBounds } from 'leaflet';\r\nimport { FeatureLayerService } from 'esri-leaflet';\r\n\r\nexport var FeatureLayerProvider = FeatureLayerService.extend({\r\n options: {\r\n label: 'Feature Layer',\r\n maxResults: 5,\r\n bufferRadius: 1000,\r\n searchMode: 'contain',\r\n formatSuggestion: function (feature) {\r\n return feature.properties[this.options.searchFields[0]];\r\n }\r\n },\r\n\r\n initialize: function (options) {\r\n if (options.apikey) {\r\n options.token = options.apikey;\r\n }\r\n FeatureLayerService.prototype.initialize.call(this, options);\r\n if (typeof this.options.searchFields === 'string') {\r\n this.options.searchFields = [this.options.searchFields];\r\n }\r\n this._suggestionsQuery = this.query();\r\n this._resultsQuery = this.query();\r\n },\r\n\r\n suggestions: function (text, bounds, callback) {\r\n var query = this._suggestionsQuery.where(this._buildQuery(text))\r\n .returnGeometry(false);\r\n\r\n if (bounds) {\r\n query.intersects(bounds);\r\n }\r\n\r\n if (this.options.idField) {\r\n query.fields([this.options.idField].concat(this.options.searchFields));\r\n }\r\n\r\n var request = query.run(function (error, results, raw) {\r\n if (error) {\r\n callback(error, []);\r\n } else {\r\n this.options.idField = raw.objectIdFieldName;\r\n var suggestions = [];\r\n for (var i = results.features.length - 1; i >= 0; i--) {\r\n var feature = results.features[i];\r\n suggestions.push({\r\n text: this.options.formatSuggestion.call(this, feature),\r\n unformattedText: feature.properties[this.options.searchFields[0]],\r\n magicKey: feature.id\r\n });\r\n }\r\n callback(error, suggestions.slice(0, this.options.maxResults));\r\n }\r\n }, this);\r\n\r\n return request;\r\n },\r\n\r\n results: function (text, key, bounds, callback) {\r\n var query = this._resultsQuery;\r\n\r\n if (key) {\r\n // if there are 1 or more keys available, use query.featureIds()\r\n delete query.params.where;\r\n query.featureIds([key]);\r\n } else {\r\n // if there are no keys available, use query.where()\r\n query.where(this._buildQuery(text));\r\n }\r\n\r\n if (bounds) {\r\n query.within(bounds);\r\n }\r\n\r\n return query.run(Util.bind(function (error, features) {\r\n var results = [];\r\n for (var i = 0; i < features.features.length; i++) {\r\n var feature = features.features[i];\r\n if (feature) {\r\n var bounds = this._featureBounds(feature);\r\n\r\n var result = {\r\n latlng: bounds.getCenter(),\r\n bounds: bounds,\r\n text: this.options.formatSuggestion.call(this, feature),\r\n properties: feature.properties,\r\n geojson: feature\r\n };\r\n\r\n results.push(result);\r\n\r\n // clear query parameters for the next search\r\n delete this._resultsQuery.params['objectIds'];\r\n }\r\n }\r\n callback(error, results);\r\n }, this));\r\n },\r\n\r\n orderBy: function (fieldName, order) {\r\n this._suggestionsQuery.orderBy(fieldName, order);\r\n },\r\n\r\n _buildQuery: function (text) {\r\n var queryString = [];\r\n\r\n for (var i = this.options.searchFields.length - 1; i >= 0; i--) {\r\n var field = 'upper(\"' + this.options.searchFields[i] + '\")';\r\n if (this.options.searchMode === 'contain') {\r\n queryString.push(field + \" LIKE upper('%\" + text + \"%')\");\r\n } else if (this.options.searchMode === 'startWith') {\r\n queryString.push(field + \" LIKE upper('\" + text + \"%')\");\r\n } else if (this.options.searchMode === 'endWith') {\r\n queryString.push(field + \" LIKE upper('%\" + text + \"')\");\r\n } else if (this.options.searchMode === 'strict') {\r\n queryString.push(field + \" LIKE upper('\" + text + \"')\");\r\n } else {\r\n throw new Error('L.esri.Geocoding.featureLayerProvider: Invalid parameter for \"searchMode\". Use one of \"contain\", \"startWith\", \"endWith\", or \"strict\"');\r\n }\r\n }\r\n if (this.options.where) {\r\n return this.options.where + ' AND (' + queryString.join(' OR ') + ')';\r\n } else {\r\n return queryString.join(' OR ');\r\n }\r\n },\r\n\r\n _featureBounds: function (feature) {\r\n var geojson = geoJson(feature);\r\n if (feature.geometry.type === 'Point') {\r\n var center = geojson.getBounds().getCenter();\r\n var lngRadius = ((this.options.bufferRadius / 40075017) * 360) / Math.cos((180 / Math.PI) * center.lat);\r\n var latRadius = (this.options.bufferRadius / 40075017) * 360;\r\n return latLngBounds([center.lat - latRadius, center.lng - lngRadius], [center.lat + latRadius, center.lng + lngRadius]);\r\n } else {\r\n return geojson.getBounds();\r\n }\r\n }\r\n});\r\n\r\nexport function featureLayerProvider (options) {\r\n return new FeatureLayerProvider(options);\r\n}\r\n\r\nexport default featureLayerProvider;\r\n","import { Util, geoJson, latLngBounds } from 'leaflet';\r\nimport { MapService } from 'esri-leaflet';\r\n\r\nexport var MapServiceProvider = MapService.extend({\r\n options: {\r\n layers: [0],\r\n label: 'Map Service',\r\n bufferRadius: 1000,\r\n maxResults: 5,\r\n formatSuggestion: function (feature) {\r\n return feature.properties[feature.displayFieldName] + ' ' + feature.layerName + '';\r\n }\r\n },\r\n\r\n initialize: function (options) {\r\n if (options.apikey) {\r\n options.token = options.apikey;\r\n }\r\n MapService.prototype.initialize.call(this, options);\r\n this._getIdFields();\r\n },\r\n\r\n suggestions: function (text, bounds, callback) {\r\n var request = this.find().text(text).fields(this.options.searchFields).returnGeometry(false).layers(this.options.layers);\r\n\r\n return request.run(function (error, results, raw) {\r\n var suggestions = [];\r\n if (!error) {\r\n var count = Math.min(this.options.maxResults, results.features.length);\r\n raw.results = raw.results.reverse();\r\n for (var i = 0; i < count; i++) {\r\n var feature = results.features[i];\r\n var result = raw.results[i];\r\n var layer = result.layerId;\r\n var idField = this._idFields[layer];\r\n feature.layerId = layer;\r\n feature.layerName = this._layerNames[layer];\r\n feature.displayFieldName = this._displayFields[layer];\r\n if (idField) {\r\n suggestions.push({\r\n text: this.options.formatSuggestion.call(this, feature),\r\n unformattedText: feature.properties[feature.displayFieldName],\r\n magicKey: result.attributes[idField] + ':' + layer\r\n });\r\n }\r\n }\r\n }\r\n callback(error, suggestions.reverse());\r\n }, this);\r\n },\r\n\r\n results: function (text, key, bounds, callback) {\r\n var results = [];\r\n var request;\r\n\r\n if (key && !key.includes(',')) {\r\n // if there is only 1 key available, use query()\r\n var featureId = key.split(':')[0];\r\n var layer = key.split(':')[1];\r\n request = this.query().layer(layer).featureIds(featureId);\r\n } else {\r\n // if there are no keys or more than 1 keys available, use find()\r\n request = this.find().text(text).fields(this.options.searchFields).layers(this.options.layers);\r\n }\r\n\r\n return request.run(function (error, features, response) {\r\n if (!error) {\r\n if (response.results) {\r\n response.results = response.results.reverse();\r\n }\r\n for (var i = 0; i < features.features.length; i++) {\r\n var feature = features.features[i];\r\n layer = layer || response.results[i].layerId;\r\n\r\n if (feature && layer !== undefined) {\r\n var bounds = this._featureBounds(feature);\r\n feature.layerId = layer;\r\n feature.layerName = this._layerNames[layer];\r\n feature.displayFieldName = this._displayFields[layer];\r\n\r\n var result = {\r\n latlng: bounds.getCenter(),\r\n bounds: bounds,\r\n text: this.options.formatSuggestion.call(this, feature),\r\n properties: feature.properties,\r\n geojson: feature\r\n };\r\n\r\n results.push(result);\r\n }\r\n }\r\n }\r\n callback(error, results.reverse());\r\n }, this);\r\n },\r\n\r\n _featureBounds: function (feature) {\r\n var geojson = geoJson(feature);\r\n if (feature.geometry.type === 'Point') {\r\n var center = geojson.getBounds().getCenter();\r\n var lngRadius = ((this.options.bufferRadius / 40075017) * 360) / Math.cos((180 / Math.PI) * center.lat);\r\n var latRadius = (this.options.bufferRadius / 40075017) * 360;\r\n return latLngBounds([center.lat - latRadius, center.lng - lngRadius], [center.lat + latRadius, center.lng + lngRadius]);\r\n } else {\r\n return geojson.getBounds();\r\n }\r\n },\r\n\r\n _layerMetadataCallback: function (layerid) {\r\n return Util.bind(function (error, metadata) {\r\n if (error) { return; }\r\n this._displayFields[layerid] = metadata.displayField;\r\n this._layerNames[layerid] = metadata.name;\r\n for (var i = 0; i < metadata.fields.length; i++) {\r\n var field = metadata.fields[i];\r\n if (field.type === 'esriFieldTypeOID') {\r\n this._idFields[layerid] = field.name;\r\n break;\r\n }\r\n }\r\n }, this);\r\n },\r\n\r\n _getIdFields: function () {\r\n this._idFields = {};\r\n this._displayFields = {};\r\n this._layerNames = {};\r\n for (var i = 0; i < this.options.layers.length; i++) {\r\n var layer = this.options.layers[i];\r\n this.get(layer, {}, this._layerMetadataCallback(layer));\r\n }\r\n }\r\n});\r\n\r\nexport function mapServiceProvider (options) {\r\n return new MapServiceProvider(options);\r\n}\r\n\r\nexport default mapServiceProvider;\r\n","import { GeocodeService } from '../Services/Geocode';\r\n\r\nexport var GeocodeServiceProvider = GeocodeService.extend({\r\n options: {\r\n label: 'Geocode Server',\r\n maxResults: 5\r\n },\r\n\r\n suggestions: function (text, bounds, callback) {\r\n if (this.options.supportsSuggest) {\r\n var request = this.suggest().text(text);\r\n if (bounds) {\r\n request.within(bounds);\r\n }\r\n\r\n return request.run(function (error, results, response) {\r\n var suggestions = [];\r\n if (!error) {\r\n while (response.suggestions.length && suggestions.length <= (this.options.maxResults - 1)) {\r\n var suggestion = response.suggestions.shift();\r\n if (!suggestion.isCollection) {\r\n suggestions.push({\r\n text: suggestion.text,\r\n unformattedText: suggestion.text,\r\n magicKey: suggestion.magicKey\r\n });\r\n }\r\n }\r\n }\r\n callback(error, suggestions);\r\n }, this);\r\n } else {\r\n callback(null, []);\r\n return false;\r\n }\r\n },\r\n\r\n results: function (text, key, bounds, callback) {\r\n var request = this.geocode().text(text);\r\n\r\n if (key) {\r\n request.key(key);\r\n }\r\n\r\n request.maxLocations(this.options.maxResults);\r\n\r\n if (bounds) {\r\n request.within(bounds);\r\n }\r\n\r\n return request.run(function (error, response) {\r\n callback(error, response.results);\r\n }, this);\r\n }\r\n});\r\n\r\nexport function geocodeServiceProvider (options) {\r\n return new GeocodeServiceProvider(options);\r\n}\r\n\r\nexport default geocodeServiceProvider;\r\n"],"names":["Task","latLngBounds","EsriUtil","latLng","Service","Evented","Util","Control","DomUtil","DomEvent","FeatureLayerService","geoJson","MapService"],"mappings":";;;;;;;;;;;AAAU,MAAC,wBAAwB,GAAG;;ACO5B,MAAC,OAAO,GAAGA,gBAAI,CAAC,MAAM,CAAC;EACjC,EAAE,IAAI,EAAE,uBAAuB;AAC/B;EACA,EAAE,MAAM,EAAE;EACV,IAAI,KAAK,EAAE,IAAI;EACf,IAAI,UAAU,EAAE,KAAK;EACrB,IAAI,SAAS,EAAE,GAAG;EAClB,IAAI,YAAY,EAAE,EAAE;EACpB,GAAG;AACH;EACA,EAAE,OAAO,EAAE;EACX,IAAI,OAAO,EAAE,SAAS;EACtB,IAAI,YAAY,EAAE,cAAc;EAChC,IAAI,IAAI,EAAE,MAAM;EAChB,IAAI,SAAS,EAAE,WAAW;EAC1B,IAAI,MAAM,EAAE,QAAQ;EACpB,IAAI,MAAM,EAAE,QAAQ;EACpB,IAAI,OAAO,EAAE,SAAS;EACt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EAAE,OAAO,EAAE;EACjD,EAAE,OAAO,IAAI,sBAAsB,CAAC,OAAO,CAAC,CAAC;EAC7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/esri-leaflet-geocoder.css b/dist/esri-leaflet-geocoder.css new file mode 100644 index 0000000..6fd75d4 --- /dev/null +++ b/dist/esri-leaflet-geocoder.css @@ -0,0 +1 @@ +.geocoder-control-input{position:absolute;left:0;top:0;background-color:white;background-repeat:no-repeat;background-image:url("img/search.png");background-size:26px;border:none;padding:0;text-indent:6px;font-size:13px;line-height:normal;height:auto;padding-top:5px;padding-bottom:5px;width:100%;background-position:right center;cursor:pointer;box-sizing:border-box}.geocoder-control-input-disabled{background-color:#f4f4f4;background-image:url("img/search-disabled.png")}.geocoder-control{width:26px;height:26px;-webkit-transition:width .175s ease-in;-moz-transition:width .175s ease-in;-ms-transition:width .175s ease-in;-o-transition:width .175s ease-in;transition:width .175s ease-in}.geocoder-control-expanded,.leaflet-touch .geocoder-control-expanded{width:275px}.geocoder-control-input.geocoder-control-loading{background-image:url("img/loading.gif");background-size:26px}@media only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min-device-pixel-ratio: 2){.geocoder-control-input{background-image:url("img/search@2x.png")}.geocoder-control-input-disabled{background-image:url("img/search@2x-disabled.png")}.geocoder-control-input.geocoder-control-loading{background-image:url("img/loading@2x.gif")}}.geocoder-control-input:focus{outline:none;cursor:text}.geocoder-control-input::-ms-clear{display:none}.geocoder-control-suggestions{width:100%;position:absolute;top:26px;left:0;margin-top:10px;overflow:auto;display:none}.geocoder-control-list+.geocoder-control-header{border-top:1px solid #d5d5d5}.geocoder-control-header{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#444;background:#f2f2f2;border-bottom:1px solid #d5d5d5;display:block;padding:.5em}.geocoder-control-list{list-style:none;margin:0;padding:0}.geocoder-control-suggestions .geocoder-control-suggestion{font-size:13px;padding:7px;background:white;border-top:1px solid #f1f1f1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.geocoder-control-suggestions .geocoder-control-suggestion:first-child{border:none}.geocoder-control-suggestions .geocoder-control-suggestion.geocoder-control-selected,.geocoder-control-suggestions .geocoder-control-suggestion:hover{background:#7fdfff;border-color:#7fdfff}.leaflet-right .geocoder-control-suggestions{left:auto;right:0}.leaflet-right .geocoder-control-input{left:auto;right:0}.leaflet-bottom .geocoder-control-suggestions{margin-top:0;top:0}.leaflet-touch .geocoder-control{width:34px}.leaflet-touch .geocoder-control.geocoder-control-expanded{width:275px}.leaflet-touch .geocoder-control-input{height:34px;line-height:30px;background-size:30px}.leaflet-touch .geocoder-control-suggestions{top:30px;width:271px}.leaflet-oldie .geocoder-control-input{width:28px;height:28px}.leaflet-oldie .geocoder-control-expanded .geocoder-control-input{width:auto}.leaflet-oldie .geocoder-control-input,.leaflet-oldie .geocoder-control-suggestions{border:1px solid #999}/*# sourceMappingURL=esri-leaflet-geocoder.css.map */ diff --git a/dist/esri-leaflet-geocoder.css.map b/dist/esri-leaflet-geocoder.css.map new file mode 100644 index 0000000..46d51d5 --- /dev/null +++ b/dist/esri-leaflet-geocoder.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["../src/esri-leaflet-geocoder.css"],"names":[],"mappings":"AAAA,wBACE,kBACA,OACA,MACA,uBACA,4BACA,uCACA,qBACA,YACA,UACA,gBACA,eACA,mBACA,YACA,gBACA,mBACA,WACA,iCACA,eACA,sBAGF,iCACE,yBACA,gDAGF,kBACE,WACA,YACA,uCACA,oCACA,mCACA,kCACA,+BAGF,qEAEE,YAGF,iDACE,wCACA,qBAGF,yMAIE,wBACE,0CAEF,iCACE,mDAEF,iDACE,4CAIJ,8BACE,aACA,YAGF,mCACI,aAQJ,8BACE,WACA,kBACA,SACA,OACA,gBACA,cACA,aAGF,gDACE,6BAGF,yBACE,eACA,gBACA,yBACA,qBACA,WACA,mBACA,gCACA,cACA,aAGF,uBACE,gBACA,SACA,UAGF,2DACE,eACA,YACA,iBACA,6BACA,mBACA,gBACA,uBACA,eAGF,uEACE,YAGF,sJAEE,mBACA,qBAKF,6CACE,UACA,QAGF,uCACE,UACA,QAKF,8CACE,aACA,MAKF,iCACE,WAGF,2DACE,YAGF,uCACE,YACA,iBACA,qBAGF,6CACE,SACA,YAKF,uCACE,WACA,YAGF,kEACE,WAGF,oFAEE","file":"esri-leaflet-geocoder.css"} \ No newline at end of file diff --git a/dist/esri-leaflet-geocoder.js b/dist/esri-leaflet-geocoder.js new file mode 100644 index 0000000..61bf864 --- /dev/null +++ b/dist/esri-leaflet-geocoder.js @@ -0,0 +1,5 @@ +/* esri-leaflet-geocoder - v3.1.4 - Thu Feb 23 2023 13:29:25 GMT-0600 (Central Standard Time) + * Copyright (c) 2023 Environmental Systems Research Institute, Inc. + * Apache-2.0 */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("leaflet"),require("esri-leaflet")):"function"==typeof define&&define.amd?define(["exports","leaflet","esri-leaflet"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).L=e.L||{},e.L.esri=e.L.esri||{},e.L.esri.Geocoding={}),e.L,e.L.esri)}(this,(function(e,t,s){"use strict";var i="https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/",o=s.Task.extend({path:"findAddressCandidates",params:{outSr:4326,forStorage:!1,outFields:"*",maxLocations:20},setters:{address:"address",neighborhood:"neighborhood",city:"city",subregion:"subregion",region:"region",postal:"postal",country:"country",text:"singleLine",category:"category",token:"token",apikey:"apikey",key:"magicKey",fields:"outFields",forStorage:"forStorage",maxLocations:"maxLocations",countries:"sourceCountry"},initialize:function(e){(e=e||{}).url=e.url||i,s.Task.prototype.initialize.call(this,e)},within:function(e){return e=t.latLngBounds(e),this.params.searchExtent=s.Util.boundsToExtent(e),this},nearby:function(e,s){var i=t.latLng(e);return this.params.location=i.lng+","+i.lat,s&&(this.params.distance=Math.min(Math.max(s,2e3),5e4)),this},run:function(e,t){return this.options.token&&(this.params.token=this.options.token),this.options.apikey&&(this.params.token=this.options.apikey),this.options.customParam&&(this.params[this.options.customParam]=this.params.singleLine,delete this.params.singleLine),this.request((function(s,i){var o=this._processGeocoderResponse,r=s?void 0:o(i);e.call(t,s,{results:r},i)}),this)},_processGeocoderResponse:function(e){for(var i=[],o=0;o-1?this.options.supportsSuggest=!0:this.options.supportsSuggest=!1,this.options.customParam=t.singleLineAddressField.name)}),this)}});var d=t.Evented.extend({options:{zoomToResult:!0,useMapBounds:12,searchBounds:null},initialize:function(e,s){if(t.Util.setOptions(this,s),this._control=e,!s||!s.providers||!s.providers.length)throw new Error("You must specify at least one provider");this._providers=s.providers},_geocode:function(e,s,i){var o,r=0,n=[],a=t.Util.bind((function(t,s){r--,t||(s&&(n=n.concat(s)),r<=0&&(o=this._boundsFromResults(n),this.fire("results",{results:n,bounds:o,latlng:o?o.getCenter():void 0,text:e},!0),this.options.zoomToResult&&o&&this._control._map.fitBounds(o),this.fire("load")))}),this);if(s)r++,i.results(e,s,this._searchBounds(),a);else for(var l=0;l=0;r--){var n=e[r];o.push(n.latlng),n.bounds&&n.bounds.isValid()&&!n.bounds.equals(s)&&i.push(n.bounds)}for(var a=t.latLngBounds(o),l=0;l0&&(this._suggestions.style.display="block");for(var r=[],n=0;n1&&s!==a.provider.options.label&&((o=t.DomUtil.create("div","geocoder-control-header",a.provider._contentsElement)).textContent=a.provider.options.label,o.innerText=a.provider.options.label,s=a.provider.options.label),i||(i=t.DomUtil.create("ul","geocoder-control-list",a.provider._contentsElement)),-1===r.indexOf(a.text)){var l=t.DomUtil.create("li","geocoder-control-suggestion",i);l.innerHTML=a.text,l.provider=a.provider,l["data-magic-key"]=a.magicKey,l.unformattedText=a.unformattedText}else for(var u=0;u-1&&(this._suggestions.style.maxHeight=this._map.getSize().y-this._suggestions.offsetTop-this._wrapper.offsetTop-10+"px"),this.getPosition().indexOf("bottom")>-1&&this._setSuggestionsBottomPosition()},_setSuggestionsBottomPosition:function(){this._suggestions.style.maxHeight=this._map.getSize().y-this._map._controlCorners[this.getPosition()].offsetHeight-this._wrapper.offsetHeight+"px",this._suggestions.style.top=-this._suggestions.offsetHeight-this._wrapper.offsetHeight+20+"px"},_boundsFromResults:function(e){if(e.length){for(var s=t.latLngBounds([0,0],[0,0]),i=[],o=[],r=e.length-1;r>=0;r--){var n=e[r];o.push(n.latlng),n.bounds&&n.bounds.isValid()&&!n.bounds.equals(s)&&i.push(n.bounds)}for(var a=t.latLngBounds(o),l=0;l-1&&this._setSuggestionsBottomPosition(),s||this._clearAllSuggestions())},_setupClick:function(){t.DomUtil.addClass(this._wrapper,"geocoder-control-expanded"),this._input.focus()},disable:function(){this._input.disabled=!0,t.DomUtil.addClass(this._input,"geocoder-control-input-disabled"),t.DomEvent.removeListener(this._wrapper,"click",this._setupClick,this)},enable:function(){this._input.disabled=!1,t.DomUtil.removeClass(this._input,"geocoder-control-input-disabled"),t.DomEvent.addListener(this._wrapper,"click",this._setupClick,this)},getAttribution:function(){for(var e=[],t=0;t=2?(this._geosearchCore._geocode(this._input.value,void 0),this.clear()):1===o.length?(t.DomUtil.addClass(o[0],"geocoder-control-selected"),this._geosearchCore._geocode(o[0].innerHTML,o[0]["data-magic-key"],o[0].provider)):(this.clear(),this._input.blur()),t.DomEvent.preventDefault(e);break;case 38:r&&t.DomUtil.removeClass(r,"geocoder-control-selected");var a=o[i-1];r&&a?t.DomUtil.addClass(a,"geocoder-control-selected"):t.DomUtil.addClass(o[o.length-1],"geocoder-control-selected"),t.DomEvent.preventDefault(e);break;case 40:r&&t.DomUtil.removeClass(r,"geocoder-control-selected");var l=o[i+1];r&&l?t.DomUtil.addClass(l,"geocoder-control-selected"):t.DomUtil.addClass(o[0],"geocoder-control-selected"),t.DomEvent.preventDefault(e);break;default:for(var u=0;u=0;r--){var n=t.features[r];o.push({text:this.options.formatSuggestion.call(this,n),unformattedText:n.properties[this.options.searchFields[0]],magicKey:n.id})}s(e,o.slice(0,this.options.maxResults))}}),this)},results:function(e,s,i,o){var r=this._resultsQuery;return s?(delete r.params.where,r.featureIds([s])):r.where(this._buildQuery(e)),i&&r.within(i),r.run(t.Util.bind((function(e,t){for(var s=[],i=0;i=0;s--){var i='upper("'+this.options.searchFields[s]+'")';if("contain"===this.options.searchMode)t.push(i+" LIKE upper('%"+e+"%')");else if("startWith"===this.options.searchMode)t.push(i+" LIKE upper('"+e+"%')");else if("endWith"===this.options.searchMode)t.push(i+" LIKE upper('%"+e+"')");else{if("strict"!==this.options.searchMode)throw new Error('L.esri.Geocoding.featureLayerProvider: Invalid parameter for "searchMode". Use one of "contain", "startWith", "endWith", or "strict"');t.push(i+" LIKE upper('"+e+"')")}}return this.options.where?this.options.where+" AND ("+t.join(" OR ")+")":t.join(" OR ")},_featureBounds:function(e){var s=t.geoJson(e);if("Point"===e.geometry.type){var i=s.getBounds().getCenter(),o=this.options.bufferRadius/40075017*360/Math.cos(180/Math.PI*i.lat),r=this.options.bufferRadius/40075017*360;return t.latLngBounds([i.lat-r,i.lng-o],[i.lat+r,i.lng+o])}return s.getBounds()}});var m=s.MapService.extend({options:{layers:[0],label:"Map Service",bufferRadius:1e3,maxResults:5,formatSuggestion:function(e){return e.properties[e.displayFieldName]+" "+e.layerName+""}},initialize:function(e){e.apikey&&(e.token=e.apikey),s.MapService.prototype.initialize.call(this,e),this._getIdFields()},suggestions:function(e,t,s){return this.find().text(e).fields(this.options.searchFields).returnGeometry(!1).layers(this.options.layers).run((function(e,t,i){var o=[];if(!e){var r=Math.min(this.options.maxResults,t.features.length);i.results=i.results.reverse();for(var n=0;n -1) {\r\n this.options.supportsSuggest = true;\r\n } else {\r\n this.options.supportsSuggest = false;\r\n }\r\n // whether the service supports suggest or not, utilize the metadata response to determine the appropriate parameter name for single line geocoding requests\r\n this.options.customParam = response.singleLineAddressField.name;\r\n }, this);\r\n }\r\n});\r\n\r\nexport function geocodeService (options) {\r\n return new GeocodeService(options);\r\n}\r\n\r\nexport default geocodeService;\r\n","import { Evented, Util, latLngBounds } from 'leaflet';\r\n\r\nexport var GeosearchCore = Evented.extend({\r\n\r\n options: {\r\n zoomToResult: true,\r\n useMapBounds: 12,\r\n searchBounds: null\r\n },\r\n\r\n initialize: function (control, options) {\r\n Util.setOptions(this, options);\r\n this._control = control;\r\n\r\n if (!options || !options.providers || !options.providers.length) {\r\n throw new Error('You must specify at least one provider');\r\n }\r\n\r\n this._providers = options.providers;\r\n },\r\n\r\n _geocode: function (text, key, provider) {\r\n var activeRequests = 0;\r\n var allResults = [];\r\n var bounds;\r\n\r\n var callback = Util.bind(function (error, results) {\r\n activeRequests--;\r\n if (error) {\r\n return;\r\n }\r\n\r\n if (results) {\r\n allResults = allResults.concat(results);\r\n }\r\n\r\n if (activeRequests <= 0) {\r\n bounds = this._boundsFromResults(allResults);\r\n\r\n this.fire('results', {\r\n results: allResults,\r\n bounds: bounds,\r\n latlng: (bounds) ? bounds.getCenter() : undefined,\r\n text: text\r\n }, true);\r\n\r\n if (this.options.zoomToResult && bounds) {\r\n this._control._map.fitBounds(bounds);\r\n }\r\n\r\n this.fire('load');\r\n }\r\n }, this);\r\n\r\n if (key) {\r\n activeRequests++;\r\n provider.results(text, key, this._searchBounds(), callback);\r\n } else {\r\n for (var i = 0; i < this._providers.length; i++) {\r\n activeRequests++;\r\n this._providers[i].results(text, key, this._searchBounds(), callback);\r\n }\r\n }\r\n },\r\n\r\n _suggest: function (text) {\r\n var activeRequests = this._providers.length;\r\n var suggestionsLength = 0;\r\n\r\n var createCallback = Util.bind(function (text, provider) {\r\n return Util.bind(function (error, suggestions) {\r\n activeRequests = activeRequests - 1;\r\n suggestionsLength += suggestions.length;\r\n\r\n if (error) {\r\n // an error occurred for one of the providers' suggest requests\r\n this._control._clearProviderSuggestions(provider);\r\n\r\n // perform additional cleanup when all requests are finished\r\n this._control._finalizeSuggestions(activeRequests, suggestionsLength);\r\n\r\n return;\r\n }\r\n\r\n if (suggestions.length) {\r\n for (var i = 0; i < suggestions.length; i++) {\r\n suggestions[i].provider = provider;\r\n }\r\n } else {\r\n // we still need to update the UI\r\n this._control._renderSuggestions(suggestions);\r\n }\r\n\r\n if (provider._lastRender !== text) {\r\n this._control._clearProviderSuggestions(provider);\r\n }\r\n\r\n if (suggestions.length && this._control._input.value === text) {\r\n provider._lastRender = text;\r\n this._control._renderSuggestions(suggestions);\r\n }\r\n\r\n // perform additional cleanup when all requests are finished\r\n this._control._finalizeSuggestions(activeRequests, suggestionsLength);\r\n }, this);\r\n }, this);\r\n\r\n this._pendingSuggestions = [];\r\n\r\n for (var i = 0; i < this._providers.length; i++) {\r\n var provider = this._providers[i];\r\n var request = provider.suggestions(text, this._searchBounds(), createCallback(text, provider));\r\n this._pendingSuggestions.push(request);\r\n }\r\n },\r\n\r\n _searchBounds: function () {\r\n if (this.options.searchBounds !== null) {\r\n return this.options.searchBounds;\r\n }\r\n\r\n if (this.options.useMapBounds === false) {\r\n return null;\r\n }\r\n\r\n if (this.options.useMapBounds === true) {\r\n return this._control._map.getBounds();\r\n }\r\n\r\n if (this.options.useMapBounds <= this._control._map.getZoom()) {\r\n return this._control._map.getBounds();\r\n }\r\n\r\n return null;\r\n },\r\n\r\n _boundsFromResults: function (results) {\r\n if (!results.length) {\r\n return;\r\n }\r\n\r\n var nullIsland = latLngBounds([0, 0], [0, 0]);\r\n var resultBounds = [];\r\n var resultLatlngs = [];\r\n\r\n // collect the bounds and center of each result\r\n for (var i = results.length - 1; i >= 0; i--) {\r\n var result = results[i];\r\n\r\n resultLatlngs.push(result.latlng);\r\n\r\n // make sure bounds are valid and not 0,0. sometimes bounds are incorrect or not present\r\n if (result.bounds && result.bounds.isValid() && !result.bounds.equals(nullIsland)) {\r\n resultBounds.push(result.bounds);\r\n }\r\n }\r\n\r\n // form a bounds object containing all center points\r\n var bounds = latLngBounds(resultLatlngs);\r\n\r\n // and extend it to contain all bounds objects\r\n for (var j = 0; j < resultBounds.length; j++) {\r\n bounds.extend(resultBounds[j]);\r\n }\r\n\r\n return bounds;\r\n },\r\n\r\n _getAttribution: function () {\r\n var attribs = [];\r\n var providers = this._providers;\r\n\r\n for (var i = 0; i < providers.length; i++) {\r\n if (providers[i].options.attribution) {\r\n attribs.push(providers[i].options.attribution);\r\n }\r\n }\r\n\r\n return attribs.join(', ');\r\n }\r\n\r\n});\r\n\r\nexport function geosearchCore (control, options) {\r\n return new GeosearchCore(control, options);\r\n}\r\n\r\nexport default geosearchCore;\r\n","import { GeocodeService } from '../Services/Geocode';\r\n\r\nexport var ArcgisOnlineProvider = GeocodeService.extend({\r\n options: {\r\n label: 'Places and Addresses',\r\n maxResults: 5\r\n },\r\n\r\n suggestions: function (text, bounds, callback) {\r\n var request = this.suggest().text(text);\r\n\r\n if (bounds) {\r\n request.within(bounds);\r\n }\r\n\r\n if (this.options.nearby) {\r\n // \"distance\"/\"radius\" is not supported by the ArcGIS Online Geocoder,\r\n // so that is intentionally not passed here:\r\n request.nearby(this.options.nearby);\r\n }\r\n\r\n if (this.options.countries) {\r\n request.countries(this.options.countries);\r\n }\r\n\r\n if (this.options.categories) {\r\n request.category(this.options.categories);\r\n }\r\n\r\n // 15 is the maximum number of suggestions that can be returned\r\n request.maxSuggestions(this.options.maxResults);\r\n\r\n return request.run(function (error, results, response) {\r\n var suggestions = [];\r\n if (!error) {\r\n while (response.suggestions.length && suggestions.length <= (this.options.maxResults - 1)) {\r\n var suggestion = response.suggestions.shift();\r\n if (!suggestion.isCollection) {\r\n suggestions.push({\r\n text: suggestion.text,\r\n unformattedText: suggestion.text,\r\n magicKey: suggestion.magicKey\r\n });\r\n }\r\n }\r\n }\r\n callback(error, suggestions);\r\n }, this);\r\n },\r\n\r\n results: function (text, key, bounds, callback) {\r\n var request = this.geocode().text(text);\r\n\r\n if (key) {\r\n request.key(key);\r\n }\r\n // in the future Address/StreetName geocoding requests that include a magicKey will always only return one match\r\n request.maxLocations(this.options.maxResults);\r\n\r\n if (bounds) {\r\n request.within(bounds);\r\n }\r\n\r\n if (this.options.forStorage) {\r\n request.forStorage(true);\r\n }\r\n\r\n if (this.options.nearby) {\r\n // \"distance\"/\"radius\" is not supported by the ArcGIS Online Geocoder,\r\n // so that is intentionally not passed here:\r\n request.nearby(this.options.nearby);\r\n }\r\n\r\n if (this.options.countries) {\r\n request.countries(this.options.countries);\r\n }\r\n\r\n if (this.options.categories) {\r\n request.category(this.options.categories);\r\n }\r\n\r\n return request.run(function (error, response) {\r\n callback(error, response.results);\r\n }, this);\r\n }\r\n});\r\n\r\nexport function arcgisOnlineProvider (options) {\r\n return new ArcgisOnlineProvider(options);\r\n}\r\n\r\nexport default arcgisOnlineProvider;\r\n","import {\r\n Control,\r\n DomEvent,\r\n DomUtil,\r\n Evented,\r\n Util,\r\n latLngBounds\r\n} from 'leaflet';\r\nimport { geosearchCore } from '../Classes/GeosearchCore';\r\nimport { arcgisOnlineProvider } from '../Providers/ArcgisOnlineGeocoder';\r\nimport { Util as EsriUtil } from 'esri-leaflet';\r\n\r\nexport var Geosearch = Control.extend({\r\n includes: Evented.prototype,\r\n\r\n options: {\r\n position: 'topleft',\r\n collapseAfterResult: true,\r\n expanded: false,\r\n allowMultipleResults: true,\r\n placeholder: 'Search for places or addresses',\r\n title: 'Location Search'\r\n },\r\n\r\n initialize: function (options) {\r\n Util.setOptions(this, options);\r\n\r\n if (!options || !options.providers || !options.providers.length) {\r\n if (!options) {\r\n options = {};\r\n }\r\n options.providers = [arcgisOnlineProvider()];\r\n }\r\n\r\n // instantiate the underlying class and pass along options\r\n this._geosearchCore = geosearchCore(this, options);\r\n this._geosearchCore._providers = options.providers;\r\n\r\n // bubble each providers events to the control\r\n this._geosearchCore.addEventParent(this);\r\n for (var i = 0; i < this._geosearchCore._providers.length; i++) {\r\n this._geosearchCore._providers[i].addEventParent(this);\r\n }\r\n\r\n this._geosearchCore._pendingSuggestions = [];\r\n\r\n Control.prototype.initialize.call(this, options);\r\n },\r\n\r\n _renderSuggestions: function (suggestions) {\r\n var currentGroup;\r\n\r\n if (suggestions.length > 0) {\r\n this._suggestions.style.display = 'block';\r\n }\r\n\r\n var list;\r\n var header;\r\n var suggestionTextArray = [];\r\n\r\n for (var i = 0; i < suggestions.length; i++) {\r\n var suggestion = suggestions[i];\r\n if (!header && this._geosearchCore._providers.length > 1 && currentGroup !== suggestion.provider.options.label) {\r\n header = DomUtil.create('div', 'geocoder-control-header', suggestion.provider._contentsElement);\r\n header.textContent = suggestion.provider.options.label;\r\n header.innerText = suggestion.provider.options.label;\r\n currentGroup = suggestion.provider.options.label;\r\n }\r\n\r\n if (!list) {\r\n list = DomUtil.create('ul', 'geocoder-control-list', suggestion.provider._contentsElement);\r\n }\r\n\r\n if (suggestionTextArray.indexOf(suggestion.text) === -1) {\r\n var suggestionItem = DomUtil.create('li', 'geocoder-control-suggestion', list);\r\n\r\n suggestionItem.innerHTML = suggestion.text;\r\n suggestionItem.provider = suggestion.provider;\r\n suggestionItem['data-magic-key'] = suggestion.magicKey;\r\n suggestionItem.unformattedText = suggestion.unformattedText;\r\n } else {\r\n for (var j = 0; j < list.childNodes.length; j++) {\r\n // if the same text already appears in the list of suggestions, append an additional ObjectID to its magicKey instead\r\n if (list.childNodes[j].innerHTML === suggestion.text) {\r\n list.childNodes[j]['data-magic-key'] += ',' + suggestion.magicKey;\r\n }\r\n }\r\n }\r\n suggestionTextArray.push(suggestion.text);\r\n }\r\n\r\n // when the geocoder position is either \"topleft\" or \"topright\":\r\n // set the maxHeight of the suggestions box to:\r\n // map height\r\n // - suggestions offset (distance from top of suggestions to top of control)\r\n // - control offset (distance from top of control to top of map)\r\n // - 10 (extra padding)\r\n if (this.getPosition().indexOf('top') > -1) {\r\n this._suggestions.style.maxHeight = (this._map.getSize().y - this._suggestions.offsetTop - this._wrapper.offsetTop - 10) + 'px';\r\n }\r\n\r\n // when the geocoder position is either \"bottomleft\" or \"bottomright\":\r\n // 1. set the maxHeight of the suggestions box to:\r\n // map height\r\n // - corner control container offsetHeight (height of container of bottom corner)\r\n // - control offsetHeight (height of geocoder control wrapper, the main expandable button)\r\n // 2. to move it up, set the top of the suggestions box to:\r\n // negative offsetHeight of suggestions box (its own negative height now that it has children elements\r\n // - control offsetHeight (height of geocoder control wrapper, the main expandable button)\r\n // + 20 (extra spacing)\r\n if (this.getPosition().indexOf('bottom') > -1) {\r\n this._setSuggestionsBottomPosition();\r\n }\r\n },\r\n\r\n _setSuggestionsBottomPosition: function () {\r\n this._suggestions.style.maxHeight = (this._map.getSize().y - this._map._controlCorners[this.getPosition()].offsetHeight - this._wrapper.offsetHeight) + 'px';\r\n this._suggestions.style.top = (-this._suggestions.offsetHeight - this._wrapper.offsetHeight + 20) + 'px';\r\n },\r\n\r\n _boundsFromResults: function (results) {\r\n if (!results.length) {\r\n return;\r\n }\r\n\r\n var nullIsland = latLngBounds([0, 0], [0, 0]);\r\n var resultBounds = [];\r\n var resultLatlngs = [];\r\n\r\n // collect the bounds and center of each result\r\n for (var i = results.length - 1; i >= 0; i--) {\r\n var result = results[i];\r\n\r\n resultLatlngs.push(result.latlng);\r\n\r\n // make sure bounds are valid and not 0,0. sometimes bounds are incorrect or not present\r\n if (result.bounds && result.bounds.isValid() && !result.bounds.equals(nullIsland)) {\r\n resultBounds.push(result.bounds);\r\n }\r\n }\r\n\r\n // form a bounds object containing all center points\r\n var bounds = latLngBounds(resultLatlngs);\r\n\r\n // and extend it to contain all bounds objects\r\n for (var j = 0; j < resultBounds.length; j++) {\r\n bounds.extend(resultBounds[j]);\r\n }\r\n\r\n return bounds;\r\n },\r\n\r\n clear: function () {\r\n this._clearAllSuggestions();\r\n\r\n if (this.options.collapseAfterResult) {\r\n this._input.value = '';\r\n this._lastValue = '';\r\n this._input.placeholder = '';\r\n DomUtil.removeClass(this._wrapper, 'geocoder-control-expanded');\r\n }\r\n\r\n if (!this._map.scrollWheelZoom.enabled() && this._map.options.scrollWheelZoom) {\r\n this._map.scrollWheelZoom.enable();\r\n }\r\n },\r\n\r\n _clearAllSuggestions: function () {\r\n this._suggestions.style.display = 'none';\r\n\r\n for (var i = 0; i < this.options.providers.length; i++) {\r\n this._clearProviderSuggestions(this.options.providers[i]);\r\n }\r\n },\r\n\r\n _clearProviderSuggestions: function (provider) {\r\n provider._contentsElement.innerHTML = '';\r\n },\r\n\r\n _finalizeSuggestions: function (activeRequests, suggestionsLength) {\r\n // check if all requests are finished to remove the loading indicator\r\n if (!activeRequests) {\r\n DomUtil.removeClass(this._input, 'geocoder-control-loading');\r\n\r\n // when the geocoder position is either \"bottomleft\" or \"bottomright\",\r\n // it is necessary in some cases to recalculate the maxHeight and top values of the this._suggestions element,\r\n // even though this is also being done after each provider returns their own suggestions\r\n if (this.getPosition().indexOf('bottom') > -1) {\r\n this._setSuggestionsBottomPosition();\r\n }\r\n\r\n // also check if there were 0 total suggest results to clear the parent suggestions element\r\n // otherwise its display value may be \"block\" instead of \"none\"\r\n if (!suggestionsLength) {\r\n this._clearAllSuggestions();\r\n }\r\n }\r\n },\r\n\r\n _setupClick: function () {\r\n DomUtil.addClass(this._wrapper, 'geocoder-control-expanded');\r\n this._input.focus();\r\n },\r\n\r\n disable: function () {\r\n this._input.disabled = true;\r\n DomUtil.addClass(this._input, 'geocoder-control-input-disabled');\r\n DomEvent.removeListener(this._wrapper, 'click', this._setupClick, this);\r\n },\r\n\r\n enable: function () {\r\n this._input.disabled = false;\r\n DomUtil.removeClass(this._input, 'geocoder-control-input-disabled');\r\n DomEvent.addListener(this._wrapper, 'click', this._setupClick, this);\r\n },\r\n\r\n getAttribution: function () {\r\n var attribs = [];\r\n\r\n for (var i = 0; i < this._providers.length; i++) {\r\n if (this._providers[i].options.attribution) {\r\n attribs.push(this._providers[i].options.attribution);\r\n }\r\n }\r\n\r\n return attribs.join(', ');\r\n },\r\n\r\n geocodeSuggestion: function (e) {\r\n var suggestionItem = e.target || e.srcElement;\r\n\r\n if (\r\n suggestionItem.classList.contains('geocoder-control-suggestions') ||\r\n suggestionItem.classList.contains('geocoder-control-header')\r\n ) {\r\n return;\r\n }\r\n\r\n // make sure and point at the actual 'geocoder-control-suggestion'\r\n if (suggestionItem.classList.length < 1) {\r\n suggestionItem = suggestionItem.parentNode;\r\n }\r\n\r\n this._geosearchCore._geocode(suggestionItem.unformattedText, suggestionItem['data-magic-key'], suggestionItem.provider);\r\n this.clear();\r\n },\r\n\r\n onAdd: function (map) {\r\n // include 'Powered by Esri' in map attribution\r\n EsriUtil.setEsriAttribution(map);\r\n\r\n this._map = map;\r\n this._wrapper = DomUtil.create('div', 'geocoder-control');\r\n this._input = DomUtil.create('input', 'geocoder-control-input leaflet-bar', this._wrapper);\r\n this._input.title = this.options.title;\r\n\r\n if (this.options.expanded) {\r\n DomUtil.addClass(this._wrapper, 'geocoder-control-expanded');\r\n this._input.placeholder = this.options.placeholder;\r\n }\r\n\r\n // create the main suggested results container element\r\n this._suggestions = DomUtil.create('div', 'geocoder-control-suggestions leaflet-bar', this._wrapper);\r\n\r\n // create a child contents container element for each provider inside of this._suggestions\r\n // to maintain the configured order of providers for suggested results\r\n for (var i = 0; i < this.options.providers.length; i++) {\r\n this.options.providers[i]._contentsElement = DomUtil.create('div', null, this._suggestions);\r\n }\r\n\r\n var credits = this._geosearchCore._getAttribution();\r\n\r\n if (map.attributionControl) {\r\n map.attributionControl.addAttribution(credits);\r\n }\r\n\r\n DomEvent.addListener(this._input, 'focus', function (e) {\r\n this._input.placeholder = this.options.placeholder;\r\n DomUtil.addClass(this._wrapper, 'geocoder-control-expanded');\r\n }, this);\r\n\r\n DomEvent.addListener(this._wrapper, 'click', this._setupClick, this);\r\n\r\n // make sure both click and touch spawn an address/poi search\r\n DomEvent.addListener(this._suggestions, 'mousedown', this.geocodeSuggestion, this);\r\n\r\n DomEvent.addListener(this._input, 'blur', function (e) {\r\n // TODO: this is too greedy and should not \"clear\"\r\n // when trying to use the scrollbar or clicking on a non-suggestion item (such as a provider header)\r\n this.clear();\r\n }, this);\r\n\r\n DomEvent.addListener(this._input, 'keydown', function (e) {\r\n var text = (e.target || e.srcElement).value;\r\n\r\n DomUtil.addClass(this._wrapper, 'geocoder-control-expanded');\r\n\r\n var list = this._suggestions.querySelectorAll('.' + 'geocoder-control-suggestion');\r\n var selected = this._suggestions.querySelectorAll('.' + 'geocoder-control-selected')[0];\r\n var selectedPosition;\r\n\r\n for (var i = 0; i < list.length; i++) {\r\n if (list[i] === selected) {\r\n selectedPosition = i;\r\n break;\r\n }\r\n }\r\n\r\n switch (e.keyCode) {\r\n case 13:\r\n /*\r\n if an item has been selected, geocode it\r\n if focus is on the input textbox, geocode only if multiple results are allowed and more than two characters are present, or if a single suggestion is displayed.\r\n if less than two characters have been typed, abort the geocode\r\n */\r\n if (selected) {\r\n this._input.value = selected.innerText;\r\n this._geosearchCore._geocode(selected.unformattedText, selected['data-magic-key'], selected.provider);\r\n this.clear();\r\n } else if (this.options.allowMultipleResults && text.length >= 2) {\r\n this._geosearchCore._geocode(this._input.value, undefined);\r\n this.clear();\r\n } else {\r\n if (list.length === 1) {\r\n DomUtil.addClass(list[0], 'geocoder-control-selected');\r\n this._geosearchCore._geocode(list[0].innerHTML, list[0]['data-magic-key'], list[0].provider);\r\n } else {\r\n this.clear();\r\n this._input.blur();\r\n }\r\n }\r\n DomEvent.preventDefault(e);\r\n break;\r\n case 38:\r\n if (selected) {\r\n DomUtil.removeClass(selected, 'geocoder-control-selected');\r\n }\r\n\r\n var previousItem = list[selectedPosition - 1];\r\n\r\n if (selected && previousItem) {\r\n DomUtil.addClass(previousItem, 'geocoder-control-selected');\r\n } else {\r\n DomUtil.addClass(list[list.length - 1], 'geocoder-control-selected');\r\n }\r\n DomEvent.preventDefault(e);\r\n break;\r\n case 40:\r\n if (selected) {\r\n DomUtil.removeClass(selected, 'geocoder-control-selected');\r\n }\r\n\r\n var nextItem = list[selectedPosition + 1];\r\n\r\n if (selected && nextItem) {\r\n DomUtil.addClass(nextItem, 'geocoder-control-selected');\r\n } else {\r\n DomUtil.addClass(list[0], 'geocoder-control-selected');\r\n }\r\n DomEvent.preventDefault(e);\r\n break;\r\n default:\r\n // when the input changes we should cancel all pending suggestion requests if possible to avoid result collisions\r\n for (var x = 0; x < this._geosearchCore._pendingSuggestions.length; x++) {\r\n var request = this._geosearchCore._pendingSuggestions[x];\r\n if (request && request.abort && !request.id) {\r\n request.abort();\r\n }\r\n }\r\n break;\r\n }\r\n }, this);\r\n\r\n DomEvent.addListener(this._input, 'keyup', Util.throttle(function (e) {\r\n var key = e.which || e.keyCode;\r\n var text = (e.target || e.srcElement).value;\r\n\r\n // require at least 2 characters for suggestions\r\n if (text.length < 2) {\r\n this._lastValue = this._input.value;\r\n this._clearAllSuggestions();\r\n DomUtil.removeClass(this._input, 'geocoder-control-loading');\r\n return;\r\n }\r\n\r\n // if this is the escape key it will clear the input so clear suggestions\r\n if (key === 27) {\r\n this._clearAllSuggestions();\r\n return;\r\n }\r\n\r\n // if this is NOT the up/down arrows or enter make a suggestion\r\n if (key !== 13 && key !== 38 && key !== 40) {\r\n if (this._input.value !== this._lastValue) {\r\n this._lastValue = this._input.value;\r\n DomUtil.addClass(this._input, 'geocoder-control-loading');\r\n this._geosearchCore._suggest(text);\r\n }\r\n }\r\n }, 50, this), this);\r\n\r\n DomEvent.disableClickPropagation(this._wrapper);\r\n\r\n // when mouse moves over suggestions disable scroll wheel zoom if its enabled\r\n DomEvent.addListener(this._suggestions, 'mouseover', function (e) {\r\n if (map.scrollWheelZoom.enabled() && map.options.scrollWheelZoom) {\r\n map.scrollWheelZoom.disable();\r\n }\r\n });\r\n\r\n // when mouse moves leaves suggestions enable scroll wheel zoom if its disabled\r\n DomEvent.addListener(this._suggestions, 'mouseout', function (e) {\r\n if (!map.scrollWheelZoom.enabled() && map.options.scrollWheelZoom) {\r\n map.scrollWheelZoom.enable();\r\n }\r\n });\r\n\r\n this._geosearchCore.on('load', function (e) {\r\n DomUtil.removeClass(this._input, 'geocoder-control-loading');\r\n this.clear();\r\n this._input.blur();\r\n }, this);\r\n\r\n return this._wrapper;\r\n }\r\n});\r\n\r\nexport function geosearch (options) {\r\n return new Geosearch(options);\r\n}\r\n\r\nexport default geosearch;\r\n","import { Util, geoJson, latLngBounds } from 'leaflet';\r\nimport { FeatureLayerService } from 'esri-leaflet';\r\n\r\nexport var FeatureLayerProvider = FeatureLayerService.extend({\r\n options: {\r\n label: 'Feature Layer',\r\n maxResults: 5,\r\n bufferRadius: 1000,\r\n searchMode: 'contain',\r\n formatSuggestion: function (feature) {\r\n return feature.properties[this.options.searchFields[0]];\r\n }\r\n },\r\n\r\n initialize: function (options) {\r\n if (options.apikey) {\r\n options.token = options.apikey;\r\n }\r\n FeatureLayerService.prototype.initialize.call(this, options);\r\n if (typeof this.options.searchFields === 'string') {\r\n this.options.searchFields = [this.options.searchFields];\r\n }\r\n this._suggestionsQuery = this.query();\r\n this._resultsQuery = this.query();\r\n },\r\n\r\n suggestions: function (text, bounds, callback) {\r\n var query = this._suggestionsQuery.where(this._buildQuery(text))\r\n .returnGeometry(false);\r\n\r\n if (bounds) {\r\n query.intersects(bounds);\r\n }\r\n\r\n if (this.options.idField) {\r\n query.fields([this.options.idField].concat(this.options.searchFields));\r\n }\r\n\r\n var request = query.run(function (error, results, raw) {\r\n if (error) {\r\n callback(error, []);\r\n } else {\r\n this.options.idField = raw.objectIdFieldName;\r\n var suggestions = [];\r\n for (var i = results.features.length - 1; i >= 0; i--) {\r\n var feature = results.features[i];\r\n suggestions.push({\r\n text: this.options.formatSuggestion.call(this, feature),\r\n unformattedText: feature.properties[this.options.searchFields[0]],\r\n magicKey: feature.id\r\n });\r\n }\r\n callback(error, suggestions.slice(0, this.options.maxResults));\r\n }\r\n }, this);\r\n\r\n return request;\r\n },\r\n\r\n results: function (text, key, bounds, callback) {\r\n var query = this._resultsQuery;\r\n\r\n if (key) {\r\n // if there are 1 or more keys available, use query.featureIds()\r\n delete query.params.where;\r\n query.featureIds([key]);\r\n } else {\r\n // if there are no keys available, use query.where()\r\n query.where(this._buildQuery(text));\r\n }\r\n\r\n if (bounds) {\r\n query.within(bounds);\r\n }\r\n\r\n return query.run(Util.bind(function (error, features) {\r\n var results = [];\r\n for (var i = 0; i < features.features.length; i++) {\r\n var feature = features.features[i];\r\n if (feature) {\r\n var bounds = this._featureBounds(feature);\r\n\r\n var result = {\r\n latlng: bounds.getCenter(),\r\n bounds: bounds,\r\n text: this.options.formatSuggestion.call(this, feature),\r\n properties: feature.properties,\r\n geojson: feature\r\n };\r\n\r\n results.push(result);\r\n\r\n // clear query parameters for the next search\r\n delete this._resultsQuery.params['objectIds'];\r\n }\r\n }\r\n callback(error, results);\r\n }, this));\r\n },\r\n\r\n orderBy: function (fieldName, order) {\r\n this._suggestionsQuery.orderBy(fieldName, order);\r\n },\r\n\r\n _buildQuery: function (text) {\r\n var queryString = [];\r\n\r\n for (var i = this.options.searchFields.length - 1; i >= 0; i--) {\r\n var field = 'upper(\"' + this.options.searchFields[i] + '\")';\r\n if (this.options.searchMode === 'contain') {\r\n queryString.push(field + \" LIKE upper('%\" + text + \"%')\");\r\n } else if (this.options.searchMode === 'startWith') {\r\n queryString.push(field + \" LIKE upper('\" + text + \"%')\");\r\n } else if (this.options.searchMode === 'endWith') {\r\n queryString.push(field + \" LIKE upper('%\" + text + \"')\");\r\n } else if (this.options.searchMode === 'strict') {\r\n queryString.push(field + \" LIKE upper('\" + text + \"')\");\r\n } else {\r\n throw new Error('L.esri.Geocoding.featureLayerProvider: Invalid parameter for \"searchMode\". Use one of \"contain\", \"startWith\", \"endWith\", or \"strict\"');\r\n }\r\n }\r\n if (this.options.where) {\r\n return this.options.where + ' AND (' + queryString.join(' OR ') + ')';\r\n } else {\r\n return queryString.join(' OR ');\r\n }\r\n },\r\n\r\n _featureBounds: function (feature) {\r\n var geojson = geoJson(feature);\r\n if (feature.geometry.type === 'Point') {\r\n var center = geojson.getBounds().getCenter();\r\n var lngRadius = ((this.options.bufferRadius / 40075017) * 360) / Math.cos((180 / Math.PI) * center.lat);\r\n var latRadius = (this.options.bufferRadius / 40075017) * 360;\r\n return latLngBounds([center.lat - latRadius, center.lng - lngRadius], [center.lat + latRadius, center.lng + lngRadius]);\r\n } else {\r\n return geojson.getBounds();\r\n }\r\n }\r\n});\r\n\r\nexport function featureLayerProvider (options) {\r\n return new FeatureLayerProvider(options);\r\n}\r\n\r\nexport default featureLayerProvider;\r\n","import { Util, geoJson, latLngBounds } from 'leaflet';\r\nimport { MapService } from 'esri-leaflet';\r\n\r\nexport var MapServiceProvider = MapService.extend({\r\n options: {\r\n layers: [0],\r\n label: 'Map Service',\r\n bufferRadius: 1000,\r\n maxResults: 5,\r\n formatSuggestion: function (feature) {\r\n return feature.properties[feature.displayFieldName] + ' ' + feature.layerName + '';\r\n }\r\n },\r\n\r\n initialize: function (options) {\r\n if (options.apikey) {\r\n options.token = options.apikey;\r\n }\r\n MapService.prototype.initialize.call(this, options);\r\n this._getIdFields();\r\n },\r\n\r\n suggestions: function (text, bounds, callback) {\r\n var request = this.find().text(text).fields(this.options.searchFields).returnGeometry(false).layers(this.options.layers);\r\n\r\n return request.run(function (error, results, raw) {\r\n var suggestions = [];\r\n if (!error) {\r\n var count = Math.min(this.options.maxResults, results.features.length);\r\n raw.results = raw.results.reverse();\r\n for (var i = 0; i < count; i++) {\r\n var feature = results.features[i];\r\n var result = raw.results[i];\r\n var layer = result.layerId;\r\n var idField = this._idFields[layer];\r\n feature.layerId = layer;\r\n feature.layerName = this._layerNames[layer];\r\n feature.displayFieldName = this._displayFields[layer];\r\n if (idField) {\r\n suggestions.push({\r\n text: this.options.formatSuggestion.call(this, feature),\r\n unformattedText: feature.properties[feature.displayFieldName],\r\n magicKey: result.attributes[idField] + ':' + layer\r\n });\r\n }\r\n }\r\n }\r\n callback(error, suggestions.reverse());\r\n }, this);\r\n },\r\n\r\n results: function (text, key, bounds, callback) {\r\n var results = [];\r\n var request;\r\n\r\n if (key && !key.includes(',')) {\r\n // if there is only 1 key available, use query()\r\n var featureId = key.split(':')[0];\r\n var layer = key.split(':')[1];\r\n request = this.query().layer(layer).featureIds(featureId);\r\n } else {\r\n // if there are no keys or more than 1 keys available, use find()\r\n request = this.find().text(text).fields(this.options.searchFields).layers(this.options.layers);\r\n }\r\n\r\n return request.run(function (error, features, response) {\r\n if (!error) {\r\n if (response.results) {\r\n response.results = response.results.reverse();\r\n }\r\n for (var i = 0; i < features.features.length; i++) {\r\n var feature = features.features[i];\r\n layer = layer || response.results[i].layerId;\r\n\r\n if (feature && layer !== undefined) {\r\n var bounds = this._featureBounds(feature);\r\n feature.layerId = layer;\r\n feature.layerName = this._layerNames[layer];\r\n feature.displayFieldName = this._displayFields[layer];\r\n\r\n var result = {\r\n latlng: bounds.getCenter(),\r\n bounds: bounds,\r\n text: this.options.formatSuggestion.call(this, feature),\r\n properties: feature.properties,\r\n geojson: feature\r\n };\r\n\r\n results.push(result);\r\n }\r\n }\r\n }\r\n callback(error, results.reverse());\r\n }, this);\r\n },\r\n\r\n _featureBounds: function (feature) {\r\n var geojson = geoJson(feature);\r\n if (feature.geometry.type === 'Point') {\r\n var center = geojson.getBounds().getCenter();\r\n var lngRadius = ((this.options.bufferRadius / 40075017) * 360) / Math.cos((180 / Math.PI) * center.lat);\r\n var latRadius = (this.options.bufferRadius / 40075017) * 360;\r\n return latLngBounds([center.lat - latRadius, center.lng - lngRadius], [center.lat + latRadius, center.lng + lngRadius]);\r\n } else {\r\n return geojson.getBounds();\r\n }\r\n },\r\n\r\n _layerMetadataCallback: function (layerid) {\r\n return Util.bind(function (error, metadata) {\r\n if (error) { return; }\r\n this._displayFields[layerid] = metadata.displayField;\r\n this._layerNames[layerid] = metadata.name;\r\n for (var i = 0; i < metadata.fields.length; i++) {\r\n var field = metadata.fields[i];\r\n if (field.type === 'esriFieldTypeOID') {\r\n this._idFields[layerid] = field.name;\r\n break;\r\n }\r\n }\r\n }, this);\r\n },\r\n\r\n _getIdFields: function () {\r\n this._idFields = {};\r\n this._displayFields = {};\r\n this._layerNames = {};\r\n for (var i = 0; i < this.options.layers.length; i++) {\r\n var layer = this.options.layers[i];\r\n this.get(layer, {}, this._layerMetadataCallback(layer));\r\n }\r\n }\r\n});\r\n\r\nexport function mapServiceProvider (options) {\r\n return new MapServiceProvider(options);\r\n}\r\n\r\nexport default mapServiceProvider;\r\n","import { GeocodeService } from '../Services/Geocode';\r\n\r\nexport var GeocodeServiceProvider = GeocodeService.extend({\r\n options: {\r\n label: 'Geocode Server',\r\n maxResults: 5\r\n },\r\n\r\n suggestions: function (text, bounds, callback) {\r\n if (this.options.supportsSuggest) {\r\n var request = this.suggest().text(text);\r\n if (bounds) {\r\n request.within(bounds);\r\n }\r\n\r\n return request.run(function (error, results, response) {\r\n var suggestions = [];\r\n if (!error) {\r\n while (response.suggestions.length && suggestions.length <= (this.options.maxResults - 1)) {\r\n var suggestion = response.suggestions.shift();\r\n if (!suggestion.isCollection) {\r\n suggestions.push({\r\n text: suggestion.text,\r\n unformattedText: suggestion.text,\r\n magicKey: suggestion.magicKey\r\n });\r\n }\r\n }\r\n }\r\n callback(error, suggestions);\r\n }, this);\r\n } else {\r\n callback(null, []);\r\n return false;\r\n }\r\n },\r\n\r\n results: function (text, key, bounds, callback) {\r\n var request = this.geocode().text(text);\r\n\r\n if (key) {\r\n request.key(key);\r\n }\r\n\r\n request.maxLocations(this.options.maxResults);\r\n\r\n if (bounds) {\r\n request.within(bounds);\r\n }\r\n\r\n return request.run(function (error, response) {\r\n callback(error, response.results);\r\n }, this);\r\n }\r\n});\r\n\r\nexport function geocodeServiceProvider (options) {\r\n return new GeocodeServiceProvider(options);\r\n}\r\n\r\nexport default geocodeServiceProvider;\r\n"],"names":["WorldGeocodingServiceUrl","Geocode","Task","extend","path","params","outSr","forStorage","outFields","maxLocations","setters","address","neighborhood","city","subregion","region","postal","country","text","category","token","apikey","key","fields","countries","initialize","options","url","prototype","call","this","within","bounds","latLngBounds","searchExtent","EsriUtil","Util","boundsToExtent","nearby","coords","radius","centroid","latLng","location","lng","lat","distance","Math","min","max","run","callback","context","customParam","singleLine","request","error","response","processor","_processGeocoderResponse","results","undefined","i","candidates","length","candidate","extent","extentToBounds","push","score","latlng","y","x","properties","attributes","geocode","ReverseGeocode","outSR","returnIntersection","language","intersection","result","reverseGeocode","Suggest","maxSuggestions","supportsSuggest","center","getCenter","ne","getNorthWest","distanceTo","console","warn","suggest","GeocodeService","Service","_confirmSuggestSupport","reverse","metadata","capabilities","indexOf","singleLineAddressField","name","GeosearchCore","Evented","zoomToResult","useMapBounds","searchBounds","control","setOptions","_control","providers","Error","_providers","_geocode","provider","activeRequests","allResults","bind","concat","_boundsFromResults","fire","_map","fitBounds","_searchBounds","_suggest","suggestionsLength","createCallback","suggestions","_clearProviderSuggestions","_finalizeSuggestions","_renderSuggestions","_lastRender","_input","value","_pendingSuggestions","getZoom","getBounds","nullIsland","resultBounds","resultLatlngs","isValid","equals","j","_getAttribution","attribs","attribution","join","geosearchCore","ArcgisOnlineProvider","label","maxResults","categories","suggestion","shift","isCollection","unformattedText","magicKey","arcgisOnlineProvider","Geosearch","Control","includes","position","collapseAfterResult","expanded","allowMultipleResults","placeholder","title","_geosearchCore","addEventParent","currentGroup","list","header","_suggestions","style","display","suggestionTextArray","DomUtil","create","_contentsElement","textContent","innerText","suggestionItem","innerHTML","childNodes","getPosition","maxHeight","getSize","offsetTop","_wrapper","_setSuggestionsBottomPosition","_controlCorners","offsetHeight","top","clear","_clearAllSuggestions","_lastValue","removeClass","scrollWheelZoom","enabled","enable","_setupClick","addClass","focus","disable","disabled","DomEvent","removeListener","addListener","getAttribution","geocodeSuggestion","e","target","srcElement","classList","contains","parentNode","onAdd","map","setEsriAttribution","credits","attributionControl","addAttribution","selectedPosition","querySelectorAll","selected","keyCode","blur","preventDefault","previousItem","nextItem","abort","id","throttle","which","disableClickPropagation","on","FeatureLayerProvider","FeatureLayerService","bufferRadius","searchMode","formatSuggestion","feature","searchFields","_suggestionsQuery","query","_resultsQuery","where","_buildQuery","returnGeometry","intersects","idField","raw","objectIdFieldName","features","slice","featureIds","_featureBounds","geojson","orderBy","fieldName","order","queryString","field","geoJson","geometry","type","lngRadius","cos","PI","latRadius","MapServiceProvider","MapService","layers","displayFieldName","layerName","_getIdFields","find","count","layer","layerId","_idFields","_layerNames","_displayFields","featureId","split","_layerMetadataCallback","layerid","displayField","get","GeocodeServiceProvider"],"mappings":";;;qXAAWA,EAA2B,2ECO3BC,EAAUC,EAAIA,KAACC,OAAO,CAC/BC,KAAM,wBAENC,OAAQ,CACNC,MAAO,KACPC,YAAY,EACZC,UAAW,IACXC,aAAc,IAGhBC,QAAS,CACPC,QAAS,UACTC,aAAc,eACdC,KAAM,OACNC,UAAW,YACXC,OAAQ,SACRC,OAAQ,SACRC,QAAS,UACTC,KAAM,aACNC,SAAU,WACVC,MAAO,QACPC,OAAQ,SACRC,IAAK,WACLC,OAAQ,YACRhB,WAAY,aACZE,aAAc,eAEde,UAAW,iBAGbC,WAAY,SAAUC,IACpBA,EAAUA,GAAW,IACbC,IAAMD,EAAQC,KAAO3B,EAC7BE,EAAIA,KAAC0B,UAAUH,WAAWI,KAAKC,KAAMJ,EACtC,EAEDK,OAAQ,SAAUC,GAGhB,OAFAA,EAASC,EAAAA,aAAaD,GACtBF,KAAKzB,OAAO6B,aAAeC,EAAQC,KAACC,eAAeL,GAC5CF,IACR,EAEDQ,OAAQ,SAAUC,EAAQC,GACxB,IAAIC,EAAWC,SAAOH,GAKtB,OAJAT,KAAKzB,OAAOsC,SAAWF,EAASG,IAAM,IAAMH,EAASI,IACjDL,IACFV,KAAKzB,OAAOyC,SAAWC,KAAKC,IAAID,KAAKE,IAAIT,EAAQ,KAAO,MAEnDV,IACR,EAEDoB,IAAK,SAAUC,EAAUC,GAYvB,OAXItB,KAAKJ,QAAQN,QACfU,KAAKzB,OAAOe,MAAQU,KAAKJ,QAAQN,OAE/BU,KAAKJ,QAAQL,SACfS,KAAKzB,OAAOe,MAAQU,KAAKJ,QAAQL,QAE/BS,KAAKJ,QAAQ2B,cACfvB,KAAKzB,OAAOyB,KAAKJ,QAAQ2B,aAAevB,KAAKzB,OAAOiD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,QAAQ6H,YAE9BvH,GACFuB,EAAQxB,OAAOC,GAGVuB,EAAQL,KAAI,SAAUM,EAAOC,GAClCN,EAASK,EAAOC,EAASG,QAC1B,GAAE9B,KACJ,qSFwFI,SAA+BJ,GACpC,OAAO,IAAImN,EAAqBnN,EAClC,+BJ1FO,SAAyBA,GAC9B,OAAO,IAAIoE,EAAepE,EAC5B,2BMCO,SAAiCA,GACtC,OAAO,IAAIwQ,EAAuBxQ,EACpC,cHiXO,SAAoBA,GACzB,OAAO,IAAIqI,EAAUrI,EACvB,yCEvSO,SAA6BA,GAClC,OAAO,IAAIqP,EAAmBrP,EAChC"} \ No newline at end of file diff --git a/dist/img/loading.gif b/dist/img/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..d123f8803336f9a9dd844217f503ce1a4c8bb6de GIT binary patch literal 1276 zcmZ?wbhEHblwy!#xN6Vv|NsBi*4D3IzuMZ`{{8z`RaKRrpMUo3+3xP{pFVwxiHRvF zDCq3${P5w!pFe-zzki>Ul;rE{yL9Q&wzjtA%a?!q_U-fM&(+n{U0q%O{{4%MjeYy} zZAnQp64gJbU&mKRhe%geuf`SS7O$2V`@JbwH*D=X{4g9oCbqMn|fMMXvS_V&Mj|Nj2{`}60|U0hsr zbaa0F`0?x4FQDTU|8x7fh6Fo12DlpO889<4Ffb_oWMSoEuxHQ#vVoqIVqjofabSLd zhmKVLi6uoRbFAk3HL=mfed`+{Dr3Gzr3wTtSGFn1-LqtO()R~#p!-N^o*0+*DRE|TAMOc`HhnvT?dAF6R+(a%e1~DEpgOl#T+7?0QgZQ>wbBmOa zi0zMj8u0Sf>o;%TIU*d-#=yqF%fJV8d^XVWD=zZ%>ojc$5U}!by3G6Ohhe?Sgv4*F zTi6ttSRP$yiaErd5`Od&+mgrcOJ#VYIb6K!_B_$AX%ur8E#edx;C0diI^W4smP^)N zLqn3CkzL7NM@p8{o}1gAiCs9?zMtVA#qF^mQiC)*D&8{rfKpGzthsI8S>v z3Fzzo3ujf%l#0x~|I~?t*J*0vBc_!}74(ASbqdjh}f{o2ydXi!5bSFEt4o%GpBrDmGqdB0%iMPMAr(mN*UrWEI z=ZEBfLbANC)vZ|gB&WW*9#~T3g zN!nU~-$@VXM?NVj7DZ;o6647#_N=V-{EFskPKHWO3!S^l1q8~G><1+?NHiw_y{s{j zr~iaQ!VL$$srKB5*^2*ZOp#AM_#(1ZjPKYdS*||8X2nOq_?gka^hR2^7JiOyl zq2r`1XjEm-1oWxBy1G3u)jJz@N!v3s+w;nqS~;uPIn8jgNR^TCL$Q_}Xe}t7vk%-q z|3pBler8Kyn#6=YQ1&Zn^-XU@h&$D|IcFpXO}shKN=aB$dj%1Y_DX}c|SGbnKq7cX&S Gum%9n!NQ>c literal 0 HcmV?d00001 diff --git a/dist/img/loading@2x.gif b/dist/img/loading@2x.gif new file mode 100644 index 0000000000000000000000000000000000000000..ceec3a11aad13fcb1da4d045e277b2f041b9a373 GIT binary patch literal 3973 zcmcJR`B#&NwuZmVAqn9N2@o0NOTrLh!~hWkqGkfZAO-{r0va$X0&2jaV9}F-d5{1O zOkx6PK~Vwmh*oXF7=$V)TIv`;Eh?wQp;lY1NAF$tp0>ZA{SWN5-u1lC-oYV3JijC^ zzy*GN0DS!T@!h+3d3kxi|Ni?QfBXRefL5#h@Zm#FPL7L_~ zuCA`@)~&mE@#2*$SCW#Fwr}6AR;%OVXo~@`{Bcfw{6>IGMOSHBg@Llh(sctPXFPD zA9n59H90x?`t|FWn3&Me(1#Bn_Vx8uS66@k{rBG9-a$b@si~>y>FI-mgS&U{PE1Uk zo15FWZy%G%w6U?dapQ)EhsUZ_s|*Iip+kqbTyAu9w6n7_g+gJmSPcygU0q%4*ROx_ zqcJv}`aE?j79Yy0}^uYG-edwY9- z{P9N&2D4?$miqd7Hk<9~=@}j#zH{f!HEY(`+uIKf4dLrMk?DXl= z^XJb$a^y&NcXvri$%YLZ3JMCWtgL)|eB^TZ;>C+6CMF;Vdj9eZ{CJ$pu@(bleA zTT@fBapT5=2M>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F@&Xz7IhX{(>*r9&NPr`?01olBlvL&zOk|}9lH!1Y;8CP3 zaXOd$eRYh~#-mvp82neETYWm5|0ndH0i{IMN%Rx zp2wUDb0Xh7g-xF{MdDTeQ`l$!G6MPU$MwE)2!kOiIHTx<`bi0Kqm#UZW-C#QS^y0S oDLRnrRVIYB_)77>l`lsT$1KGnhpnR^UF^^`D%=tG3Gb!<2GL#a_W%F@ literal 0 HcmV?d00001 diff --git a/dist/img/search-disabled.png b/dist/img/search-disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..7f8f5bb39a49d203ca5013704469c3c9e62a2767 GIT binary patch literal 386 zcmeAS@N?(olHy`uVBq!ia0vp^CLqkg1|*MGNWTVBY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN6Q>xr@S>fsrxni&L zT896{)53(K*NNWA*dBd;t772>FK@%=I!#UtznCsu&Pt8l6)Gyly8El8OQ^P1MpoSJ zSFYW$Q43o-pRPGCGF@hpQ|9WG*B*E_FE%^2Hu>#A&nV9C-ws;u-?mFLfIaoX b+Ce<$ac|_@u-{q0&|>g(^>bP0l+XkK9x<84 literal 0 HcmV?d00001 diff --git a/dist/img/search.png b/dist/img/search.png new file mode 100644 index 0000000000000000000000000000000000000000..0d01c4545e01d6d9773221a7209b6bc86b364cd4 GIT binary patch literal 425 zcmV;a0apHrP)~EiaUMAvsUQr<`5(fS6Ajfg^kM(H9D=zWr_l)bhzTZ_G;Kx*B4No}6 z1@1BUn-P^5`b%+uF6?0+QH*0to=@8d8j+AW%xdikoMIU}$e4mmf879HFrU@_j76EZ z?jR#F1vTOUA3l9Ia&52?bcYty`t-HS_0~pE3guWunbzKhIIeMKV=?SvLl#9R4pE0b z2_F7wKjpHIMlppijG-S#c*iz|Yz3*KV+qZuLIrwpg-RsRWFttgHyN3#3E4k2*vy*4 zKL_b`j!C)iz(T%)RIOu0?x)d{uOL-3IFVC5=j9!w)Tt4Zxq1xWuwjs~z6BTnz+hU1 TvwpQk00000NkvXXu0mjfh5NJY literal 0 HcmV?d00001 diff --git a/dist/img/search@2x-disabled.png b/dist/img/search@2x-disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..5ae89b3038066afb800bafcaf50b5688026e498d GIT binary patch literal 386 zcmeAS@N?(olHy`uVBq!ia0vp^CLqkg1|*MGNWTVBY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN6Q>v#kJ+kgs~H#=`8{16Lo)8Yo#o5ds=(9ov~_oZ z#kt21EqK@6I~FkEU%;ZnLWbXxm$j<3MZNyG?4xy@83T&~10#n61Ji^@9e2coz0Usp zY;$sV$T`b1b<3w1ZM7?SUsS$8u7f2<%;RX0vB8|L-irxni&L zT896{)53(K*NNWA*dBd;t772>FK@%=I!#UtznCsu&Pt8l6)Gyly8El8OQ^P1MpoSJ zSFYW$Q43o-pRPGCGF@hpQ|9WG*B*E_FE%^2Hu>#A&nV9C-ws;u-?mFLfIaoX b+Ce<$ac|_@u-{q0&|>g(^>bP0l+XkK58|1+ literal 0 HcmV?d00001 diff --git a/dist/img/search@2x.png b/dist/img/search@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..5e96a8b967a018b379a0eb79a475865a92e59ceb GIT binary patch literal 772 zcmV+f1N;1mP)qCJ4=M_RNE5_*tw8#CkPrnwqMq_Wl)fks0<(;Q-l9YZ2@(_`da*V_p@>Mc zDAWY2?SJ4594<4uvo7u#xd(o5@0q!?{AcdH=bXFYSS%J=NR}2_U}gnbK~|6zWCdA4 zR!|acaiRkwk%-r&rC>kE1FOJSFbulEgx}wZMx*m1$i-HJdT@q?m^KCOg9h+L`;^-a z-hzuBV#w0LDew-IY8F%gxJ{xR;6R+?Xjj`M`Y*HydSzq**FeTBW0rv199W&{)}=)dMg2>n zza2cCVUas2&tBnc0plvl2ewX7299&Th`-t$@Ql|-7Ei~soGLl?8eC0wrVvi_C|J}( zD>$wc`g{bvgqL6}ne|XIvTZ8b4uTutkB@QJ`3oM^SPxP3zW{cCo8Xgi{Tt{2N5n?5 zk*nLgV3U?LWZED&&#dE&nilRj#zZ`+fGKbuSQw4ezhdjn3p_z!`aAPRCa zjTRUG6(fNSj3BaV(Bl$L+POpzoFLjH%3XqSW+HJ?%VGT}ZxU17f6sw-I@OuNTx