diff --git a/assets/css/leaflet.css b/assets/css/leaflet.css index 70802f36..017fa0e4 100644 --- a/assets/css/leaflet.css +++ b/assets/css/leaflet.css @@ -25,6 +25,10 @@ user-select: none; -webkit-user-drag: none; } +/* Prevents IE11 from highlighting tiles in blue */ +.leaflet-tile::selection { + background: transparent; +} /* Safari renders non-retina tile on retina better with this, but Chrome is worse */ .leaflet-safari .leaflet-tile { image-rendering: -webkit-optimize-contrast; @@ -237,7 +241,8 @@ .leaflet-marker-icon.leaflet-interactive, .leaflet-image-layer.leaflet-interactive, -.leaflet-pane > svg path.leaflet-interactive { +.leaflet-pane > svg path.leaflet-interactive, +svg.leaflet-image-layer.leaflet-interactive path { pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ pointer-events: auto; } @@ -527,7 +532,7 @@ } .leaflet-oldie .leaflet-popup-content-wrapper { - zoom: 1; + -ms-zoom: 1; } .leaflet-oldie .leaflet-popup-tip { width: 24px; diff --git a/assets/js/Control.Geocoder.js b/assets/js/Control.Geocoder.js deleted file mode 100644 index 78408d40..00000000 --- a/assets/js/Control.Geocoder.js +++ /dev/null @@ -1,1348 +0,0 @@ -this.L = this.L || {}; -this.L.Control = this.L.Control || {}; -this.L.Control.Geocoder = (function (L) { -'use strict'; - -L = L && L.hasOwnProperty('default') ? L['default'] : L; - -var lastCallbackId = 0; - -// Adapted from handlebars.js -// https://github.com/wycats/handlebars.js/ -var badChars = /[&<>"'`]/g; -var possible = /[&<>"'`]/; -var escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' -}; - -function escapeChar(chr) { - return escape[chr]; -} - -function htmlEscape(string) { - if (string == null) { - return ''; - } else if (!string) { - return string + ''; - } - - // Force a string conversion as this will be done by the append regardless and - // the regex test will do this transparently behind the scenes, causing issues if - // an object's to string has escaped characters in it. - string = '' + string; - - if (!possible.test(string)) { - return string; - } - return string.replace(badChars, escapeChar); -} - -function jsonp(url, params, callback, context, jsonpParam) { - var callbackId = '_l_geocoder_' + lastCallbackId++; - params[jsonpParam || 'callback'] = callbackId; - window[callbackId] = L.Util.bind(callback, context); - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.src = url + L.Util.getParamString(params); - script.id = callbackId; - document.getElementsByTagName('head')[0].appendChild(script); -} - -function getJSON(url, params, callback) { - var xmlHttp = new XMLHttpRequest(); - xmlHttp.onreadystatechange = function() { - if (xmlHttp.readyState !== 4) { - return; - } - if (xmlHttp.status !== 200 && xmlHttp.status !== 304) { - callback(''); - return; - } - callback(JSON.parse(xmlHttp.response)); - }; - xmlHttp.open('GET', url + L.Util.getParamString(params), true); - xmlHttp.setRequestHeader('Accept', 'application/json'); - xmlHttp.send(null); -} - -function template(str, data) { - return str.replace(/\{ *([\w_]+) *\}/g, function(str, key) { - var value = data[key]; - if (value === undefined) { - value = ''; - } else if (typeof value === 'function') { - value = value(data); - } - return htmlEscape(value); - }); -} - -var Nominatim = { - class: L.Class.extend({ - options: { - serviceUrl: 'https://nominatim.openstreetmap.org/', - geocodingQueryParams: {}, - reverseQueryParams: {}, - htmlTemplate: function(r) { - var a = r.address, - parts = []; - if (a.road || a.building) { - parts.push('{building} {road} {house_number}'); - } - - if (a.city || a.town || a.village || a.hamlet) { - parts.push( - '{postcode} {city} {town} {village} {hamlet}' - ); - } - - if (a.state || a.country) { - parts.push( - '{state} {country}' - ); - } - - return template(parts.join('
'), a, true); - } - }, - - initialize: function(options) { - L.Util.setOptions(this, options); - }, - - geocode: function(query, cb, context) { - getJSON( - this.options.serviceUrl + 'search', - L.extend( - { - q: query, - limit: 5, - format: 'json', - addressdetails: 1 - }, - this.options.geocodingQueryParams - ), - L.bind(function(data) { - var results = []; - for (var i = data.length - 1; i >= 0; i--) { - var bbox = data[i].boundingbox; - for (var j = 0; j < 4; j++) bbox[j] = parseFloat(bbox[j]); - results[i] = { - icon: data[i].icon, - name: data[i].display_name, - html: this.options.htmlTemplate ? this.options.htmlTemplate(data[i]) : undefined, - bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]), - center: L.latLng(data[i].lat, data[i].lon), - properties: data[i] - }; - } - cb.call(context, results); - }, this) - ); - }, - - reverse: function(location, scale, cb, context) { - getJSON( - this.options.serviceUrl + 'reverse', - L.extend( - { - lat: location.lat, - lon: location.lng, - zoom: Math.round(Math.log(scale / 256) / Math.log(2)), - addressdetails: 1, - format: 'json' - }, - this.options.reverseQueryParams - ), - L.bind(function(data) { - var result = [], - loc; - - if (data && data.lat && data.lon) { - loc = L.latLng(data.lat, data.lon); - result.push({ - name: data.display_name, - html: this.options.htmlTemplate ? this.options.htmlTemplate(data) : undefined, - center: loc, - bounds: L.latLngBounds(loc, loc), - properties: data - }); - } - - cb.call(context, result); - }, this) - ); - } - }), - - factory: function(options) { - return new L.Control.Geocoder.Nominatim(options); - } -}; - -var Control = { - class: L.Control.extend({ - options: { - showResultIcons: false, - collapsed: true, - expand: 'touch', // options: touch, click, anythingelse - position: 'topright', - placeholder: 'Search...', - errorMessage: 'Nothing found.', - suggestMinLength: 3, - suggestTimeout: 250, - defaultMarkGeocode: true - }, - - includes: L.Evented.prototype || L.Mixin.Events, - - initialize: function(options) { - L.Util.setOptions(this, options); - if (!this.options.geocoder) { - this.options.geocoder = new Nominatim.class(); - } - - this._requestCount = 0; - }, - - onAdd: function(map) { - var className = 'leaflet-control-geocoder', - container = L.DomUtil.create('div', className + ' leaflet-bar'), - icon = L.DomUtil.create('button', className + '-icon', container), - form = (this._form = L.DomUtil.create('div', className + '-form', container)), - input; - - this._map = map; - this._container = container; - - icon.innerHTML = ' '; - icon.type = 'button'; - - input = this._input = L.DomUtil.create('input', '', form); - input.type = 'text'; - input.placeholder = this.options.placeholder; - - this._errorElement = L.DomUtil.create('div', className + '-form-no-error', container); - this._errorElement.innerHTML = this.options.errorMessage; - - this._alts = L.DomUtil.create( - 'ul', - className + '-alternatives leaflet-control-geocoder-alternatives-minimized', - container - ); - L.DomEvent.disableClickPropagation(this._alts); - - L.DomEvent.addListener(input, 'keydown', this._keydown, this); - if (this.options.geocoder.suggest) { - L.DomEvent.addListener(input, 'input', this._change, this); - } - L.DomEvent.addListener( - input, - 'blur', - function() { - if (this.options.collapsed && !this._preventBlurCollapse) { - this._collapse(); - } - this._preventBlurCollapse = false; - }, - this - ); - - if (this.options.collapsed) { - if (this.options.expand === 'click') { - L.DomEvent.addListener( - container, - 'click', - function(e) { - if (e.button === 0 && e.detail !== 2) { - this._toggle(); - } - }, - this - ); - } else if (L.Browser.touch && this.options.expand === 'touch') { - L.DomEvent.addListener( - container, - 'touchstart mousedown', - function(e) { - this._toggle(); - e.preventDefault(); // mobile: clicking focuses the icon, so UI expands and immediately collapses - e.stopPropagation(); - }, - this - ); - } else { - L.DomEvent.addListener(container, 'mouseover', this._expand, this); - L.DomEvent.addListener(container, 'mouseout', this._collapse, this); - this._map.on('movestart', this._collapse, this); - } - } else { - this._expand(); - if (L.Browser.touch) { - L.DomEvent.addListener( - container, - 'touchstart', - function() { - this._geocode(); - }, - this - ); - } else { - L.DomEvent.addListener( - container, - 'click', - function() { - this._geocode(); - }, - this - ); - } - } - - if (this.options.defaultMarkGeocode) { - this.on('markgeocode', this.markGeocode, this); - } - - this.on( - 'startgeocode', - function() { - L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber'); - }, - this - ); - this.on( - 'finishgeocode', - function() { - L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-throbber'); - }, - this - ); - - L.DomEvent.disableClickPropagation(container); - - return container; - }, - - _geocodeResult: function(results, suggest) { - if (!suggest && results.length === 1) { - this._geocodeResultSelected(results[0]); - } else if (results.length > 0) { - this._alts.innerHTML = ''; - this._results = results; - L.DomUtil.removeClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); - for (var i = 0; i < results.length; i++) { - this._alts.appendChild(this._createAlt(results[i], i)); - } - } else { - L.DomUtil.addClass(this._errorElement, 'leaflet-control-geocoder-error'); - } - }, - - markGeocode: function(result) { - result = result.geocode || result; - - this._map.fitBounds(result.bbox); - - if (this._geocodeMarker) { - this._map.removeLayer(this._geocodeMarker); - } - - this._geocodeMarker = new L.Marker(result.center) - .bindPopup(result.html || result.name) - .addTo(this._map) - .openPopup(); - - return this; - }, - - _geocode: function(suggest) { - var requestCount = ++this._requestCount, - mode = suggest ? 'suggest' : 'geocode', - eventData = { input: this._input.value }; - - this._lastGeocode = this._input.value; - if (!suggest) { - this._clearResults(); - } - - this.fire('start' + mode, eventData); - this.options.geocoder[mode]( - this._input.value, - function(results) { - if (requestCount === this._requestCount) { - eventData.results = results; - this.fire('finish' + mode, eventData); - this._geocodeResult(results, suggest); - } - }, - this - ); - }, - - _geocodeResultSelected: function(result) { - this.fire('markgeocode', { geocode: result }); - }, - - _toggle: function() { - if (L.DomUtil.hasClass(this._container, 'leaflet-control-geocoder-expanded')) { - this._collapse(); - } else { - this._expand(); - } - }, - - _expand: function() { - L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-expanded'); - this._input.select(); - this.fire('expand'); - }, - - _collapse: function() { - L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-expanded'); - L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); - L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error'); - this._input.blur(); // mobile: keyboard shouldn't stay expanded - this.fire('collapse'); - }, - - _clearResults: function() { - L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized'); - this._selection = null; - L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error'); - }, - - _createAlt: function(result, index) { - var li = L.DomUtil.create('li', ''), - a = L.DomUtil.create('a', '', li), - icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null, - text = result.html ? undefined : document.createTextNode(result.name), - mouseDownHandler = function mouseDownHandler(e) { - // In some browsers, a click will fire on the map if the control is - // collapsed directly after mousedown. To work around this, we - // wait until the click is completed, and _then_ collapse the - // control. Messy, but this is the workaround I could come up with - // for #142. - this._preventBlurCollapse = true; - L.DomEvent.stop(e); - this._geocodeResultSelected(result); - L.DomEvent.on( - li, - 'click', - function() { - if (this.options.collapsed) { - this._collapse(); - } else { - this._clearResults(); - } - }, - this - ); - }; - - if (icon) { - icon.src = result.icon; - } - - li.setAttribute('data-result-index', index); - - if (result.html) { - a.innerHTML = a.innerHTML + result.html; - } else { - a.appendChild(text); - } - - // Use mousedown and not click, since click will fire _after_ blur, - // causing the control to have collapsed and removed the items - // before the click can fire. - L.DomEvent.addListener(li, 'mousedown touchstart', mouseDownHandler, this); - - return li; - }, - - _keydown: function(e) { - var _this = this, - select = function select(dir) { - if (_this._selection) { - L.DomUtil.removeClass(_this._selection, 'leaflet-control-geocoder-selected'); - _this._selection = _this._selection[dir > 0 ? 'nextSibling' : 'previousSibling']; - } - if (!_this._selection) { - _this._selection = _this._alts[dir > 0 ? 'firstChild' : 'lastChild']; - } - - if (_this._selection) { - L.DomUtil.addClass(_this._selection, 'leaflet-control-geocoder-selected'); - } - }; - - switch (e.keyCode) { - // Escape - case 27: - if (this.options.collapsed) { - this._collapse(); - } - break; - // Up - case 38: - select(-1); - break; - // Up - case 40: - select(1); - break; - // Enter - case 13: - if (this._selection) { - var index = parseInt(this._selection.getAttribute('data-result-index'), 10); - this._geocodeResultSelected(this._results[index]); - this._clearResults(); - } else { - this._geocode(); - } - break; - } - }, - _change: function() { - var v = this._input.value; - if (v !== this._lastGeocode) { - clearTimeout(this._suggestTimeout); - if (v.length >= this.options.suggestMinLength) { - this._suggestTimeout = setTimeout( - L.bind(function() { - this._geocode(true); - }, this), - this.options.suggestTimeout - ); - } else { - this._clearResults(); - } - } - } - }), - factory: function(options) { - return new L.Control.Geocoder(options); - } -}; - -var Bing = { - class: L.Class.extend({ - initialize: function(key) { - this.key = key; - }, - - geocode: function(query, cb, context) { - jsonp( - 'https://dev.virtualearth.net/REST/v1/Locations', - { - query: query, - key: this.key - }, - function(data) { - var results = []; - if (data.resourceSets.length > 0) { - for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) { - var resource = data.resourceSets[0].resources[i], - bbox = resource.bbox; - results[i] = { - name: resource.name, - bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]), - center: L.latLng(resource.point.coordinates) - }; - } - } - cb.call(context, results); - }, - this, - 'jsonp' - ); - }, - - reverse: function(location, scale, cb, context) { - jsonp( - '//dev.virtualearth.net/REST/v1/Locations/' + location.lat + ',' + location.lng, - { - key: this.key - }, - function(data) { - var results = []; - for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) { - var resource = data.resourceSets[0].resources[i], - bbox = resource.bbox; - results[i] = { - name: resource.name, - bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]), - center: L.latLng(resource.point.coordinates) - }; - } - cb.call(context, results); - }, - this, - 'jsonp' - ); - } - }), - - factory: function(key) { - return new L.Control.Geocoder.Bing(key); - } -}; - -var MapQuest = { - class: L.Class.extend({ - options: { - serviceUrl: 'https://www.mapquestapi.com/geocoding/v1' - }, - - initialize: function(key, options) { - // MapQuest seems to provide URI encoded API keys, - // so to avoid encoding them twice, we decode them here - this._key = decodeURIComponent(key); - - L.Util.setOptions(this, options); - }, - - _formatName: function() { - var r = [], - i; - for (i = 0; i < arguments.length; i++) { - if (arguments[i]) { - r.push(arguments[i]); - } - } - - return r.join(', '); - }, - - geocode: function(query, cb, context) { - getJSON( - this.options.serviceUrl + '/address', - { - key: this._key, - location: query, - limit: 5, - outFormat: 'json' - }, - L.bind(function(data) { - var results = [], - loc, - latLng; - if (data.results && data.results[0].locations) { - for (var i = data.results[0].locations.length - 1; i >= 0; i--) { - loc = data.results[0].locations[i]; - latLng = L.latLng(loc.latLng); - results[i] = { - name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1), - bbox: L.latLngBounds(latLng, latLng), - center: latLng - }; - } - } - - cb.call(context, results); - }, this) - ); - }, - - reverse: function(location, scale, cb, context) { - getJSON( - this.options.serviceUrl + '/reverse', - { - key: this._key, - location: location.lat + ',' + location.lng, - outputFormat: 'json' - }, - L.bind(function(data) { - var results = [], - loc, - latLng; - if (data.results && data.results[0].locations) { - for (var i = data.results[0].locations.length - 1; i >= 0; i--) { - loc = data.results[0].locations[i]; - latLng = L.latLng(loc.latLng); - results[i] = { - name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1), - bbox: L.latLngBounds(latLng, latLng), - center: latLng - }; - } - } - - cb.call(context, results); - }, this) - ); - } - }), - - factory: function(key, options) { - return new L.Control.Geocoder.MapQuest(key, options); - } -}; - -var Mapbox = { - class: L.Class.extend({ - options: { - serviceUrl: 'https://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/', - geocodingQueryParams: {}, - reverseQueryParams: {} - }, - - initialize: function(accessToken, options) { - L.setOptions(this, options); - this.options.geocodingQueryParams.access_token = accessToken; - this.options.reverseQueryParams.access_token = accessToken; - }, - - geocode: function(query, cb, context) { - var params = this.options.geocodingQueryParams; - if ( - typeof params.proximity !== 'undefined' && - params.proximity.hasOwnProperty('lat') && - params.proximity.hasOwnProperty('lng') - ) { - params.proximity = params.proximity.lng + ',' + params.proximity.lat; - } - getJSON(this.options.serviceUrl + encodeURIComponent(query) + '.json', params, function( - data - ) { - var results = [], - loc, - latLng, - latLngBounds; - if (data.features && data.features.length) { - for (var i = 0; i <= data.features.length - 1; i++) { - loc = data.features[i]; - latLng = L.latLng(loc.center.reverse()); - if (loc.hasOwnProperty('bbox')) { - latLngBounds = L.latLngBounds( - L.latLng(loc.bbox.slice(0, 2).reverse()), - L.latLng(loc.bbox.slice(2, 4).reverse()) - ); - } else { - latLngBounds = L.latLngBounds(latLng, latLng); - } - results[i] = { - name: loc.place_name, - bbox: latLngBounds, - center: latLng - }; - } - } - - cb.call(context, results); - }); - }, - - suggest: function(query, cb, context) { - return this.geocode(query, cb, context); - }, - - reverse: function(location, scale, cb, context) { - getJSON( - this.options.serviceUrl + - encodeURIComponent(location.lng) + - ',' + - encodeURIComponent(location.lat) + - '.json', - this.options.reverseQueryParams, - function(data) { - var results = [], - loc, - latLng, - latLngBounds; - if (data.features && data.features.length) { - for (var i = 0; i <= data.features.length - 1; i++) { - loc = data.features[i]; - latLng = L.latLng(loc.center.reverse()); - if (loc.hasOwnProperty('bbox')) { - latLngBounds = L.latLngBounds( - L.latLng(loc.bbox.slice(0, 2).reverse()), - L.latLng(loc.bbox.slice(2, 4).reverse()) - ); - } else { - latLngBounds = L.latLngBounds(latLng, latLng); - } - results[i] = { - name: loc.place_name, - bbox: latLngBounds, - center: latLng - }; - } - } - - cb.call(context, results); - } - ); - } - }), - - factory: function(accessToken, options) { - return new L.Control.Geocoder.Mapbox(accessToken, options); - } -}; - -var What3Words = { - class: L.Class.extend({ - options: { - serviceUrl: 'https://api.what3words.com/v2/' - }, - - initialize: function(accessToken) { - this._accessToken = accessToken; - }, - - geocode: function(query, cb, context) { - //get three words and make a dot based string - getJSON( - this.options.serviceUrl + 'forward', - { - key: this._accessToken, - addr: query.split(/\s+/).join('.') - }, - function(data) { - var results = [], - latLng, - latLngBounds; - if (data.hasOwnProperty('geometry')) { - latLng = L.latLng(data.geometry['lat'], data.geometry['lng']); - latLngBounds = L.latLngBounds(latLng, latLng); - results[0] = { - name: data.words, - bbox: latLngBounds, - center: latLng - }; - } - - cb.call(context, results); - } - ); - }, - - suggest: function(query, cb, context) { - return this.geocode(query, cb, context); - }, - - reverse: function(location, scale, cb, context) { - getJSON( - this.options.serviceUrl + 'reverse', - { - key: this._accessToken, - coords: [location.lat, location.lng].join(',') - }, - function(data) { - var results = [], - latLng, - latLngBounds; - if (data.status.status == 200) { - latLng = L.latLng(data.geometry['lat'], data.geometry['lng']); - latLngBounds = L.latLngBounds(latLng, latLng); - results[0] = { - name: data.words, - bbox: latLngBounds, - center: latLng - }; - } - cb.call(context, results); - } - ); - } - }), - - factory: function(accessToken) { - return new L.Control.Geocoder.What3Words(accessToken); - } -}; - -var Google = { - class: L.Class.extend({ - options: { - serviceUrl: 'https://maps.googleapis.com/maps/api/geocode/json', - geocodingQueryParams: {}, - reverseQueryParams: {} - }, - - initialize: function(key, options) { - this._key = key; - L.setOptions(this, options); - // Backwards compatibility - this.options.serviceUrl = this.options.service_url || this.options.serviceUrl; - }, - - geocode: function(query, cb, context) { - var params = { - address: query - }; - - if (this._key && this._key.length) { - params.key = this._key; - } - - params = L.Util.extend(params, this.options.geocodingQueryParams); - - getJSON(this.options.serviceUrl, params, function(data) { - var results = [], - loc, - latLng, - latLngBounds; - if (data.results && data.results.length) { - for (var i = 0; i <= data.results.length - 1; i++) { - loc = data.results[i]; - latLng = L.latLng(loc.geometry.location); - latLngBounds = L.latLngBounds( - L.latLng(loc.geometry.viewport.northeast), - L.latLng(loc.geometry.viewport.southwest) - ); - results[i] = { - name: loc.formatted_address, - bbox: latLngBounds, - center: latLng, - properties: loc.address_components - }; - } - } - - cb.call(context, results); - }); - }, - - reverse: function(location, scale, cb, context) { - var params = { - latlng: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng) - }; - params = L.Util.extend(params, this.options.reverseQueryParams); - if (this._key && this._key.length) { - params.key = this._key; - } - - getJSON(this.options.serviceUrl, params, function(data) { - var results = [], - loc, - latLng, - latLngBounds; - if (data.results && data.results.length) { - for (var i = 0; i <= data.results.length - 1; i++) { - loc = data.results[i]; - latLng = L.latLng(loc.geometry.location); - latLngBounds = L.latLngBounds( - L.latLng(loc.geometry.viewport.northeast), - L.latLng(loc.geometry.viewport.southwest) - ); - results[i] = { - name: loc.formatted_address, - bbox: latLngBounds, - center: latLng, - properties: loc.address_components - }; - } - } - - cb.call(context, results); - }); - } - }), - - factory: function(key, options) { - return new L.Control.Geocoder.Google(key, options); - } -}; - -var Photon = { - class: L.Class.extend({ - options: { - serviceUrl: 'https://photon.komoot.de/api/', - reverseUrl: 'https://photon.komoot.de/reverse/', - nameProperties: ['name', 'street', 'suburb', 'hamlet', 'town', 'city', 'state', 'country'] - }, - - initialize: function(options) { - L.setOptions(this, options); - }, - - geocode: function(query, cb, context) { - var params = L.extend( - { - q: query - }, - this.options.geocodingQueryParams - ); - - getJSON( - this.options.serviceUrl, - params, - L.bind(function(data) { - cb.call(context, this._decodeFeatures(data)); - }, this) - ); - }, - - suggest: function(query, cb, context) { - return this.geocode(query, cb, context); - }, - - reverse: function(latLng, scale, cb, context) { - var params = L.extend( - { - lat: latLng.lat, - lon: latLng.lng - }, - this.options.reverseQueryParams - ); - - getJSON( - this.options.reverseUrl, - params, - L.bind(function(data) { - cb.call(context, this._decodeFeatures(data)); - }, this) - ); - }, - - _decodeFeatures: function(data) { - var results = [], - i, - f, - c, - latLng, - extent, - bbox; - - if (data && data.features) { - for (i = 0; i < data.features.length; i++) { - f = data.features[i]; - c = f.geometry.coordinates; - latLng = L.latLng(c[1], c[0]); - extent = f.properties.extent; - - if (extent) { - bbox = L.latLngBounds([extent[1], extent[0]], [extent[3], extent[2]]); - } else { - bbox = L.latLngBounds(latLng, latLng); - } - - results.push({ - name: this._deocodeFeatureName(f), - html: this.options.htmlTemplate ? this.options.htmlTemplate(f) : undefined, - center: latLng, - bbox: bbox, - properties: f.properties - }); - } - } - - return results; - }, - - _deocodeFeatureName: function(f) { - var j, name; - for (j = 0; !name && j < this.options.nameProperties.length; j++) { - name = f.properties[this.options.nameProperties[j]]; - } - - return name; - } - }), - - factory: function(options) { - return new L.Control.Geocoder.Photon(options); - } -}; - -var Mapzen = { - class: L.Class.extend({ - options: { - serviceUrl: 'https://search.mapzen.com/v1', - geocodingQueryParams: {}, - reverseQueryParams: {} - }, - - initialize: function(apiKey, options) { - L.Util.setOptions(this, options); - this._apiKey = apiKey; - this._lastSuggest = 0; - }, - - geocode: function(query, cb, context) { - var _this = this; - getJSON( - this.options.serviceUrl + '/search', - L.extend( - { - api_key: this._apiKey, - text: query - }, - this.options.geocodingQueryParams - ), - function(data) { - cb.call(context, _this._parseResults(data, 'bbox')); - } - ); - }, - - suggest: function(query, cb, context) { - var _this = this; - getJSON( - this.options.serviceUrl + '/autocomplete', - L.extend( - { - api_key: this._apiKey, - text: query - }, - this.options.geocodingQueryParams - ), - L.bind(function(data) { - if (data.geocoding.timestamp > this._lastSuggest) { - this._lastSuggest = data.geocoding.timestamp; - cb.call(context, _this._parseResults(data, 'bbox')); - } - }, this) - ); - }, - - reverse: function(location, scale, cb, context) { - var _this = this; - getJSON( - this.options.serviceUrl + '/reverse', - L.extend( - { - api_key: this._apiKey, - 'point.lat': location.lat, - 'point.lon': location.lng - }, - this.options.reverseQueryParams - ), - function(data) { - cb.call(context, _this._parseResults(data, 'bounds')); - } - ); - }, - - _parseResults: function(data, bboxname) { - var results = []; - L.geoJson(data, { - pointToLayer: function(feature, latlng) { - return L.circleMarker(latlng); - }, - onEachFeature: function(feature, layer) { - var result = {}, - bbox, - center; - - if (layer.getBounds) { - bbox = layer.getBounds(); - center = bbox.getCenter(); - } else { - center = layer.getLatLng(); - bbox = L.latLngBounds(center, center); - } - - result.name = layer.feature.properties.label; - result.center = center; - result[bboxname] = bbox; - result.properties = layer.feature.properties; - results.push(result); - } - }); - return results; - } - }), - - factory: function(apiKey, options) { - return new L.Control.Geocoder.Mapzen(apiKey, options); - } -}; - -var ArcGis = { - class: L.Class.extend({ - options: { - service_url: 'http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer' - }, - - initialize: function(accessToken, options) { - L.setOptions(this, options); - this._accessToken = accessToken; - }, - - geocode: function(query, cb, context) { - var params = { - SingleLine: query, - outFields: 'Addr_Type', - forStorage: false, - maxLocations: 10, - f: 'json' - }; - - if (this._key && this._key.length) { - params.token = this._key; - } - - getJSON(this.options.service_url + '/findAddressCandidates', params, function(data) { - var results = [], - loc, - latLng, - latLngBounds; - - if (data.candidates && data.candidates.length) { - for (var i = 0; i <= data.candidates.length - 1; i++) { - loc = data.candidates[i]; - latLng = L.latLng(loc.location.y, loc.location.x); - latLngBounds = L.latLngBounds( - L.latLng(loc.extent.ymax, loc.extent.xmax), - L.latLng(loc.extent.ymin, loc.extent.xmin) - ); - results[i] = { - name: loc.address, - bbox: latLngBounds, - center: latLng - }; - } - } - - cb.call(context, results); - }); - }, - - suggest: function(query, cb, context) { - return this.geocode(query, cb, context); - }, - - reverse: function(location, scale, cb, context) { - var params = { - location: encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat), - distance: 100, - f: 'json' - }; - - getJSON(this.options.service_url + '/reverseGeocode', params, function(data) { - var result = [], - loc; - - if (data && !data.error) { - loc = L.latLng(data.location.y, data.location.x); - result.push({ - name: data.address.Match_addr, - center: loc, - bounds: L.latLngBounds(loc, loc) - }); - } - - cb.call(context, result); - }); - } - }), - - factory: function(accessToken, options) { - return new L.Control.Geocoder.ArcGis(accessToken, options); - } -}; - -var HERE = { - class: L.Class.extend({ - options: { - geocodeUrl: 'http://geocoder.api.here.com/6.2/geocode.json', - reverseGeocodeUrl: 'http://reverse.geocoder.api.here.com/6.2/reversegeocode.json', - app_id: '', - app_code: '', - geocodingQueryParams: {}, - reverseQueryParams: {} - }, - - initialize: function(options) { - L.setOptions(this, options); - }, - - geocode: function(query, cb, context) { - var params = { - searchtext: query, - gen: 9, - app_id: this.options.app_id, - app_code: this.options.app_code, - jsonattributes: 1 - }; - params = L.Util.extend(params, this.options.geocodingQueryParams); - this.getJSON(this.options.geocodeUrl, params, cb, context); - }, - - reverse: function(location, scale, cb, context) { - var params = { - prox: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng), - mode: 'retrieveAddresses', - app_id: this.options.app_id, - app_code: this.options.app_code, - gen: 9, - jsonattributes: 1 - }; - params = L.Util.extend(params, this.options.reverseQueryParams); - this.getJSON(this.options.reverseGeocodeUrl, params, cb, context); - }, - - getJSON: function(url, params, cb, context) { - getJSON(url, params, function(data) { - var results = [], - loc, - latLng, - latLngBounds; - if (data.response.view && data.response.view.length) { - for (var i = 0; i <= data.response.view[0].result.length - 1; i++) { - loc = data.response.view[0].result[i].location; - latLng = L.latLng(loc.displayPosition.latitude, loc.displayPosition.longitude); - latLngBounds = L.latLngBounds( - L.latLng(loc.mapView.topLeft.latitude, loc.mapView.topLeft.longitude), - L.latLng(loc.mapView.bottomRight.latitude, loc.mapView.bottomRight.longitude) - ); - results[i] = { - name: loc.address.label, - bbox: latLngBounds, - center: latLng - }; - } - } - cb.call(context, results); - }); - } - }), - - factory: function(options) { - return new L.Control.Geocoder.HERE(options); - } -}; - -var Geocoder = L.Util.extend(Control.class, { - Nominatim: Nominatim.class, - nominatim: Nominatim.factory, - Bing: Bing.class, - bing: Bing.factory, - MapQuest: MapQuest.class, - mapQuest: MapQuest.factory, - Mapbox: Mapbox.class, - mapbox: Mapbox.factory, - What3Words: What3Words.class, - what3words: What3Words.factory, - Google: Google.class, - google: Google.factory, - Photon: Photon.class, - photon: Photon.factory, - Mapzen: Mapzen.class, - mapzen: Mapzen.factory, - ArcGis: ArcGis.class, - arcgis: ArcGis.factory, - HERE: HERE.class, - here: HERE.factory -}); - -L.Util.extend(L.Control, { - Geocoder: Geocoder, - geocoder: Control.factory -}); - -return Geocoder; - -}(L)); -//# sourceMappingURL=Control.Geocoder.js.map diff --git a/assets/js/Control.Geocoder.min.js b/assets/js/Control.Geocoder.min.js new file mode 100644 index 00000000..3c5c4ffd --- /dev/null +++ b/assets/js/Control.Geocoder.min.js @@ -0,0 +1,10 @@ +/* @preserve + * Leaflet Control Geocoder 1.13.0 + * https://github.com/perliedman/leaflet-control-geocoder + * + * Copyright (c) 2012 sa3m (https://github.com/sa3m) + * Copyright (c) 2018 Per Liedman + * All rights reserved. + */ +this.L=this.L||{},this.L.Control=this.L.Control||{},this.L.Control.Geocoder=function(d){"use strict";d=d&&d.hasOwnProperty("default")?d.default:d;var a=0,i=/[&<>"'`]/g,r=/[&<>"'`]/,t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};function l(e){return t[e]}function o(e,t,o,s,n){var i="_l_geocoder_"+a++;t[n||"callback"]=i,window[i]=d.Util.bind(o,s);var r=document.createElement("script");r.type="text/javascript",r.src=e+c(t),r.id=i,document.getElementsByTagName("head")[0].appendChild(r)}function u(e,t,o){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(4===s.readyState){var t;if(200!==s.status&&304!==s.status)t="";else if("string"==typeof s.response)try{t=JSON.parse(s.response)}catch(e){t=s.response}else t=s.response;o(t)}},s.open("GET",e+c(t),!0),s.responseType="json",s.setRequestHeader("Accept","application/json"),s.send(null)}function n(e,n){return e.replace(/\{ *([\w_]+) *\}/g,function(e,t){var o,s=n[t];return void 0===s?s="":"function"==typeof s&&(s=s(n)),null==(o=s)?"":o?(o=""+o,r.test(o)?o.replace(i,l):o):o+""})}function c(e,t,o){var s=[];for(var n in e){var i=encodeURIComponent(o?n.toUpperCase():n),r=e[n];if(d.Util.isArray(r))for(var a=0;a",app_code:"",geocodingQueryParams:{},reverseQueryParams:{},reverseGeocodeProxRadius:null},initialize:function(e){d.setOptions(this,e)},geocode:function(e,t,o){var s={searchtext:e,gen:9,app_id:this.options.app_id,app_code:this.options.app_code,jsonattributes:1};s=d.Util.extend(s,this.options.geocodingQueryParams),this.getJSON(this.options.geocodeUrl,s,t,o)},reverse:function(e,t,o,s){var n=this.options.reverseGeocodeProxRadius?this.options.reverseGeocodeProxRadius:null,i=n?","+encodeURIComponent(n):"",r={prox:encodeURIComponent(e.lat)+","+encodeURIComponent(e.lng)+i,mode:"retrieveAddresses",app_id:this.options.app_id,app_code:this.options.app_code,gen:9,jsonattributes:1};r=d.Util.extend(r,this.options.reverseQueryParams),this.getJSON(this.options.reverseGeocodeUrl,r,o,s)},getJSON:function(e,t,r,a){u(e,t,function(e){var t,o,s,n=[];if(e.response.view&&e.response.view.length)for(var i=0;i<=e.response.view[0].result.length-1;i++)t=e.response.view[0].result[i].location,o=d.latLng(t.displayPosition.latitude,t.displayPosition.longitude),s=d.latLngBounds(d.latLng(t.mapView.topLeft.latitude,t.mapView.topLeft.longitude),d.latLng(t.mapView.bottomRight.latitude,t.mapView.bottomRight.longitude)),n[i]={name:t.address.label,properties:t.address,bbox:s,center:o};r.call(a,n)})}});var m=d.Class.extend({options:{next:void 0,sizeInMeters:1e4},initialize:function(e){d.Util.setOptions(this,e)},geocode:function(e,t,o){var s,n;if((s=e.match(/^([NS])\s*(\d{1,3}(?:\.\d*)?)\W*([EW])\s*(\d{1,3}(?:\.\d*)?)$/))?n=d.latLng((/N/i.test(s[1])?1:-1)*parseFloat(s[2]),(/E/i.test(s[3])?1:-1)*parseFloat(s[4])):(s=e.match(/^(\d{1,3}(?:\.\d*)?)\s*([NS])\W*(\d{1,3}(?:\.\d*)?)\s*([EW])$/))?n=d.latLng((/N/i.test(s[2])?1:-1)*parseFloat(s[1]),(/E/i.test(s[4])?1:-1)*parseFloat(s[3])):(s=e.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?$/))?n=d.latLng((/N/i.test(s[1])?1:-1)*(parseFloat(s[2])+parseFloat(s[3]/60)),(/E/i.test(s[4])?1:-1)*(parseFloat(s[5])+parseFloat(s[6]/60))):(s=e.match(/^(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([NS])\W*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([EW])$/))?n=d.latLng((/N/i.test(s[3])?1:-1)*(parseFloat(s[1])+parseFloat(s[2]/60)),(/E/i.test(s[6])?1:-1)*(parseFloat(s[4])+parseFloat(s[5]/60))):(s=e.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?$/))?n=d.latLng((/N/i.test(s[1])?1:-1)*(parseFloat(s[2])+parseFloat(s[3]/60+parseFloat(s[4]/3600))),(/E/i.test(s[5])?1:-1)*(parseFloat(s[6])+parseFloat(s[7]/60)+parseFloat(s[8]/3600))):(s=e.match(/^(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]\s*([NS])\W*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?\s*([EW])$/))?n=d.latLng((/N/i.test(s[4])?1:-1)*(parseFloat(s[1])+parseFloat(s[2]/60+parseFloat(s[3]/3600))),(/E/i.test(s[8])?1:-1)*(parseFloat(s[5])+parseFloat(s[6]/60)+parseFloat(s[7]/3600))):(s=e.match(/^\s*([+-]?\d+(?:\.\d*)?)\s*[\s,]\s*([+-]?\d+(?:\.\d*)?)\s*$/))&&(n=d.latLng(parseFloat(s[1]),parseFloat(s[2]))),n){var i=[{name:e,center:n,bbox:n.toBounds(this.options.sizeInMeters)}];t.call(o,i)}else this.options.next&&this.options.next.geocode(e,t,o)}});var v=d.Class.extend({options:{serviceUrl:"https://api.mapbox.com/geocoding/v5/mapbox.places/",geocodingQueryParams:{},reverseQueryParams:{}},initialize:function(e,t){d.setOptions(this,t),this.options.geocodingQueryParams.access_token=e,this.options.reverseQueryParams.access_token=e},geocode:function(e,l,c){var t=this.options.geocodingQueryParams;void 0!==t.proximity&&void 0!==t.proximity.lat&&void 0!==t.proximity.lng&&(t.proximity=t.proximity.lng+","+t.proximity.lat),u(this.options.serviceUrl+encodeURIComponent(e)+".json",t,function(e){var t,o,s,n=[];if(e.features&&e.features.length)for(var i=0;i<=e.features.length-1;i++){t=e.features[i],o=d.latLng(t.center.reverse()),s=t.bbox?d.latLngBounds(d.latLng(t.bbox.slice(0,2).reverse()),d.latLng(t.bbox.slice(2,4).reverse())):d.latLngBounds(o,o);for(var r={text:t.text,address:t.address},a=0;a<(t.context||[]).length;a++){r[t.context[a].id.split(".")[0]]=t.context[a].text,t.context[a].short_code&&(r.countryShortCode=t.context[a].short_code)}n[i]={name:t.place_name,bbox:s,center:o,properties:r}}l.call(c,n)})},suggest:function(e,t,o){return this.geocode(e,t,o)},reverse:function(e,t,r,a){u(this.options.serviceUrl+encodeURIComponent(e.lng)+","+encodeURIComponent(e.lat)+".json",this.options.reverseQueryParams,function(e){var t,o,s,n=[];if(e.features&&e.features.length)for(var i=0;i<=e.features.length-1;i++)t=e.features[i],o=d.latLng(t.center.reverse()),s=t.bbox?d.latLngBounds(d.latLng(t.bbox.slice(0,2).reverse()),d.latLng(t.bbox.slice(2,4).reverse())):d.latLngBounds(o,o),n[i]={name:t.place_name,bbox:s,center:o};r.call(a,n)})}});var f=d.Class.extend({options:{serviceUrl:"https://www.mapquestapi.com/geocoding/v1"},initialize:function(e,t){this._key=decodeURIComponent(e),d.Util.setOptions(this,t)},_formatName:function(){var e,t=[];for(e=0;e",apiKey:"",serviceUrl:"https://neutrinoapi.com/"},initialize:function(e){d.Util.setOptions(this,e)},geocode:function(e,n,i){u(this.options.serviceUrl+"geocode-address",{apiKey:this.options.apiKey,userId:this.options.userId,address:e.split(/\s+/).join(".")},function(e){var t,o,s=[];e.locations&&(e.geometry=e.locations[0],t=d.latLng(e.geometry.latitude,e.geometry.longitude),o=d.latLngBounds(t,t),s[0]={name:e.geometry.address,bbox:o,center:t}),n.call(i,s)})},suggest:function(e,t,o){return this.geocode(e,t,o)},reverse:function(n,e,i,r){u(this.options.serviceUrl+"geocode-reverse",{apiKey:this.options.apiKey,userId:this.options.userId,latitude:n.lat,longitude:n.lng},function(e){var t,o,s=[];200==e.status.status&&e.found&&(t=d.latLng(n.lat,n.lng),o=d.latLngBounds(t,t),s[0]={name:e.address,bbox:o,center:t}),i.call(r,s)})}});var b=d.Class.extend({options:{serviceUrl:"https://nominatim.openstreetmap.org/",geocodingQueryParams:{},reverseQueryParams:{},htmlTemplate:function(e){var t,o=e.address,s=[];return(o.road||o.building)&&s.push("{building} {road} {house_number}"),(o.city||o.town||o.village||o.hamlet)&&(t=0{postcode} {city} {town} {village} {hamlet}')),(o.state||o.country)&&(t=0{state} {country}')),n(s.join("
"),o)}},initialize:function(e){d.Util.setOptions(this,e)},geocode:function(e,i,r){u(this.options.serviceUrl+"search",d.extend({q:e,limit:5,format:"json",addressdetails:1},this.options.geocodingQueryParams),d.bind(function(e){for(var t=[],o=e.length-1;0<=o;o--){for(var s=e[o].boundingbox,n=0;n<4;n++)s[n]=parseFloat(s[n]);t[o]={icon:e[o].icon,name:e[o].display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(e[o]):void 0,bbox:d.latLngBounds([s[0],s[2]],[s[1],s[3]]),center:d.latLng(e[o].lat,e[o].lon),properties:e[o]}}i.call(r,t)},this))},reverse:function(e,t,s,n){u(this.options.serviceUrl+"reverse",d.extend({lat:e.lat,lon:e.lng,zoom:Math.round(Math.log(t/256)/Math.log(2)),addressdetails:1,format:"json"},this.options.reverseQueryParams),d.bind(function(e){var t,o=[];e&&e.lat&&e.lon&&(t=d.latLng(e.lat,e.lon),o.push({name:e.display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(e):void 0,center:t,bounds:d.latLngBounds(t,t),properties:e})),s.call(n,o)},this))}});var y=d.Class.extend({options:{OpenLocationCode:void 0,codeLength:void 0},initialize:function(e){d.setOptions(this,e)},geocode:function(e,t,o){try{var s=this.options.OpenLocationCode.decode(e),n={name:e,center:d.latLng(s.latitudeCenter,s.longitudeCenter),bbox:d.latLngBounds(d.latLng(s.latitudeLo,s.longitudeLo),d.latLng(s.latitudeHi,s.longitudeHi))};t.call(o,[n])}catch(e){console.warn(e),t.call(o,[])}},reverse:function(e,t,o,s){try{var n={name:this.options.OpenLocationCode.encode(e.lat,e.lng,this.options.codeLength),center:d.latLng(e.lat,e.lng),bbox:d.latLngBounds(d.latLng(e.lat,e.lng),d.latLng(e.lat,e.lng))};o.call(s,[n])}catch(e){console.warn(e),o.call(s,[])}}});var L=d.Class.extend({options:{serviceUrl:"https://api.opencagedata.com/geocode/v1/json",geocodingQueryParams:{},reverseQueryParams:{}},initialize:function(e,t){d.setOptions(this,t),this._accessToken=e},geocode:function(e,r,a){var t={key:this._accessToken,q:e};t=d.extend(t,this.options.geocodingQueryParams),u(this.options.serviceUrl,t,function(e){var t,o,s,n=[];if(e.results&&e.results.length)for(var i=0;ithis._lastSuggest&&(this._lastSuggest=e.geocoding.timestamp,t.call(o,s._parseResults(e,"bbox")))},this))},reverse:function(e,t,o,s){var n=this;u(this.options.serviceUrl+"/reverse",d.extend({api_key:this._apiKey,"point.lat":e.lat,"point.lon":e.lng},this.options.reverseQueryParams),function(e){o.call(s,n._parseResults(e,"bounds"))})},_parseResults:function(e,i){var r=[];return d.geoJson(e,{pointToLayer:function(e,t){return d.circleMarker(t)},onEachFeature:function(e,t){var o,s,n={};t.getBounds?s=(o=t.getBounds()).getCenter():o=t.feature.bbox?(s=t.getLatLng(),d.latLngBounds(d.GeoJSON.coordsToLatLng(t.feature.bbox.slice(0,2)),d.GeoJSON.coordsToLatLng(t.feature.bbox.slice(2,4)))):(s=t.getLatLng(),d.latLngBounds(s,s)),n.name=t.feature.properties.label,n.center=s,n[i]=o,n.properties=t.feature.properties,r.push(n)}}),r}});function e(e,t){return new x(e,t)}var U=x,C=e,k=x,w=e,D=k.extend({options:{serviceUrl:"https://api.openrouteservice.org/geocode"}});var P=d.Class.extend({options:{serviceUrl:"https://photon.komoot.de/api/",reverseUrl:"https://photon.komoot.de/reverse/",nameProperties:["name","street","suburb","hamlet","town","city","state","country"]},initialize:function(e){d.setOptions(this,e)},geocode:function(e,t,o){var s=d.extend({q:e},this.options.geocodingQueryParams);u(this.options.serviceUrl,s,d.bind(function(e){t.call(o,this._decodeFeatures(e))},this))},suggest:function(e,t,o){return this.geocode(e,t,o)},reverse:function(e,t,o,s){var n=d.extend({lat:e.lat,lon:e.lng},this.options.reverseQueryParams);u(this.options.reverseUrl,n,d.bind(function(e){o.call(s,this._decodeFeatures(e))},this))},_decodeFeatures:function(e){var t,o,s,n,i,r,a=[];if(e&&e.features)for(t=0;t=this.options.suggestMinLength?this._suggestTimeout=setTimeout(d.bind(function(){this._geocode(!0)},this),this.options.suggestTimeout):this._clearResults())}});return d.Util.extend(T,R),d.Util.extend(d.Control,{Geocoder:T,geocoder:function(e){return new T(e)}}),T}(L); +//# sourceMappingURL=Control.Geocoder.min.js.map diff --git a/assets/js/Control.Geocoder.min.js.map b/assets/js/Control.Geocoder.min.js.map new file mode 100644 index 00000000..84c1d466 --- /dev/null +++ b/assets/js/Control.Geocoder.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Control.Geocoder.min.js","sources":["../src/util.js","../src/geocoders/arcgis.js","../src/geocoders/bing.js","../src/geocoders/google.js","../src/geocoders/here.js","../src/geocoders/latlng.js","../src/geocoders/mapbox.js","../src/geocoders/mapquest.js","../src/geocoders/neutrino.js","../src/geocoders/nominatim.js","../src/geocoders/open-location-code.js","../src/geocoders/opencage.js","../src/geocoders/pelias.js","../src/geocoders/photon.js","../src/geocoders/what3words.js","../src/control.js","../src/index.js"],"sourcesContent":["import L from 'leaflet';\nvar lastCallbackId = 0;\n\n// Adapted from handlebars.js\n// https://github.com/wycats/handlebars.js/\nvar badChars = /[&<>\"'`]/g;\nvar possible = /[&<>\"'`]/;\nvar escape = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\n\nfunction escapeChar(chr) {\n return escape[chr];\n}\n\nexport function htmlEscape(string) {\n if (string == null) {\n return '';\n } else if (!string) {\n return string + '';\n }\n\n // Force a string conversion as this will be done by the append regardless and\n // the regex test will do this transparently behind the scenes, causing issues if\n // an object's to string has escaped characters in it.\n string = '' + string;\n\n if (!possible.test(string)) {\n return string;\n }\n return string.replace(badChars, escapeChar);\n}\n\nexport function jsonp(url, params, callback, context, jsonpParam) {\n var callbackId = '_l_geocoder_' + lastCallbackId++;\n params[jsonpParam || 'callback'] = callbackId;\n window[callbackId] = L.Util.bind(callback, context);\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url + getParamString(params);\n script.id = callbackId;\n document.getElementsByTagName('head')[0].appendChild(script);\n}\n\nexport function getJSON(url, params, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState !== 4) {\n return;\n }\n var message;\n if (xmlHttp.status !== 200 && xmlHttp.status !== 304) {\n message = '';\n } else if (typeof xmlHttp.response === 'string') {\n // IE doesn't parse JSON responses even with responseType: 'json'.\n try {\n message = JSON.parse(xmlHttp.response);\n } catch (e) {\n // Not a JSON response\n message = xmlHttp.response;\n }\n } else {\n message = xmlHttp.response;\n }\n callback(message);\n };\n xmlHttp.open('GET', url + getParamString(params), true);\n xmlHttp.responseType = 'json';\n xmlHttp.setRequestHeader('Accept', 'application/json');\n xmlHttp.send(null);\n}\n\nexport function template(str, data) {\n return str.replace(/\\{ *([\\w_]+) *\\}/g, function(str, key) {\n var value = data[key];\n if (value === undefined) {\n value = '';\n } else if (typeof value === 'function') {\n value = value(data);\n }\n return htmlEscape(value);\n });\n}\n\nexport function getParamString(obj, existingUrl, uppercase) {\n var params = [];\n for (var i in obj) {\n var key = encodeURIComponent(uppercase ? i.toUpperCase() : i);\n var value = obj[i];\n if (!L.Util.isArray(value)) {\n params.push(key + '=' + encodeURIComponent(value));\n } else {\n for (var j = 0; j < value.length; j++) {\n params.push(key + '=' + encodeURIComponent(value[j]));\n }\n }\n }\n return (!existingUrl || existingUrl.indexOf('?') === -1 ? '?' : '&') + params.join('&');\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var ArcGis = L.Class.extend({\n options: {\n service_url: 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer'\n },\n\n initialize: function(accessToken, options) {\n L.setOptions(this, options);\n this._accessToken = accessToken;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n SingleLine: query,\n outFields: 'Addr_Type',\n forStorage: false,\n maxLocations: 10,\n f: 'json'\n };\n\n if (this._key && this._key.length) {\n params.token = this._key;\n }\n\n getJSON(\n this.options.service_url + '/findAddressCandidates',\n L.extend(params, this.options.geocodingQueryParams),\n function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n\n if (data.candidates && data.candidates.length) {\n for (var i = 0; i <= data.candidates.length - 1; i++) {\n loc = data.candidates[i];\n latLng = L.latLng(loc.location.y, loc.location.x);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.extent.ymax, loc.extent.xmax),\n L.latLng(loc.extent.ymin, loc.extent.xmin)\n );\n results[i] = {\n name: loc.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n location: encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat),\n distance: 100,\n f: 'json'\n };\n\n getJSON(this.options.service_url + '/reverseGeocode', params, function(data) {\n var result = [],\n loc;\n\n if (data && !data.error) {\n loc = L.latLng(data.location.y, data.location.x);\n result.push({\n name: data.address.Match_addr,\n center: loc,\n bounds: L.latLngBounds(loc, loc)\n });\n }\n\n cb.call(context, result);\n });\n }\n});\n\nexport function arcgis(accessToken, options) {\n return new ArcGis(accessToken, options);\n}\n","import L from 'leaflet';\nimport { jsonp } from '../util';\n\nexport var Bing = L.Class.extend({\n initialize: function(key) {\n this.key = key;\n },\n\n geocode: function(query, cb, context) {\n jsonp(\n 'https://dev.virtualearth.net/REST/v1/Locations',\n {\n query: query,\n key: this.key\n },\n function(data) {\n var results = [];\n if (data.resourceSets.length > 0) {\n for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) {\n var resource = data.resourceSets[0].resources[i],\n bbox = resource.bbox;\n results[i] = {\n name: resource.name,\n bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]),\n center: L.latLng(resource.point.coordinates)\n };\n }\n }\n cb.call(context, results);\n },\n this,\n 'jsonp'\n );\n },\n\n reverse: function(location, scale, cb, context) {\n jsonp(\n '//dev.virtualearth.net/REST/v1/Locations/' + location.lat + ',' + location.lng,\n {\n key: this.key\n },\n function(data) {\n var results = [];\n for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) {\n var resource = data.resourceSets[0].resources[i],\n bbox = resource.bbox;\n results[i] = {\n name: resource.name,\n bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]),\n center: L.latLng(resource.point.coordinates)\n };\n }\n cb.call(context, results);\n },\n this,\n 'jsonp'\n );\n }\n});\n\nexport function bing(key) {\n return new Bing(key);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Google = L.Class.extend({\n options: {\n serviceUrl: 'https://maps.googleapis.com/maps/api/geocode/json',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(key, options) {\n this._key = key;\n L.setOptions(this, options);\n // Backwards compatibility\n this.options.serviceUrl = this.options.service_url || this.options.serviceUrl;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n address: query\n };\n\n if (this._key && this._key.length) {\n params.key = this._key;\n }\n\n params = L.Util.extend(params, this.options.geocodingQueryParams);\n\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.results && data.results.length) {\n for (var i = 0; i <= data.results.length - 1; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry.location);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.geometry.viewport.northeast),\n L.latLng(loc.geometry.viewport.southwest)\n );\n results[i] = {\n name: loc.formatted_address,\n bbox: latLngBounds,\n center: latLng,\n properties: loc.address_components\n };\n }\n }\n\n cb.call(context, results);\n });\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n latlng: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng)\n };\n params = L.Util.extend(params, this.options.reverseQueryParams);\n if (this._key && this._key.length) {\n params.key = this._key;\n }\n\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.results && data.results.length) {\n for (var i = 0; i <= data.results.length - 1; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry.location);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.geometry.viewport.northeast),\n L.latLng(loc.geometry.viewport.southwest)\n );\n results[i] = {\n name: loc.formatted_address,\n bbox: latLngBounds,\n center: latLng,\n properties: loc.address_components\n };\n }\n }\n\n cb.call(context, results);\n });\n }\n});\n\nexport function google(key, options) {\n return new Google(key, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\nexport var HERE = L.Class.extend({\n options: {\n geocodeUrl: 'https://geocoder.api.here.com/6.2/geocode.json',\n reverseGeocodeUrl: 'https://reverse.geocoder.api.here.com/6.2/reversegeocode.json',\n app_id: '',\n app_code: '',\n geocodingQueryParams: {},\n reverseQueryParams: {},\n reverseGeocodeProxRadius: null\n },\n initialize: function(options) {\n L.setOptions(this, options);\n },\n geocode: function(query, cb, context) {\n var params = {\n searchtext: query,\n gen: 9,\n app_id: this.options.app_id,\n app_code: this.options.app_code,\n jsonattributes: 1\n };\n params = L.Util.extend(params, this.options.geocodingQueryParams);\n this.getJSON(this.options.geocodeUrl, params, cb, context);\n },\n reverse: function(location, scale, cb, context) {\n var _proxRadius = this.options.reverseGeocodeProxRadius\n ? this.options.reverseGeocodeProxRadius\n : null;\n var proxRadius = _proxRadius ? ',' + encodeURIComponent(_proxRadius) : '';\n var params = {\n prox: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng) + proxRadius,\n mode: 'retrieveAddresses',\n app_id: this.options.app_id,\n app_code: this.options.app_code,\n gen: 9,\n jsonattributes: 1\n };\n params = L.Util.extend(params, this.options.reverseQueryParams);\n this.getJSON(this.options.reverseGeocodeUrl, params, cb, context);\n },\n getJSON: function(url, params, cb, context) {\n getJSON(url, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.response.view && data.response.view.length) {\n for (var i = 0; i <= data.response.view[0].result.length - 1; i++) {\n loc = data.response.view[0].result[i].location;\n latLng = L.latLng(loc.displayPosition.latitude, loc.displayPosition.longitude);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.mapView.topLeft.latitude, loc.mapView.topLeft.longitude),\n L.latLng(loc.mapView.bottomRight.latitude, loc.mapView.bottomRight.longitude)\n );\n results[i] = {\n name: loc.address.label,\n properties: loc.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n cb.call(context, results);\n });\n }\n});\nexport function here(options) {\n return new HERE(options);\n}\n","import L from 'leaflet';\n\nexport var LatLng = L.Class.extend({\n options: {\n // the next geocoder to use\n next: undefined,\n sizeInMeters: 10000\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n var match;\n var center;\n // regex from https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/geocoder_controller.rb\n if ((match = query.match(/^([NS])\\s*(\\d{1,3}(?:\\.\\d*)?)\\W*([EW])\\s*(\\d{1,3}(?:\\.\\d*)?)$/))) {\n // [NSEW] decimal degrees\n center = L.latLng(\n (/N/i.test(match[1]) ? 1 : -1) * parseFloat(match[2]),\n (/E/i.test(match[3]) ? 1 : -1) * parseFloat(match[4])\n );\n } else if (\n (match = query.match(/^(\\d{1,3}(?:\\.\\d*)?)\\s*([NS])\\W*(\\d{1,3}(?:\\.\\d*)?)\\s*([EW])$/))\n ) {\n // decimal degrees [NSEW]\n center = L.latLng(\n (/N/i.test(match[2]) ? 1 : -1) * parseFloat(match[1]),\n (/E/i.test(match[4]) ? 1 : -1) * parseFloat(match[3])\n );\n } else if (\n (match = query.match(\n /^([NS])\\s*(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?\\W*([EW])\\s*(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?$/\n ))\n ) {\n // [NSEW] degrees, decimal minutes\n center = L.latLng(\n (/N/i.test(match[1]) ? 1 : -1) * (parseFloat(match[2]) + parseFloat(match[3] / 60)),\n (/E/i.test(match[4]) ? 1 : -1) * (parseFloat(match[5]) + parseFloat(match[6] / 60))\n );\n } else if (\n (match = query.match(\n /^(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?\\s*([NS])\\W*(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?\\s*([EW])$/\n ))\n ) {\n // degrees, decimal minutes [NSEW]\n center = L.latLng(\n (/N/i.test(match[3]) ? 1 : -1) * (parseFloat(match[1]) + parseFloat(match[2] / 60)),\n (/E/i.test(match[6]) ? 1 : -1) * (parseFloat(match[4]) + parseFloat(match[5] / 60))\n );\n } else if (\n (match = query.match(\n /^([NS])\\s*(\\d{1,3})°?\\s*(\\d{1,2})['′]?\\s*(\\d{1,3}(?:\\.\\d*)?)?[\"″]?\\W*([EW])\\s*(\\d{1,3})°?\\s*(\\d{1,2})['′]?\\s*(\\d{1,3}(?:\\.\\d*)?)?[\"″]?$/\n ))\n ) {\n // [NSEW] degrees, minutes, decimal seconds\n center = L.latLng(\n (/N/i.test(match[1]) ? 1 : -1) *\n (parseFloat(match[2]) + parseFloat(match[3] / 60 + parseFloat(match[4] / 3600))),\n (/E/i.test(match[5]) ? 1 : -1) *\n (parseFloat(match[6]) + parseFloat(match[7] / 60) + parseFloat(match[8] / 3600))\n );\n } else if (\n (match = query.match(\n /^(\\d{1,3})°?\\s*(\\d{1,2})['′]?\\s*(\\d{1,3}(?:\\.\\d*)?)?[\"″]\\s*([NS])\\W*(\\d{1,3})°?\\s*(\\d{1,2})['′]?\\s*(\\d{1,3}(?:\\.\\d*)?)?[\"″]?\\s*([EW])$/\n ))\n ) {\n // degrees, minutes, decimal seconds [NSEW]\n center = L.latLng(\n (/N/i.test(match[4]) ? 1 : -1) *\n (parseFloat(match[1]) + parseFloat(match[2] / 60 + parseFloat(match[3] / 3600))),\n (/E/i.test(match[8]) ? 1 : -1) *\n (parseFloat(match[5]) + parseFloat(match[6] / 60) + parseFloat(match[7] / 3600))\n );\n } else if (\n (match = query.match(/^\\s*([+-]?\\d+(?:\\.\\d*)?)\\s*[\\s,]\\s*([+-]?\\d+(?:\\.\\d*)?)\\s*$/))\n ) {\n center = L.latLng(parseFloat(match[1]), parseFloat(match[2]));\n }\n if (center) {\n var results = [\n {\n name: query,\n center: center,\n bbox: center.toBounds(this.options.sizeInMeters)\n }\n ];\n cb.call(context, results);\n } else if (this.options.next) {\n this.options.next.geocode(query, cb, context);\n }\n }\n});\n\nexport function latLng(options) {\n return new LatLng(options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Mapbox = L.Class.extend({\n options: {\n serviceUrl: 'https://api.mapbox.com/geocoding/v5/mapbox.places/',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(accessToken, options) {\n L.setOptions(this, options);\n this.options.geocodingQueryParams.access_token = accessToken;\n this.options.reverseQueryParams.access_token = accessToken;\n },\n\n geocode: function(query, cb, context) {\n var params = this.options.geocodingQueryParams;\n if (\n params.proximity !== undefined &&\n params.proximity.lat !== undefined &&\n params.proximity.lng !== undefined\n ) {\n params.proximity = params.proximity.lng + ',' + params.proximity.lat;\n }\n getJSON(this.options.serviceUrl + encodeURIComponent(query) + '.json', params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.features && data.features.length) {\n for (var i = 0; i <= data.features.length - 1; i++) {\n loc = data.features[i];\n latLng = L.latLng(loc.center.reverse());\n if (loc.bbox) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.bbox.slice(0, 2).reverse()),\n L.latLng(loc.bbox.slice(2, 4).reverse())\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n\n var properties = {\n text: loc.text,\n address: loc.address\n };\n\n for (var j = 0; j < (loc.context || []).length; j++) {\n var id = loc.context[j].id.split('.')[0];\n properties[id] = loc.context[j].text;\n\n // Get country code when available\n if (loc.context[j].short_code) {\n properties['countryShortCode'] = loc.context[j].short_code\n }\n }\n\n results[i] = {\n name: loc.place_name,\n bbox: latLngBounds,\n center: latLng,\n properties: properties\n };\n }\n }\n\n cb.call(context, results);\n });\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl +\n encodeURIComponent(location.lng) +\n ',' +\n encodeURIComponent(location.lat) +\n '.json',\n this.options.reverseQueryParams,\n function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.features && data.features.length) {\n for (var i = 0; i <= data.features.length - 1; i++) {\n loc = data.features[i];\n latLng = L.latLng(loc.center.reverse());\n if (loc.bbox) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.bbox.slice(0, 2).reverse()),\n L.latLng(loc.bbox.slice(2, 4).reverse())\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results[i] = {\n name: loc.place_name,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }\n );\n }\n});\n\nexport function mapbox(accessToken, options) {\n return new Mapbox(accessToken, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var MapQuest = L.Class.extend({\n options: {\n serviceUrl: 'https://www.mapquestapi.com/geocoding/v1'\n },\n\n initialize: function(key, options) {\n // MapQuest seems to provide URI encoded API keys,\n // so to avoid encoding them twice, we decode them here\n this._key = decodeURIComponent(key);\n\n L.Util.setOptions(this, options);\n },\n\n _formatName: function() {\n var r = [],\n i;\n for (i = 0; i < arguments.length; i++) {\n if (arguments[i]) {\n r.push(arguments[i]);\n }\n }\n\n return r.join(', ');\n },\n\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + '/address',\n {\n key: this._key,\n location: query,\n limit: 5,\n outFormat: 'json'\n },\n L.bind(function(data) {\n var results = [],\n loc,\n latLng;\n if (data.results && data.results[0].locations) {\n for (var i = data.results[0].locations.length - 1; i >= 0; i--) {\n loc = data.results[0].locations[i];\n latLng = L.latLng(loc.latLng);\n results[i] = {\n name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1),\n bbox: L.latLngBounds(latLng, latLng),\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + '/reverse',\n {\n key: this._key,\n location: location.lat + ',' + location.lng,\n outputFormat: 'json'\n },\n L.bind(function(data) {\n var results = [],\n loc,\n latLng;\n if (data.results && data.results[0].locations) {\n for (var i = data.results[0].locations.length - 1; i >= 0; i--) {\n loc = data.results[0].locations[i];\n latLng = L.latLng(loc.latLng);\n results[i] = {\n name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1),\n bbox: L.latLngBounds(latLng, latLng),\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }, this)\n );\n }\n});\n\nexport function mapQuest(key, options) {\n return new MapQuest(key, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Neutrino = L.Class.extend({\n options: {\n userId: '',\n apiKey: '',\n serviceUrl: 'https://neutrinoapi.com/'\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n // https://www.neutrinoapi.com/api/geocode-address/\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + 'geocode-address',\n {\n apiKey: this.options.apiKey,\n userId: this.options.userId,\n //get three words and make a dot based string\n address: query.split(/\\s+/).join('.')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.locations) {\n data.geometry = data.locations[0];\n latLng = L.latLng(data.geometry['latitude'], data.geometry['longitude']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.geometry.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n // https://www.neutrinoapi.com/api/geocode-reverse/\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'geocode-reverse',\n {\n apiKey: this.options.apiKey,\n userId: this.options.userId,\n latitude: location.lat,\n longitude: location.lng\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.status.status == 200 && data.found) {\n latLng = L.latLng(location.lat, location.lng);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n cb.call(context, results);\n }\n );\n }\n});\n\nexport function neutrino(accessToken) {\n return new Neutrino(accessToken);\n}\n","import L from 'leaflet';\nimport { template, getJSON } from '../util';\n\nexport var Nominatim = L.Class.extend({\n options: {\n serviceUrl: 'https://nominatim.openstreetmap.org/',\n geocodingQueryParams: {},\n reverseQueryParams: {},\n htmlTemplate: function(r) {\n var a = r.address,\n className,\n parts = [];\n if (a.road || a.building) {\n parts.push('{building} {road} {house_number}');\n }\n\n if (a.city || a.town || a.village || a.hamlet) {\n className = parts.length > 0 ? 'leaflet-control-geocoder-address-detail' : '';\n parts.push(\n '{postcode} {city} {town} {village} {hamlet}'\n );\n }\n\n if (a.state || a.country) {\n className = parts.length > 0 ? 'leaflet-control-geocoder-address-context' : '';\n parts.push('{state} {country}');\n }\n\n return template(parts.join('
'), a, true);\n }\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + 'search',\n L.extend(\n {\n q: query,\n limit: 5,\n format: 'json',\n addressdetails: 1\n },\n this.options.geocodingQueryParams\n ),\n L.bind(function(data) {\n var results = [];\n for (var i = data.length - 1; i >= 0; i--) {\n var bbox = data[i].boundingbox;\n for (var j = 0; j < 4; j++) bbox[j] = parseFloat(bbox[j]);\n results[i] = {\n icon: data[i].icon,\n name: data[i].display_name,\n html: this.options.htmlTemplate ? this.options.htmlTemplate(data[i]) : undefined,\n bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]),\n center: L.latLng(data[i].lat, data[i].lon),\n properties: data[i]\n };\n }\n cb.call(context, results);\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'reverse',\n L.extend(\n {\n lat: location.lat,\n lon: location.lng,\n zoom: Math.round(Math.log(scale / 256) / Math.log(2)),\n addressdetails: 1,\n format: 'json'\n },\n this.options.reverseQueryParams\n ),\n L.bind(function(data) {\n var result = [],\n loc;\n\n if (data && data.lat && data.lon) {\n loc = L.latLng(data.lat, data.lon);\n result.push({\n name: data.display_name,\n html: this.options.htmlTemplate ? this.options.htmlTemplate(data) : undefined,\n center: loc,\n bounds: L.latLngBounds(loc, loc),\n properties: data\n });\n }\n\n cb.call(context, result);\n }, this)\n );\n }\n});\n\nexport function nominatim(options) {\n return new Nominatim(options);\n}\n","import L from 'leaflet';\n\nexport var OpenLocationCode = L.Class.extend({\n options: {\n OpenLocationCode: undefined,\n codeLength: undefined\n },\n\n initialize: function(options) {\n L.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n try {\n var decoded = this.options.OpenLocationCode.decode(query);\n var result = {\n name: query,\n center: L.latLng(decoded.latitudeCenter, decoded.longitudeCenter),\n bbox: L.latLngBounds(\n L.latLng(decoded.latitudeLo, decoded.longitudeLo),\n L.latLng(decoded.latitudeHi, decoded.longitudeHi)\n )\n };\n cb.call(context, [result]);\n } catch (e) {\n console.warn(e); // eslint-disable-line no-console\n cb.call(context, []);\n }\n },\n reverse: function(location, scale, cb, context) {\n try {\n var code = this.options.OpenLocationCode.encode(\n location.lat,\n location.lng,\n this.options.codeLength\n );\n var result = {\n name: code,\n center: L.latLng(location.lat, location.lng),\n bbox: L.latLngBounds(\n L.latLng(location.lat, location.lng),\n L.latLng(location.lat, location.lng)\n )\n };\n cb.call(context, [result]);\n } catch (e) {\n console.warn(e); // eslint-disable-line no-console\n cb.call(context, []);\n }\n }\n});\n\nexport function openLocationCode(options) {\n return new OpenLocationCode(options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var OpenCage = L.Class.extend({\n options: {\n serviceUrl: 'https://api.opencagedata.com/geocode/v1/json',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(apiKey, options) {\n L.setOptions(this, options);\n this._accessToken = apiKey;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n key: this._accessToken,\n q: query\n };\n params = L.extend(params, this.options.geocodingQueryParams);\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n latLng,\n latLngBounds,\n loc;\n if (data.results && data.results.length) {\n for (var i = 0; i < data.results.length; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry);\n if (loc.annotations && loc.annotations.bounds) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.annotations.bounds.northeast),\n L.latLng(loc.annotations.bounds.southwest)\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results.push({\n name: loc.formatted,\n bbox: latLngBounds,\n center: latLng\n });\n }\n }\n cb.call(context, results);\n });\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n key: this._accessToken,\n q: [location.lat, location.lng].join(',')\n };\n params = L.extend(params, this.options.reverseQueryParams);\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n latLng,\n latLngBounds,\n loc;\n if (data.results && data.results.length) {\n for (var i = 0; i < data.results.length; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry);\n if (loc.annotations && loc.annotations.bounds) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.annotations.bounds.northeast),\n L.latLng(loc.annotations.bounds.southwest)\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results.push({\n name: loc.formatted,\n bbox: latLngBounds,\n center: latLng\n });\n }\n }\n cb.call(context, results);\n });\n }\n});\n\nexport function opencage(apiKey, options) {\n return new OpenCage(apiKey, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Pelias = L.Class.extend({\n options: {\n serviceUrl: 'https://api.geocode.earth/v1',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(apiKey, options) {\n L.Util.setOptions(this, options);\n this._apiKey = apiKey;\n this._lastSuggest = 0;\n },\n\n geocode: function(query, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/search',\n L.extend(\n {\n api_key: this._apiKey,\n text: query\n },\n this.options.geocodingQueryParams\n ),\n function(data) {\n cb.call(context, _this._parseResults(data, 'bbox'));\n }\n );\n },\n\n suggest: function(query, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/autocomplete',\n L.extend(\n {\n api_key: this._apiKey,\n text: query\n },\n this.options.geocodingQueryParams\n ),\n L.bind(function(data) {\n if (data.geocoding.timestamp > this._lastSuggest) {\n this._lastSuggest = data.geocoding.timestamp;\n cb.call(context, _this._parseResults(data, 'bbox'));\n }\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/reverse',\n L.extend(\n {\n api_key: this._apiKey,\n 'point.lat': location.lat,\n 'point.lon': location.lng\n },\n this.options.reverseQueryParams\n ),\n function(data) {\n cb.call(context, _this._parseResults(data, 'bounds'));\n }\n );\n },\n\n _parseResults: function(data, bboxname) {\n var results = [];\n L.geoJson(data, {\n pointToLayer: function(feature, latlng) {\n return L.circleMarker(latlng);\n },\n onEachFeature: function(feature, layer) {\n var result = {},\n bbox,\n center;\n\n if (layer.getBounds) {\n bbox = layer.getBounds();\n center = bbox.getCenter();\n } else if (layer.feature.bbox) {\n center = layer.getLatLng();\n bbox = L.latLngBounds(\n L.GeoJSON.coordsToLatLng(layer.feature.bbox.slice(0, 2)),\n L.GeoJSON.coordsToLatLng(layer.feature.bbox.slice(2, 4))\n );\n } else {\n center = layer.getLatLng();\n bbox = L.latLngBounds(center, center);\n }\n\n result.name = layer.feature.properties.label;\n result.center = center;\n result[bboxname] = bbox;\n result.properties = layer.feature.properties;\n results.push(result);\n }\n });\n return results;\n }\n});\n\nexport function pelias(apiKey, options) {\n return new Pelias(apiKey, options);\n}\nexport var GeocodeEarth = Pelias;\nexport var geocodeEarth = pelias;\n\nexport var Mapzen = Pelias; // r.i.p.\nexport var mapzen = pelias;\n\nexport var Openrouteservice = Mapzen.extend({\n options: {\n serviceUrl: 'https://api.openrouteservice.org/geocode'\n }\n});\nexport function openrouteservice(apiKey, options) {\n return new Openrouteservice(apiKey, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Photon = L.Class.extend({\n options: {\n serviceUrl: 'https://photon.komoot.de/api/',\n reverseUrl: 'https://photon.komoot.de/reverse/',\n nameProperties: ['name', 'street', 'suburb', 'hamlet', 'town', 'city', 'state', 'country']\n },\n\n initialize: function(options) {\n L.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n var params = L.extend(\n {\n q: query\n },\n this.options.geocodingQueryParams\n );\n\n getJSON(\n this.options.serviceUrl,\n params,\n L.bind(function(data) {\n cb.call(context, this._decodeFeatures(data));\n }, this)\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(latLng, scale, cb, context) {\n var params = L.extend(\n {\n lat: latLng.lat,\n lon: latLng.lng\n },\n this.options.reverseQueryParams\n );\n\n getJSON(\n this.options.reverseUrl,\n params,\n L.bind(function(data) {\n cb.call(context, this._decodeFeatures(data));\n }, this)\n );\n },\n\n _decodeFeatures: function(data) {\n var results = [],\n i,\n f,\n c,\n latLng,\n extent,\n bbox;\n\n if (data && data.features) {\n for (i = 0; i < data.features.length; i++) {\n f = data.features[i];\n c = f.geometry.coordinates;\n latLng = L.latLng(c[1], c[0]);\n extent = f.properties.extent;\n\n if (extent) {\n bbox = L.latLngBounds([extent[1], extent[0]], [extent[3], extent[2]]);\n } else {\n bbox = L.latLngBounds(latLng, latLng);\n }\n\n results.push({\n name: this._decodeFeatureName(f),\n html: this.options.htmlTemplate ? this.options.htmlTemplate(f) : undefined,\n center: latLng,\n bbox: bbox,\n properties: f.properties\n });\n }\n }\n\n return results;\n },\n\n _decodeFeatureName: function(f) {\n return (this.options.nameProperties || [])\n .map(function(p) {\n return f.properties[p];\n })\n .filter(function(v) {\n return !!v;\n })\n .join(', ');\n }\n});\n\nexport function photon(options) {\n return new Photon(options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var What3Words = L.Class.extend({\n options: {\n serviceUrl: 'https://api.what3words.com/v2/'\n },\n\n initialize: function(accessToken) {\n this._accessToken = accessToken;\n },\n\n geocode: function(query, cb, context) {\n //get three words and make a dot based string\n getJSON(\n this.options.serviceUrl + 'forward',\n {\n key: this._accessToken,\n addr: query.split(/\\s+/).join('.')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.geometry) {\n latLng = L.latLng(data.geometry['lat'], data.geometry['lng']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.words,\n bbox: latLngBounds,\n center: latLng\n };\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'reverse',\n {\n key: this._accessToken,\n coords: [location.lat, location.lng].join(',')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.status.status == 200) {\n latLng = L.latLng(data.geometry['lat'], data.geometry['lng']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.words,\n bbox: latLngBounds,\n center: latLng\n };\n }\n cb.call(context, results);\n }\n );\n }\n});\n\nexport function what3words(accessToken) {\n return new What3Words(accessToken);\n}\n","import L from 'leaflet';\nimport { Nominatim } from './geocoders/index';\n\nexport var Geocoder = L.Control.extend({\n options: {\n showUniqueResult: true,\n showResultIcons: false,\n collapsed: true,\n expand: 'touch', // options: touch, click, anythingelse\n position: 'topright',\n placeholder: 'Search...',\n errorMessage: 'Nothing found.',\n iconLabel: 'Initiate a new search',\n queryMinLength: 1,\n suggestMinLength: 3,\n suggestTimeout: 250,\n defaultMarkGeocode: true\n },\n\n includes: L.Evented.prototype || L.Mixin.Events,\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n if (!this.options.geocoder) {\n this.options.geocoder = new Nominatim();\n }\n\n this._requestCount = 0;\n },\n\n addThrobberClass: function() {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber');\n },\n\n removeThrobberClass: function() {\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-throbber');\n },\n\n onAdd: function(map) {\n var className = 'leaflet-control-geocoder',\n container = L.DomUtil.create('div', className + ' leaflet-bar'),\n icon = L.DomUtil.create('button', className + '-icon', container),\n form = (this._form = L.DomUtil.create('div', className + '-form', container)),\n input;\n\n this._map = map;\n this._container = container;\n\n icon.innerHTML = ' ';\n icon.type = 'button';\n icon.setAttribute('aria-label', this.options.iconLabel);\n\n input = this._input = L.DomUtil.create('input', '', form);\n input.type = 'text';\n input.value = this.options.query || '';\n input.placeholder = this.options.placeholder;\n L.DomEvent.disableClickPropagation(input);\n\n this._errorElement = L.DomUtil.create('div', className + '-form-no-error', container);\n this._errorElement.innerHTML = this.options.errorMessage;\n\n this._alts = L.DomUtil.create(\n 'ul',\n className + '-alternatives leaflet-control-geocoder-alternatives-minimized',\n container\n );\n L.DomEvent.disableClickPropagation(this._alts);\n\n L.DomEvent.addListener(input, 'keydown', this._keydown, this);\n if (this.options.geocoder.suggest) {\n L.DomEvent.addListener(input, 'input', this._change, this);\n }\n L.DomEvent.addListener(\n input,\n 'blur',\n function() {\n if (this.options.collapsed && !this._preventBlurCollapse) {\n this._collapse();\n }\n this._preventBlurCollapse = false;\n },\n this\n );\n\n if (this.options.collapsed) {\n if (this.options.expand === 'click') {\n L.DomEvent.addListener(\n container,\n 'click',\n function(e) {\n if (e.button === 0 && e.detail !== 2) {\n this._toggle();\n }\n },\n this\n );\n } else if (this.options.expand === 'touch') {\n L.DomEvent.addListener(\n container,\n L.Browser.touch ? 'touchstart mousedown' : 'mousedown',\n function(e) {\n this._toggle();\n e.preventDefault(); // mobile: clicking focuses the icon, so UI expands and immediately collapses\n e.stopPropagation();\n },\n this\n );\n } else {\n L.DomEvent.addListener(container, 'mouseover', this._expand, this);\n L.DomEvent.addListener(container, 'mouseout', this._collapse, this);\n this._map.on('movestart', this._collapse, this);\n }\n } else {\n this._expand();\n if (L.Browser.touch) {\n L.DomEvent.addListener(\n container,\n 'touchstart',\n function() {\n this._geocode();\n },\n this\n );\n } else {\n L.DomEvent.addListener(\n container,\n 'click',\n function() {\n this._geocode();\n },\n this\n );\n }\n }\n\n if (this.options.defaultMarkGeocode) {\n this.on('markgeocode', this.markGeocode, this);\n }\n\n this.on('startgeocode', this.addThrobberClass, this);\n this.on('finishgeocode', this.removeThrobberClass, this);\n this.on('startsuggest', this.addThrobberClass, this);\n this.on('finishsuggest', this.removeThrobberClass, this);\n\n L.DomEvent.disableClickPropagation(container);\n\n return container;\n },\n\n setQuery: function(string) {\n this._input.value = string;\n return this;\n },\n\n _geocodeResult: function(results, suggest) {\n if (!suggest && this.options.showUniqueResult && results.length === 1) {\n this._geocodeResultSelected(results[0]);\n } else if (results.length > 0) {\n this._alts.innerHTML = '';\n this._results = results;\n L.DomUtil.removeClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-options-open');\n for (var i = 0; i < results.length; i++) {\n this._alts.appendChild(this._createAlt(results[i], i));\n }\n } else {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-options-error');\n L.DomUtil.addClass(this._errorElement, 'leaflet-control-geocoder-error');\n }\n },\n\n markGeocode: function(result) {\n result = result.geocode || result;\n\n this._map.fitBounds(result.bbox);\n\n if (this._geocodeMarker) {\n this._map.removeLayer(this._geocodeMarker);\n }\n\n this._geocodeMarker = new L.Marker(result.center)\n .bindPopup(result.html || result.name)\n .addTo(this._map)\n .openPopup();\n\n return this;\n },\n\n _geocode: function(suggest) {\n var value = this._input.value;\n if (!suggest && value.length < this.options.queryMinLength) {\n return;\n }\n\n var requestCount = ++this._requestCount,\n mode = suggest ? 'suggest' : 'geocode',\n eventData = { input: value };\n\n this._lastGeocode = value;\n if (!suggest) {\n this._clearResults();\n }\n\n this.fire('start' + mode, eventData);\n this.options.geocoder[mode](\n value,\n function(results) {\n if (requestCount === this._requestCount) {\n eventData.results = results;\n this.fire('finish' + mode, eventData);\n this._geocodeResult(results, suggest);\n }\n },\n this\n );\n },\n\n _geocodeResultSelected: function(result) {\n this.fire('markgeocode', { geocode: result });\n },\n\n _toggle: function() {\n if (L.DomUtil.hasClass(this._container, 'leaflet-control-geocoder-expanded')) {\n this._collapse();\n } else {\n this._expand();\n }\n },\n\n _expand: function() {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-expanded');\n this._input.select();\n this.fire('expand');\n },\n\n _collapse: function() {\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-expanded');\n L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-open');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-error');\n this._input.blur(); // mobile: keyboard shouldn't stay expanded\n this.fire('collapse');\n },\n\n _clearResults: function() {\n L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n this._selection = null;\n L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-open');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-error');\n },\n\n _createAlt: function(result, index) {\n var li = L.DomUtil.create('li', ''),\n a = L.DomUtil.create('a', '', li),\n icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null,\n text = result.html ? undefined : document.createTextNode(result.name),\n mouseDownHandler = function mouseDownHandler(e) {\n // In some browsers, a click will fire on the map if the control is\n // collapsed directly after mousedown. To work around this, we\n // wait until the click is completed, and _then_ collapse the\n // control. Messy, but this is the workaround I could come up with\n // for #142.\n this._preventBlurCollapse = true;\n L.DomEvent.stop(e);\n this._geocodeResultSelected(result);\n L.DomEvent.on(\n li,\n 'click touchend',\n function() {\n if (this.options.collapsed) {\n this._collapse();\n } else {\n this._clearResults();\n }\n },\n this\n );\n };\n\n if (icon) {\n icon.src = result.icon;\n }\n\n li.setAttribute('data-result-index', index);\n\n if (result.html) {\n a.innerHTML = a.innerHTML + result.html;\n } else {\n a.appendChild(text);\n }\n\n // Use mousedown and not click, since click will fire _after_ blur,\n // causing the control to have collapsed and removed the items\n // before the click can fire.\n L.DomEvent.addListener(li, 'mousedown touchstart', mouseDownHandler, this);\n\n return li;\n },\n\n _keydown: function(e) {\n var _this = this,\n select = function select(dir) {\n if (_this._selection) {\n L.DomUtil.removeClass(_this._selection, 'leaflet-control-geocoder-selected');\n _this._selection = _this._selection[dir > 0 ? 'nextSibling' : 'previousSibling'];\n }\n if (!_this._selection) {\n _this._selection = _this._alts[dir > 0 ? 'firstChild' : 'lastChild'];\n }\n\n if (_this._selection) {\n L.DomUtil.addClass(_this._selection, 'leaflet-control-geocoder-selected');\n }\n };\n\n switch (e.keyCode) {\n // Escape\n case 27:\n if (this.options.collapsed) {\n this._collapse();\n } else {\n this._clearResults();\n }\n break;\n // Up\n case 38:\n select(-1);\n break;\n // Up\n case 40:\n select(1);\n break;\n // Enter\n case 13:\n if (this._selection) {\n var index = parseInt(this._selection.getAttribute('data-result-index'), 10);\n this._geocodeResultSelected(this._results[index]);\n this._clearResults();\n } else {\n this._geocode();\n }\n break;\n default:\n return;\n }\n\n L.DomEvent.preventDefault(e);\n },\n _change: function() {\n var v = this._input.value;\n if (v !== this._lastGeocode) {\n clearTimeout(this._suggestTimeout);\n if (v.length >= this.options.suggestMinLength) {\n this._suggestTimeout = setTimeout(\n L.bind(function() {\n this._geocode(true);\n }, this),\n this.options.suggestTimeout\n );\n } else {\n this._clearResults();\n }\n }\n }\n});\n\nexport function geocoder(options) {\n return new Geocoder(options);\n}\n","import L from 'leaflet';\nimport { Geocoder, geocoder } from './control';\nimport * as geocoders from './geocoders/index';\n\nL.Util.extend(Geocoder, geocoders);\nexport default Geocoder;\n\nL.Util.extend(L.Control, {\n Geocoder: Geocoder,\n geocoder: geocoder\n});\n"],"names":["lastCallbackId","badChars","possible","escape","&","<",">","\"","'","`","escapeChar","chr","jsonp","url","params","callback","context","jsonpParam","callbackId","window","L","Util","bind","script","document","createElement","type","src","getParamString","id","getElementsByTagName","appendChild","getJSON","xmlHttp","XMLHttpRequest","onreadystatechange","readyState","message","status","response","JSON","parse","e","open","responseType","setRequestHeader","send","template","str","data","replace","key","string","value","undefined","test","obj","existingUrl","uppercase","i","encodeURIComponent","toUpperCase","isArray","j","length","push","indexOf","join","ArcGis","Class","extend","options","service_url","initialize","accessToken","setOptions","this","_accessToken","geocode","query","cb","SingleLine","outFields","forStorage","maxLocations","f","_key","token","geocodingQueryParams","loc","latLng","latLngBounds","results","candidates","location","y","x","extent","ymax","xmax","ymin","xmin","name","address","bbox","center","call","suggest","reverse","scale","lng","lat","distance","result","error","Match_addr","bounds","Bing","resourceSets","resources","resource","point","coordinates","Google","serviceUrl","reverseQueryParams","geometry","viewport","northeast","southwest","formatted_address","properties","address_components","latlng","HERE","geocodeUrl","reverseGeocodeUrl","app_id","app_code","reverseGeocodeProxRadius","searchtext","gen","jsonattributes","_proxRadius","proxRadius","prox","mode","view","displayPosition","latitude","longitude","mapView","topLeft","bottomRight","label","LatLng","next","sizeInMeters","match","parseFloat","toBounds","Mapbox","access_token","proximity","features","slice","text","split","short_code","place_name","MapQuest","decodeURIComponent","_formatName","r","arguments","limit","outFormat","locations","street","adminArea4","adminArea3","adminArea1","outputFormat","Neutrino","userId","apiKey","found","Nominatim","htmlTemplate","className","a","parts","road","building","city","town","village","hamlet","state","country","q","format","addressdetails","boundingbox","icon","display_name","html","lon","zoom","Math","round","log","OpenLocationCode","codeLength","decoded","decode","latitudeCenter","longitudeCenter","latitudeLo","longitudeLo","latitudeHi","longitudeHi","console","warn","encode","OpenCage","annotations","formatted","Pelias","_apiKey","_lastSuggest","_this","api_key","_parseResults","geocoding","timestamp","point.lat","point.lon","bboxname","geoJson","pointToLayer","feature","circleMarker","onEachFeature","layer","getBounds","getCenter","getLatLng","GeoJSON","coordsToLatLng","pelias","GeocodeEarth","geocodeEarth","Mapzen","mapzen","Openrouteservice","Photon","reverseUrl","nameProperties","_decodeFeatures","c","_decodeFeatureName","map","p","filter","v","What3Words","addr","words","coords","Geocoder","Control","showUniqueResult","showResultIcons","collapsed","expand","position","placeholder","errorMessage","iconLabel","queryMinLength","suggestMinLength","suggestTimeout","defaultMarkGeocode","includes","Evented","prototype","Mixin","Events","geocoder","_requestCount","addThrobberClass","DomUtil","addClass","_container","removeThrobberClass","removeClass","onAdd","input","container","create","form","_form","_map","innerHTML","setAttribute","_input","DomEvent","disableClickPropagation","_errorElement","_alts","addListener","_keydown","_change","_preventBlurCollapse","_collapse","button","detail","_toggle","Browser","touch","preventDefault","stopPropagation","_expand","on","_geocode","markGeocode","setQuery","_geocodeResult","_geocodeResultSelected","_results","_createAlt","fitBounds","_geocodeMarker","removeLayer","Marker","bindPopup","addTo","openPopup","requestCount","eventData","_lastGeocode","_clearResults","fire","hasClass","select","blur","_selection","index","li","createTextNode","stop","dir","keyCode","parseInt","getAttribute","clearTimeout","_suggestTimeout","setTimeout","geocoders"],"mappings":";;;;;;;;kJACA,IAAIA,EAAiB,EAIjBC,EAAW,YACXC,EAAW,WACXC,EAAS,CACXC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,SACLC,IAAK,UAGP,SAASC,EAAWC,GAClB,OAAOR,EAAOQ,GAqBT,SAASC,EAAMC,EAAKC,EAAQC,EAAUC,EAASC,GACpD,IAAIC,EAAa,eAAiBlB,IAClCc,EAAOG,GAAc,YAAcC,EACnCC,OAAOD,GAAcE,EAAEC,KAAKC,KAAKP,EAAUC,GAC3C,IAAIO,EAASC,SAASC,cAAc,UACpCF,EAAOG,KAAO,kBACdH,EAAOI,IAAMd,EAAMe,EAAed,GAClCS,EAAOM,GAAKX,EACZM,SAASM,qBAAqB,QAAQ,GAAGC,YAAYR,GAGhD,SAASS,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H,aACTpH,EAAMoH,WAAapH,EAAM+E,MAAY,EAAN0C,EAAU,aAAe,cAGtDzH,EAAMoH,YACRvU,EAAEgR,QAAQC,SAAS9D,EAAMoH,WAAY,qCAX3C,IAAIpH,EAAQ3J,KAeZ,OAAQlC,EAAEuT,SAER,KAAK,GACCrR,KAAKL,QAAQ2M,UACftM,KAAK+O,YAEL/O,KAAK0Q,gBAEP,MAEF,KAAK,GACHG,GAAQ,GACR,MAEF,KAAK,GACHA,EAAO,GACP,MAEF,KAAK,GACH,GAAI7Q,KAAK+Q,WAAY,CACnB,IAAIC,EAAQM,SAAStR,KAAK+Q,WAAWQ,aAAa,qBAAsB,IACxEvR,KAAK6P,uBAAuB7P,KAAK8P,SAASkB,IAC1ChR,KAAK0Q,qBAEL1Q,KAAKyP,WAEP,MACF,QACE,OAGJjT,EAAE+R,SAASc,eAAevR,IAE5B+Q,QAAS,WACP,IAAIhD,EAAI7L,KAAKsO,OAAO7P,MAChBoN,IAAM7L,KAAKyQ,eACbe,aAAaxR,KAAKyR,iBACd5F,EAAEzM,QAAUY,KAAKL,QAAQkN,iBAC3B7M,KAAKyR,gBAAkBC,WACrBlV,EAAEE,KAAK,WACLsD,KAAKyP,UAAS,IACbzP,MACHA,KAAKL,QAAQmN,gBAGf9M,KAAK0Q,2BCtWblU,EAAEC,KAAKiD,OAAOwM,EAAUyF,GAGxBnV,EAAEC,KAAKiD,OAAOlD,EAAE2P,QAAS,CACvBD,SAAUA,EACVmB,SDuWK,SAAkB1N,GACvB,OAAO,IAAIuM,EAASvM"} \ No newline at end of file diff --git a/assets/js/leaflet.js b/assets/js/leaflet.js index 576a90ee..21f499c3 100644 --- a/assets/js/leaflet.js +++ b/assets/js/leaflet.js @@ -1,5 +1,6 @@ /* @preserve - * Leaflet 1.4.0+Detached: 3337f36d2a2d2b33946779057619b31f674ff5dc.3337f36, a JS library for interactive maps. http://leafletjs.com - * (c) 2010-2018 Vladimir Agafonkin, (c) 2010-2011 CloudMade + * Leaflet 1.7.1, a JS library for interactive maps. http://leafletjs.com + * (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade */ -!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L={})}(this,function(t){"use strict";function i(t){var i,e,n,o;for(e=1,n=arguments.length;e=0}function A(t,i,e,n){return"touchstart"===i?O(t,e,n):"touchmove"===i?W(t,e,n):"touchend"===i&&H(t,e,n),this}function I(t,i,e){var n=t["_leaflet_"+i+e];return"touchstart"===i?t.removeEventListener(te,n,!1):"touchmove"===i?t.removeEventListener(ie,n,!1):"touchend"===i&&(t.removeEventListener(ee,n,!1),t.removeEventListener(ne,n,!1)),this}function O(t,i,n){var o=e(function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(oe.indexOf(t.target.tagName)<0))return;Pt(t)}j(t,i)});t["_leaflet_touchstart"+n]=o,t.addEventListener(te,o,!1),re||(document.documentElement.addEventListener(te,R,!0),document.documentElement.addEventListener(ie,N,!0),document.documentElement.addEventListener(ee,D,!0),document.documentElement.addEventListener(ne,D,!0),re=!0)}function R(t){se[t.pointerId]=t,ae++}function N(t){se[t.pointerId]&&(se[t.pointerId]=t)}function D(t){delete se[t.pointerId],ae--}function j(t,i){t.touches=[];for(var e in se)t.touches.push(se[e]);t.changedTouches=[t],i(t)}function W(t,i,e){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&j(t,i)};t["_leaflet_touchmove"+e]=n,t.addEventListener(ie,n,!1)}function H(t,i,e){var n=function(t){j(t,i)};t["_leaflet_touchend"+e]=n,t.addEventListener(ee,n,!1),t.addEventListener(ne,n,!1)}function F(t,i,e){function n(t){var i;if(Vi){if(!bi||"mouse"===t.pointerType)return;i=ae}else i=t.touches.length;if(!(i>1)){var e=Date.now(),n=e-(s||e);r=t.touches?t.touches[0]:t,a=n>0&&n<=h,s=e}}function o(t){if(a&&!r.cancelBubble){if(Vi){if(!bi||"mouse"===t.pointerType)return;var e,n,o={};for(n in r)e=r[n],o[n]=e&&e.bind?e.bind(r):e;r=o}r.type="dblclick",i(r),s=null}}var s,r,a=!1,h=250;return t[le+he+e]=n,t[le+ue+e]=o,t[le+"dblclick"+e]=i,t.addEventListener(he,n,!1),t.addEventListener(ue,o,!1),t.addEventListener("dblclick",i,!1),this}function U(t,i){var e=t[le+he+i],n=t[le+ue+i],o=t[le+"dblclick"+i];return t.removeEventListener(he,e,!1),t.removeEventListener(ue,n,!1),bi||t.removeEventListener("dblclick",o,!1),this}function V(t){return"string"==typeof t?document.getElementById(t):t}function q(t,i){var e=t.style[i]||t.currentStyle&&t.currentStyle[i];if((!e||"auto"===e)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);e=n?n[i]:null}return"auto"===e?null:e}function G(t,i,e){var n=document.createElement(t);return n.className=i||"",e&&e.appendChild(n),n}function K(t){var i=t.parentNode;i&&i.removeChild(t)}function Y(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function X(t){var i=t.parentNode;i&&i.lastChild!==t&&i.appendChild(t)}function J(t){var i=t.parentNode;i&&i.firstChild!==t&&i.insertBefore(t,i.firstChild)}function $(t,i){if(void 0!==t.classList)return t.classList.contains(i);var e=et(t);return e.length>0&&new RegExp("(^|\\s)"+i+"(\\s|$)").test(e)}function Q(t,i){if(void 0!==t.classList)for(var e=u(i),n=0,o=e.length;n100&&n<500||t.target._simulatedClick&&!t._simulated?Lt(t):(ge=e,i(t))}function Zt(t,i){if(!i||!t.length)return t.slice();var e=i*i;return t=At(t,e),t=kt(t,e)}function Et(t,i,e){return Math.sqrt(Dt(t,i,e,!0))}function kt(t,i){var e=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(e);n[0]=n[e-1]=1,Bt(t,n,i,0,e-1);var o,s=[];for(o=0;oh&&(s=r,h=a);h>e&&(i[s]=1,Bt(t,i,e,n,s),Bt(t,i,e,s,o))}function At(t,i){for(var e=[t[0]],n=1,o=0,s=t.length;ni&&(e.push(t[n]),o=n);return oi.max.x&&(e|=2),t.yi.max.y&&(e|=8),e}function Nt(t,i){var e=i.x-t.x,n=i.y-t.y;return e*e+n*n}function Dt(t,i,e,n){var o,s=i.x,r=i.y,a=e.x-s,h=e.y-r,u=a*a+h*h;return u>0&&((o=((t.x-s)*a+(t.y-r)*h)/u)>1?(s=e.x,r=e.y):o>0&&(s+=a*o,r+=h*o)),a=t.x-s,h=t.y-r,n?a*a+h*h:new x(s,r)}function jt(t){return!oi(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Wt(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),jt(t)}function Ht(t,i,e){var n,o,s,r,a,h,u,l,c,_=[1,4,2,8];for(o=0,u=t.length;o0?Math.floor(t):Math.ceil(t)};x.prototype={clone:function(){return new x(this.x,this.y)},add:function(t){return this.clone()._add(w(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(w(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new x(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new x(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=_i(this.x),this.y=_i(this.y),this},distanceTo:function(t){var i=(t=w(t)).x-this.x,e=t.y-this.y;return Math.sqrt(i*i+e*e)},equals:function(t){return(t=w(t)).x===this.x&&t.y===this.y},contains:function(t){return t=w(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+a(this.x)+", "+a(this.y)+")"}},P.prototype={extend:function(t){return t=w(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new x((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new x(this.min.x,this.max.y)},getTopRight:function(){return new x(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var i,e;return(t="number"==typeof t[0]||t instanceof x?w(t):b(t))instanceof P?(i=t.min,e=t.max):i=e=t,i.x>=this.min.x&&e.x<=this.max.x&&i.y>=this.min.y&&e.y<=this.max.y},intersects:function(t){t=b(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>=i.x&&n.x<=e.x,r=o.y>=i.y&&n.y<=e.y;return s&&r},overlaps:function(t){t=b(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>i.x&&n.xi.y&&n.y=n.lat&&e.lat<=o.lat&&i.lng>=n.lng&&e.lng<=o.lng},intersects:function(t){t=z(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=i.lat&&n.lat<=e.lat,r=o.lng>=i.lng&&n.lng<=e.lng;return s&&r},overlaps:function(t){t=z(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>i.lat&&n.lati.lng&&n.lng1,Xi=!!document.createElement("canvas").getContext,Ji=!(!document.createElementNS||!E("svg").createSVGRect),$i=!Ji&&function(){try{var t=document.createElement("div");t.innerHTML='';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}(),Qi=(Object.freeze||Object)({ie:Pi,ielt9:Li,edge:bi,webkit:Ti,android:zi,android23:Mi,androidStock:Si,opera:Zi,chrome:Ei,gecko:ki,safari:Bi,phantom:Ai,opera12:Ii,win:Oi,ie3d:Ri,webkit3d:Ni,gecko3d:Di,any3d:ji,mobile:Wi,mobileWebkit:Hi,mobileWebkit3d:Fi,msPointer:Ui,pointer:Vi,touch:qi,mobileOpera:Gi,mobileGecko:Ki,retina:Yi,canvas:Xi,svg:Ji,vml:$i}),te=Ui?"MSPointerDown":"pointerdown",ie=Ui?"MSPointerMove":"pointermove",ee=Ui?"MSPointerUp":"pointerup",ne=Ui?"MSPointerCancel":"pointercancel",oe=["INPUT","SELECT","OPTION"],se={},re=!1,ae=0,he=Ui?"MSPointerDown":Vi?"pointerdown":"touchstart",ue=Ui?"MSPointerUp":Vi?"pointerup":"touchend",le="_leaflet_",ce=st(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),_e=st(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),de="webkitTransition"===_e||"OTransition"===_e?_e+"End":"transitionend";if("onselectstart"in document)fi=function(){mt(window,"selectstart",Pt)},gi=function(){ft(window,"selectstart",Pt)};else{var pe=st(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);fi=function(){if(pe){var t=document.documentElement.style;vi=t[pe],t[pe]="none"}},gi=function(){pe&&(document.documentElement.style[pe]=vi,vi=void 0)}}var me,fe,ge,ve=(Object.freeze||Object)({TRANSFORM:ce,TRANSITION:_e,TRANSITION_END:de,get:V,getStyle:q,create:G,remove:K,empty:Y,toFront:X,toBack:J,hasClass:$,addClass:Q,removeClass:tt,setClass:it,getClass:et,setOpacity:nt,testProp:st,setTransform:rt,setPosition:at,getPosition:ht,disableTextSelection:fi,enableTextSelection:gi,disableImageDrag:ut,enableImageDrag:lt,preventOutline:ct,restoreOutline:_t,getSizedParentNode:dt,getScale:pt}),ye="_leaflet_events",xe=Oi&&Ei?2*window.devicePixelRatio:ki?window.devicePixelRatio:1,we={},Pe=(Object.freeze||Object)({on:mt,off:ft,stopPropagation:yt,disableScrollPropagation:xt,disableClickPropagation:wt,preventDefault:Pt,stop:Lt,getMousePosition:bt,getWheelDelta:Tt,fakeStop:zt,skipped:Mt,isExternalTarget:Ct,addListener:mt,removeListener:ft}),Le=ci.extend({run:function(t,i,e,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=e||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=ht(t),this._offset=i.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=f(this._animate,this),this._step()},_step:function(t){var i=+new Date-this._startTime,e=1e3*this._duration;ithis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,i){this._enforcingBounds=!0;var e=this.getCenter(),n=this._limitCenter(e,this._zoom,z(t));return e.equals(n)||this.panTo(n,i),this._enforcingBounds=!1,this},panInside:function(t,i){var e=w((i=i||{}).paddingTopLeft||i.padding||[0,0]),n=w(i.paddingBottomRight||i.padding||[0,0]),o=this.getCenter(),s=this.project(o),r=this.project(t),a=this.getPixelBounds(),h=a.getSize().divideBy(2),u=b([a.min.add(e),a.max.subtract(n)]);if(!u.contains(r)){this._enforcingBounds=!0;var l=s.subtract(r),c=w(r.x+l.x,r.y+l.y);(r.xu.max.x)&&(c.x=s.x-l.x,l.x>0?c.x+=h.x-e.x:c.x-=h.x-n.x),(r.yu.max.y)&&(c.y=s.y-l.y,l.y>0?c.y+=h.y-e.y:c.y-=h.y-n.y),this.panTo(this.unproject(c),i),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),s=n.divideBy(2).round(),r=o.divideBy(2).round(),a=s.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(e(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=e(this._handleGeolocationResponse,this),o=e(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,o,t):navigator.geolocation.getCurrentPosition(n,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var i=t.code,e=t.message||(1===i?"permission denied":2===i?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:i,message:"Geolocation error: "+e+"."})},_handleGeolocationResponse:function(t){var i=new M(t.coords.latitude,t.coords.longitude),e=i.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(e);this.setView(i,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:i,bounds:e,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)},addHandler:function(t,i){if(!i)return this;var e=this[t]=new i(this);return this._handlers.push(e),this.options[t]&&e.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),K(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(g(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)K(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,i){var e=G("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),i||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new T(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,i,e){t=z(t),e=w(e||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(e),u=b(this.project(a,n),this.project(r,n)).getSize(),l=ji?this.options.zoomSnap:1,c=h.x/u.x,_=h.y/u.y,d=i?Math.max(c,_):Math.min(c,_);return n=this.getScaleZoom(d,n),l&&(n=Math.round(n/(l/100))*(l/100),n=i?Math.ceil(n/l)*l:Math.floor(n/l)*l),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new x(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,i){var e=this._getTopLeftPoint(t,i);return new P(e,e.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,i){var e=this.options.crs;return i=void 0===i?this._zoom:i,e.scale(t)/e.scale(i)},getScaleZoom:function(t,i){var e=this.options.crs;i=void 0===i?this._zoom:i;var n=e.zoom(t*e.scale(i));return isNaN(n)?1/0:n},project:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.latLngToPoint(C(t),i)},unproject:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.pointToLatLng(w(t),i)},layerPointToLatLng:function(t){var i=w(t).add(this.getPixelOrigin());return this.unproject(i)},latLngToLayerPoint:function(t){return this.project(C(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(C(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(z(t))},distance:function(t,i){return this.options.crs.distance(C(t),C(i))},containerPointToLayerPoint:function(t){return w(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return w(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var i=this.containerPointToLayerPoint(w(t));return this.layerPointToLatLng(i)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(C(t)))},mouseEventToContainerPoint:function(t){return bt(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var i=this._container=V(t);if(!i)throw new Error("Map container not found.");if(i._leaflet_id)throw new Error("Map container is already initialized.");mt(i,"scroll",this._onScroll,this),this._containerId=n(i)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&ji,Q(t,"leaflet-container"+(qi?" leaflet-touch":"")+(Yi?" leaflet-retina":"")+(Li?" leaflet-oldie":"")+(Bi?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var i=q(t,"position");"absolute"!==i&&"relative"!==i&&"fixed"!==i&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),at(this._mapPane,new x(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Q(t.markerPane,"leaflet-zoom-hide"),Q(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,i){at(this._mapPane,new x(0,0));var e=!this._loaded;this._loaded=!0,i=this._limitZoom(i),this.fire("viewprereset");var n=this._zoom!==i;this._moveStart(n,!1)._move(t,i)._moveEnd(n),this.fire("viewreset"),e&&this.fire("load")},_moveStart:function(t,i){return t&&this.fire("zoomstart"),i||this.fire("movestart"),this},_move:function(t,i,e){void 0===i&&(i=this._zoom);var n=this._zoom!==i;return this._zoom=i,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||e&&e.pinch)&&this.fire("zoom",e),this.fire("move",e)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return g(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){at(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[n(this._container)]=this;var i=t?ft:mt;i(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress",this._handleDOMEvent,this),this.options.trackResize&&i(window,"resize",this._onResize,this),ji&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){g(this._resizeRequest),this._resizeRequest=f(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,i){for(var e,o=[],s="mouseout"===i||"mouseover"===i,r=t.target||t.srcElement,a=!1;r;){if((e=this._targets[n(r)])&&("click"===i||"preclick"===i)&&!t._simulated&&this._draggableMoved(e)){a=!0;break}if(e&&e.listens(i,!0)){if(s&&!Ct(r,t))break;if(o.push(e),s)break}if(r===this._container)break;r=r.parentNode}return o.length||a||s||!Ct(r,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!Mt(t)){var i=t.type;"mousedown"!==i&&"keypress"!==i||ct(t.target||t.srcElement),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}if(!t._stopped&&(n=(n||[]).concat(this._findEventTargets(t,e))).length){var s=n[0];"contextmenu"===e&&s.listens(e,!0)&&Pt(t);var r={originalEvent:t};if("keypress"!==t.type){var a=s.getLatLng&&(!s._radius||s._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var h=0;h0?Math.round(t-i)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(i))},_limitZoom:function(t){var i=this.getMinZoom(),e=this.getMaxZoom(),n=ji?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(i,Math.min(e,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){tt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,i){var e=this._getCenterOffset(t)._trunc();return!(!0!==(i&&i.animate)&&!this.getSize().contains(e))&&(this.panBy(e,i),!0)},_createAnimProxy:function(){var t=this._proxy=G("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var i=ce,e=this._proxy.style[i];rt(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),e===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",function(){var t=this.getCenter(),i=this.getZoom();rt(this._proxy,this.project(t,i),this.getZoomScale(i,1))},this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){K(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,i,e){if(this._animatingZoom)return!0;if(e=e||{},!this._zoomAnimated||!1===e.animate||this._nothingToAnimate()||Math.abs(i-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(i),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==e.animate&&!this.getSize().contains(o))&&(f(function(){this._moveStart(!0,!1)._animateZoom(t,i,!0)},this),!0)},_animateZoom:function(t,i,n,o){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=i,Q(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:i,noUpdate:o}),setTimeout(e(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&tt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),f(function(){this._moveEnd(!0)},this))}}),Te=v.extend({options:{position:"topright"},initialize:function(t){l(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var i=this._map;return i&&i.removeControl(this),this.options.position=t,i&&i.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var i=this._container=this.onAdd(t),e=this.getPosition(),n=t._controlCorners[e];return Q(i,"leaflet-control"),-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this},remove:function(){return this._map?(K(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ze=function(t){return new Te(t)};be.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){function t(t,o){var s=e+t+" "+e+o;i[t+o]=G("div",s,n)}var i=this._controlCorners={},e="leaflet-",n=this._controlContainer=G("div",e+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)K(this._controlCorners[t]);K(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Me=Te.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,i,e,n){return e1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=i&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var i=this._getLayer(n(t.target)),e=i.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;e&&this._map.fire(e,i)},_createRadioElement:function(t,i){var e='",n=document.createElement("div");return n.innerHTML=e,n.firstChild},_addItem:function(t){var i,e=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((i=document.createElement("input")).type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=o):i=this._createRadioElement("leaflet-base-layers",o),this._layerControlInputs.push(i),i.layerId=n(t.layer),mt(i,"click",this._onInputClick,this);var s=document.createElement("span");s.innerHTML=" "+t.name;var r=document.createElement("div");return e.appendChild(r),r.appendChild(i),r.appendChild(s),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t,i,e=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=e.length-1;s>=0;s--)t=e[s],i=this._getLayer(t.layerId).layer,t.checked?n.push(i):t.checked||o.push(i);for(s=0;s=0;o--)t=e[o],i=this._getLayer(t.layerId).layer,t.disabled=void 0!==i.options.minZoom&&ni.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),Ce=Te.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var i="leaflet-control-zoom",e=G("div",i+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,i+"-in",e,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,i+"-out",e,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),e},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,i,e,n,o){var s=G("a",e,n);return s.innerHTML=t,s.href="#",s.title=i,s.setAttribute("role","button"),s.setAttribute("aria-label",i),wt(s),mt(s,"click",Lt),mt(s,"click",o,this),mt(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,i="leaflet-disabled";tt(this._zoomInButton,i),tt(this._zoomOutButton,i),(this._disabled||t._zoom===t.getMinZoom())&&Q(this._zoomOutButton,i),(this._disabled||t._zoom===t.getMaxZoom())&&Q(this._zoomInButton,i)}});be.mergeOptions({zoomControl:!0}),be.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ce,this.addControl(this.zoomControl))});var Se=Te.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var i=G("div","leaflet-control-scale"),e=this.options;return this._addScales(e,"leaflet-control-scale-line",i),t.on(e.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,i,e){t.metric&&(this._mScale=G("div",i,e)),t.imperial&&(this._iScale=G("div",i,e))},_update:function(){var t=this._map,i=t.getSize().y/2,e=t.distance(t.containerPointToLatLng([0,i]),t.containerPointToLatLng([this.options.maxWidth,i]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var i=this._getRoundNum(t),e=i<1e3?i+" m":i/1e3+" km";this._updateScale(this._mScale,e,i/t)},_updateImperial:function(t){var i,e,n,o=3.2808399*t;o>5280?(i=o/5280,e=this._getRoundNum(i),this._updateScale(this._iScale,e+" mi",e/i)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,i,e){t.style.width=Math.round(this.options.maxWidth*e)+"px",t.innerHTML=i},_getRoundNum:function(t){var i=Math.pow(10,(Math.floor(t)+"").length-1),e=t/i;return e=e>=10?10:e>=5?5:e>=3?3:e>=2?2:1,i*e}}),Ze=Te.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){l(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=G("div","leaflet-control-attribution"),wt(this._container);for(var i in t._layers)t._layers[i].getAttribution&&this.addAttribution(t._layers[i].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var i in this._attributions)this._attributions[i]&&t.push(i);var e=[];this.options.prefix&&e.push(this.options.prefix),t.length&&e.push(t.join(", ")),this._container.innerHTML=e.join(" | ")}}});be.mergeOptions({attributionControl:!0}),be.addInitHook(function(){this.options.attributionControl&&(new Ze).addTo(this)});Te.Layers=Me,Te.Zoom=Ce,Te.Scale=Se,Te.Attribution=Ze,ze.layers=function(t,i,e){return new Me(t,i,e)},ze.zoom=function(t){return new Ce(t)},ze.scale=function(t){return new Se(t)},ze.attribution=function(t){return new Ze(t)};var Ee=v.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Ee.addTo=function(t,i){return t.addHandler(i,this),this};var ke,Be={Events:li},Ae=qi?"touchstart mousedown":"mousedown",Ie={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},Oe={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},Re=ci.extend({options:{clickTolerance:3},initialize:function(t,i,e,n){l(this,n),this._element=t,this._dragStartTarget=i||t,this._preventOutline=e},enable:function(){this._enabled||(mt(this._dragStartTarget,Ae,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Re._dragging===this&&this.finishDrag(),ft(this._dragStartTarget,Ae,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!$(this._element,"leaflet-zoom-anim")&&!(Re._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(Re._dragging=this,this._preventOutline&&ct(this._element),ut(),fi(),this._moving)))){this.fire("down");var i=t.touches?t.touches[0]:t,e=dt(this._element);this._startPoint=new x(i.clientX,i.clientY),this._parentScale=pt(e),mt(document,Oe[t.type],this._onMove,this),mt(document,Ie[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var i=t.touches&&1===t.touches.length?t.touches[0]:t,e=new x(i.clientX,i.clientY)._subtract(this._startPoint);(e.x||e.y)&&(Math.abs(e.x)+Math.abs(e.y)1e-7;h++)i=s*Math.sin(a),i=Math.pow((1-i)/(1+i),s/2),a+=u=Math.PI/2-2*Math.atan(r*i)-a;return new M(a*e,t.x*e/n)}},He=(Object.freeze||Object)({LonLat:je,Mercator:We,SphericalMercator:mi}),Fe=i({},pi,{code:"EPSG:3395",projection:We,transformation:function(){var t=.5/(Math.PI*We.R);return Z(t,.5,-t,.5)}()}),Ue=i({},pi,{code:"EPSG:4326",projection:je,transformation:Z(1/180,1,-1/180,.5)}),Ve=i({},di,{projection:je,transformation:Z(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,i){var e=i.lng-t.lng,n=i.lat-t.lat;return Math.sqrt(e*e+n*n)},infinite:!0});di.Earth=pi,di.EPSG3395=Fe,di.EPSG3857=yi,di.EPSG900913=xi,di.EPSG4326=Ue,di.Simple=Ve;var qe=ci.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[n(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[n(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var i=t.target;if(i.hasLayer(this)){if(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents){var e=this.getEvents();i.on(e,this),this.once("remove",function(){i.off(e,this)},this)}this.onAdd(i),this.getAttribution&&i.attributionControl&&i.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),i.fire("layeradd",{layer:this})}}});be.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var i=n(t);return this._layers[i]?this:(this._layers[i]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var i=n(t);return this._layers[i]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[i],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&n(t)in this._layers},eachLayer:function(t,i){for(var e in this._layers)t.call(i,this._layers[e]);return this},_addLayers:function(t){for(var i=0,e=(t=t?oi(t)?t:[t]:[]).length;ithis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()i)return r=(n-i)/e,this._map.layerPointToLatLng([s.x-r*(s.x-o.x),s.y-r*(s.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,i){return i=i||this._defaultShape(),t=C(t),i.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new T,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return jt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var i=[],e=jt(t),n=0,o=t.length;n=2&&i[0]instanceof M&&i[0].equals(i[e-1])&&i.pop(),i},_setLatLngs:function(t){nn.prototype._setLatLngs.call(this,t),jt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return jt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,i=this.options.weight,e=new x(i,i);if(t=new P(t.min.subtract(e),t.max.add(e)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;ot.y!=n.y>t.y&&t.x<(n.x-e.x)*(t.y-e.y)/(n.y-e.y)+e.x&&(u=!u);return u||nn.prototype._containsPoint.call(this,t,!0)}}),sn=Ke.extend({initialize:function(t,i){l(this,i),this._layers={},t&&this.addData(t)},addData:function(t){var i,e,n,o=oi(t)?t:t.features;if(o){for(i=0,e=o.length;i0?o:[i.src]}else{oi(this._url)||(this._url=[this._url]),i.autoplay=!!this.options.autoplay,i.loop=!!this.options.loop;for(var a=0;ao?(i.height=o+"px",Q(t,"leaflet-popup-scrolled")):tt(t,"leaflet-popup-scrolled"),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var i=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),e=this._getAnchor();at(this._container,i.add(e))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,i=parseInt(q(this._container,"marginBottom"),10)||0,e=this._container.offsetHeight+i,n=this._containerWidth,o=new x(this._containerLeft,-e-this._containerBottom);o._add(ht(this._container));var s=t.layerPointToContainerPoint(o),r=w(this.options.autoPanPadding),a=w(this.options.autoPanPaddingTopLeft||r),h=w(this.options.autoPanPaddingBottomRight||r),u=t.getSize(),l=0,c=0;s.x+n+h.x>u.x&&(l=s.x+n-u.x+h.x),s.x-l-a.x<0&&(l=s.x-a.x),s.y+e+h.y>u.y&&(c=s.y+e-u.y+h.y),s.y-c-a.y<0&&(c=s.y-a.y),(l||c)&&t.fire("autopanstart").panBy([l,c])}},_onCloseButtonClick:function(t){this._close(),Lt(t)},_getAnchor:function(){return w(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});be.mergeOptions({closePopupOnClick:!0}),be.include({openPopup:function(t,i,e){return t instanceof cn||(t=new cn(e).setContent(t)),i&&t.setLatLng(i),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),qe.include({bindPopup:function(t,i){return t instanceof cn?(l(t,i),this._popup=t,t._source=this):(this._popup&&!i||(this._popup=new cn(i,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,i){if(t instanceof qe||(i=t,t=this),t instanceof Ke)for(var e in this._layers){t=this._layers[e];break}return i||(i=t.getCenter?t.getCenter():t.getLatLng()),this._popup&&this._map&&(this._popup._source=t,this._popup.update(),this._map.openPopup(this._popup,i)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var i=t.layer||t.target;this._popup&&this._map&&(Lt(t),i instanceof Qe?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===i?this.closePopup():this.openPopup(i,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var _n=ln.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){ln.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){ln.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=ln.prototype.getEvents.call(this);return qi&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=G("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var i=this._map,e=this._container,n=i.latLngToContainerPoint(i.getCenter()),o=i.layerPointToContainerPoint(t),s=this.options.direction,r=e.offsetWidth,a=e.offsetHeight,h=w(this.options.offset),u=this._getAnchor();"top"===s?t=t.add(w(-r/2+h.x,-a+h.y+u.y,!0)):"bottom"===s?t=t.subtract(w(r/2-h.x,-h.y,!0)):"center"===s?t=t.subtract(w(r/2+h.x,a/2-u.y+h.y,!0)):"right"===s||"auto"===s&&o.xthis.options.maxZoom||en&&this._retainParent(o,s,r,n))},_retainChildren:function(t,i,e,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*i;s<2*i+2;s++){var r=new x(o,s);r.z=e+1;var a=this._tileCoordsToKey(r),h=this._tiles[a];h&&h.active?h.retain=!0:(h&&h.loaded&&(h.retain=!0),e+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(t,e);else{for(var c=o.min.y;c<=o.max.y;c++)for(var _=o.min.x;_<=o.max.x;_++){var d=new x(_,c);if(d.z=this._tileZoom,this._isValidTile(d)){var p=this._tiles[this._tileCoordsToKey(d)];p?p.current=!0:r.push(d)}}if(r.sort(function(t,i){return t.distanceTo(s)-i.distanceTo(s)}),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(_=0;_e.max.x)||!i.wrapLat&&(t.ye.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return z(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var i=this._map,e=this.getTileSize(),n=t.scaleBy(e),o=n.add(e);return[i.unproject(n,t.z),i.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var i=this._tileCoordsToNwSe(t),e=new T(i[0],i[1]);return this.options.noWrap||(e=this._map.wrapLatLngBounds(e)),e},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var i=t.split(":"),e=new x(+i[0],+i[1]);return e.z=+i[2],e},_removeTile:function(t){var i=this._tiles[t];i&&(K(i.el),delete this._tiles[t],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){Q(t,"leaflet-tile");var i=this.getTileSize();t.style.width=i.x+"px",t.style.height=i.y+"px",t.onselectstart=r,t.onmousemove=r,Li&&this.options.opacity<1&&nt(t,this.options.opacity),zi&&!Mi&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,i){var n=this._getTilePos(t),o=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),e(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&f(e(this._tileReady,this,t,null,s)),at(s,n),this._tiles[o]={el:s,coords:t,current:!0},i.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,i,n){i&&this.fire("tileerror",{error:i,tile:n,coords:t});var o=this._tileCoordsToKey(t);(n=this._tiles[o])&&(n.loaded=+new Date,this._map._fadeAnimated?(nt(n.el,0),g(this._fadeFrame),this._fadeFrame=f(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),i||(Q(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Li||!this._map._fadeAnimated?f(this._pruneTiles,this):setTimeout(e(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var i=new x(this._wrapX?s(t.x,this._wrapX):t.x,this._wrapY?s(t.y,this._wrapY):t.y);return i.z=t.z,i},_pxBoundsToTileRange:function(t){var i=this.getTileSize();return new P(t.min.unscaleBy(i).floor(),t.max.unscaleBy(i).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),mn=pn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,i){this._url=t,(i=l(this,i)).detectRetina&&Yi&&i.maxZoom>0&&(i.tileSize=Math.floor(i.tileSize/2),i.zoomReverse?(i.zoomOffset--,i.minZoom++):(i.zoomOffset++,i.maxZoom--),i.minZoom=Math.max(0,i.minZoom)),"string"==typeof i.subdomains&&(i.subdomains=i.subdomains.split("")),zi||this.on("tileunload",this._onTileRemove)},setUrl:function(t,i){return this._url===t&&void 0===i&&(i=!0),this._url=t,i||this.redraw(),this},createTile:function(t,i){var n=document.createElement("img");return mt(n,"load",e(this._tileOnLoad,this,i,n)),mt(n,"error",e(this._tileOnError,this,i,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n.alt="",n.setAttribute("role","presentation"),n.src=this.getTileUrl(t),n},getTileUrl:function(t){var e={r:Yi?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return _(this._url,i(e,this.options))},_tileOnLoad:function(t,i){Li?setTimeout(e(t,this,null,i),0):t(null,i)},_tileOnError:function(t,i,e){var n=this.options.errorTileUrl;n&&i.getAttribute("src")!==n&&(i.src=n),t(e,i)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,i=this.options.maxZoom,e=this.options.zoomReverse,n=this.options.zoomOffset;return e&&(t=i-t),t+n},_getSubdomain:function(t){var i=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[i]},_abortLoading:function(){var t,i;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((i=this._tiles[t].el).onload=r,i.onerror=r,i.complete||(i.src=si,K(i),delete this._tiles[t]))},_removeTile:function(t){var i=this._tiles[t];if(i)return Si||i.el.setAttribute("src",si),pn.prototype._removeTile.call(this,t)},_tileReady:function(t,i,e){if(this._map&&(!e||e.getAttribute("src")!==si))return pn.prototype._tileReady.call(this,t,i,e)}}),fn=mn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);var s=(e=l(this,e)).detectRetina&&Yi?2:1,r=this.getTileSize();n.width=r.x*s,n.height=r.y*s,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var i=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[i]=this._crs.code,mn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var i=this._tileCoordsToNwSe(t),e=this._crs,n=b(e.project(i[0]),e.project(i[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===Ue?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=mn.prototype.getTileUrl.call(this,t);return a+c(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});mn.WMS=fn,Jt.wms=function(t,i){return new fn(t,i)};var gn=qe.extend({options:{padding:.1,tolerance:0},initialize:function(t){l(this,t),n(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&Q(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,i){var e=this._map.getZoomScale(i,this._zoom),n=ht(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,i),r=this._map.project(t,i).subtract(s),a=o.multiplyBy(-e).add(n).add(o).subtract(r);ji?rt(this._container,a,e):at(this._container,a)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,i=this._map.getSize(),e=this._map.containerPointToLayerPoint(i.multiplyBy(-t)).round();this._bounds=new P(e,e.add(i.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),vn=gn.extend({getEvents:function(){var t=gn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){gn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");mt(t,"mousemove",o(this._onMouseMove,32,this),this),mt(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),mt(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){g(this._redrawRequest),delete this._ctx,K(this._container),ft(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){this._redrawBounds=null;for(var t in this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){gn.prototype._update.call(this);var t=this._bounds,i=this._container,e=t.getSize(),n=Yi?2:1;at(i,t.min),i.width=n*e.x,i.height=n*e.y,i.style.width=e.x+"px",i.style.height=e.y+"px",Yi&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){gn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[n(t)]=t;var i=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=i),this._drawLast=i,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var i=t._order,e=i.next,o=i.prev;e?e.prev=o:this._drawLast=o,o?o.next=e:this._drawFirst=e,delete t._order,delete this._layers[n(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var i,e,n=t.options.dashArray.split(/[, ]+/),o=[];for(e=0;e')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),xn={_initContainer:function(){this._container=G("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(gn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var i=t._container=yn("shape");Q(i,"leaflet-vml-shape "+(this.options.className||"")),i.coordsize="1 1",t._path=yn("path"),i.appendChild(t._path),this._updateStyle(t),this._layers[n(t)]=t},_addPath:function(t){var i=t._container;this._container.appendChild(i),t.options.interactive&&t.addInteractiveTarget(i)},_removePath:function(t){var i=t._container;K(i),t.removeInteractiveTarget(i),delete this._layers[n(t)]},_updateStyle:function(t){var i=t._stroke,e=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(i||(i=t._stroke=yn("stroke")),o.appendChild(i),i.weight=n.weight+"px",i.color=n.color,i.opacity=n.opacity,n.dashArray?i.dashStyle=oi(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):i.dashStyle="",i.endcap=n.lineCap.replace("butt","flat"),i.joinstyle=n.lineJoin):i&&(o.removeChild(i),t._stroke=null),n.fill?(e||(e=t._fill=yn("fill")),o.appendChild(e),e.color=n.fillColor||n.color,e.opacity=n.fillOpacity):e&&(o.removeChild(e),t._fill=null)},_updateCircle:function(t){var i=t._point.round(),e=Math.round(t._radius),n=Math.round(t._radiusY||e);this._setPath(t,t._empty()?"M0 0":"AL "+i.x+","+i.y+" "+e+","+n+" 0,23592600")},_setPath:function(t,i){t._path.v=i},_bringToFront:function(t){X(t._container)},_bringToBack:function(t){J(t._container)}},wn=$i?yn:E,Pn=gn.extend({getEvents:function(){var t=gn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=wn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=wn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){K(this._container),ft(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){gn.prototype._update.call(this);var t=this._bounds,i=t.getSize(),e=this._container;this._svgSize&&this._svgSize.equals(i)||(this._svgSize=i,e.setAttribute("width",i.x),e.setAttribute("height",i.y)),at(e,t.min),e.setAttribute("viewBox",[t.min.x,t.min.y,i.x,i.y].join(" ")),this.fire("update")}},_initPath:function(t){var i=t._path=wn("path");t.options.className&&Q(i,t.options.className),t.options.interactive&&Q(i,"leaflet-interactive"),this._updateStyle(t),this._layers[n(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){K(t._path),t.removeInteractiveTarget(t._path),delete this._layers[n(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var i=t._path,e=t.options;i&&(e.stroke?(i.setAttribute("stroke",e.color),i.setAttribute("stroke-opacity",e.opacity),i.setAttribute("stroke-width",e.weight),i.setAttribute("stroke-linecap",e.lineCap),i.setAttribute("stroke-linejoin",e.lineJoin),e.dashArray?i.setAttribute("stroke-dasharray",e.dashArray):i.removeAttribute("stroke-dasharray"),e.dashOffset?i.setAttribute("stroke-dashoffset",e.dashOffset):i.removeAttribute("stroke-dashoffset")):i.setAttribute("stroke","none"),e.fill?(i.setAttribute("fill",e.fillColor||e.color),i.setAttribute("fill-opacity",e.fillOpacity),i.setAttribute("fill-rule",e.fillRule||"evenodd")):i.setAttribute("fill","none"))},_updatePoly:function(t,i){this._setPath(t,k(t._parts,i))},_updateCircle:function(t){var i=t._point,e=Math.max(Math.round(t._radius),1),n="a"+e+","+(Math.max(Math.round(t._radiusY),1)||e)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(i.x-e)+","+i.y+n+2*e+",0 "+n+2*-e+",0 ";this._setPath(t,o)},_setPath:function(t,i){t._path.setAttribute("d",i)},_bringToFront:function(t){X(t._path)},_bringToBack:function(t){J(t._path)}});$i&&Pn.include(xn),be.include({getRenderer:function(t){var i=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return i||(i=this._renderer=this._createRenderer()),this.hasLayer(i)||this.addLayer(i),i},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var i=this._paneRenderers[t];return void 0===i&&(i=this._createRenderer({pane:t}),this._paneRenderers[t]=i),i},_createRenderer:function(t){return this.options.preferCanvas&&$t(t)||Qt(t)}});var Ln=on.extend({initialize:function(t,i){on.prototype.initialize.call(this,this._boundsToLatLngs(t),i)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=z(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Pn.create=wn,Pn.pointsToPath=k,sn.geometryToLayer=Ft,sn.coordsToLatLng=Ut,sn.coordsToLatLngs=Vt,sn.latLngToCoords=qt,sn.latLngsToCoords=Gt,sn.getFeature=Kt,sn.asFeature=Yt,be.mergeOptions({boxZoom:!0});var bn=Ee.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){mt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){ft(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){K(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),fi(),ut(),this._startPoint=this._map.mouseEventToContainerPoint(t),mt(document,{contextmenu:Lt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=G("div","leaflet-zoom-box",this._container),Q(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var i=new P(this._point,this._startPoint),e=i.getSize();at(this._box,i.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(K(this._box),tt(this._container,"leaflet-crosshair")),gi(),lt(),ft(document,{contextmenu:Lt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(e(this._resetState,this),0);var i=new T(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(i).fire("boxzoomend",{boxZoomBounds:i})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});be.addInitHook("addHandler","boxZoom",bn),be.mergeOptions({doubleClickZoom:!0});var Tn=Ee.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var i=this._map,e=i.getZoom(),n=i.options.zoomDelta,o=t.originalEvent.shiftKey?e-n:e+n;"center"===i.options.doubleClickZoom?i.setZoom(o):i.setZoomAround(t.containerPoint,o)}});be.addInitHook("addHandler","doubleClickZoom",Tn),be.mergeOptions({dragging:!0,inertia:!Mi,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var zn=Ee.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Re(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}Q(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){tt(this._map._container,"leaflet-grab"),tt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var i=z(this._map.options.maxBounds);this._offsetLimit=b(this._map.latLngToContainerPoint(i.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(i.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var i=this._lastTime=+new Date,e=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(e),this._times.push(i),this._prunePositions(i)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),i=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=i.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,i){return t-(t-i)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),i=this._offsetLimit;t.xi.max.x&&(t.x=this._viscousLimit(t.x,i.max.x)),t.y>i.max.y&&(t.y=this._viscousLimit(t.y,i.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,i=Math.round(t/2),e=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-i+e)%t+i-e,s=(n+i+e)%t-i-e,r=Math.abs(o+e)0?s:-s))-i;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(i+r):t.setZoomAround(this._lastMousePos,i+r))}});be.addInitHook("addHandler","scrollWheelZoom",Cn),be.mergeOptions({tap:!0,tapTolerance:15});var Sn=Ee.extend({addHooks:function(){mt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){ft(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Pt(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var i=t.touches[0],n=i.target;this._startPos=this._newPos=new x(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&Q(n,"leaflet-active"),this._holdTimeout=setTimeout(e(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),this._simulateEvent("mousedown",i),mt(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),ft(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],e=i.target;e&&e.tagName&&"a"===e.tagName.toLowerCase()&&tt(e,"leaflet-active"),this._simulateEvent("mouseup",i),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var i=t.touches[0];this._newPos=new x(i.clientX,i.clientY),this._simulateEvent("mousemove",i)},_simulateEvent:function(t,i){var e=document.createEvent("MouseEvents");e._simulated=!0,i.target._simulatedClick=!0,e.initMouseEvent(t,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),i.target.dispatchEvent(e)}});qi&&!Vi&&be.addInitHook("addHandler","tap",Sn),be.mergeOptions({touchZoom:qi&&!Mi,bounceAtZoomLimits:!0});var Zn=Ee.extend({addHooks:function(){Q(this._map._container,"leaflet-touch-zoom"),mt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){tt(this._map._container,"leaflet-touch-zoom"),ft(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var e=i.mouseEventToContainerPoint(t.touches[0]),n=i.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=i.getSize()._divideBy(2),this._startLatLng=i.containerPointToLatLng(this._centerPoint),"center"!==i.options.touchZoom&&(this._pinchStartLatLng=i.containerPointToLatLng(e.add(n)._divideBy(2))),this._startDist=e.distanceTo(n),this._startZoom=i.getZoom(),this._moved=!1,this._zooming=!0,i._stop(),mt(document,"touchmove",this._onTouchMove,this),mt(document,"touchend",this._onTouchEnd,this),Pt(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var i=this._map,n=i.mouseEventToContainerPoint(t.touches[0]),o=i.mouseEventToContainerPoint(t.touches[1]),s=n.distanceTo(o)/this._startDist;if(this._zoom=i.getScaleZoom(s,this._startZoom),!i.options.bounceAtZoomLimits&&(this._zoomi.getMaxZoom()&&s>1)&&(this._zoom=i._limitZoom(this._zoom)),"center"===i.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var r=n._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===r.x&&0===r.y)return;this._center=i.unproject(i.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(i._moveStart(!0,!1),this._moved=!0),g(this._animRequest);var a=e(i._move,i,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=f(a,this,!0),Pt(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,g(this._animRequest),ft(document,"touchmove",this._onTouchMove),ft(document,"touchend",this._onTouchEnd),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});be.addInitHook("addHandler","touchZoom",Zn),be.BoxZoom=bn,be.DoubleClickZoom=Tn,be.Drag=zn,be.Keyboard=Mn,be.ScrollWheelZoom=Cn,be.Tap=Sn,be.TouchZoom=Zn,Object.freeze=ti,t.version="1.4.0+HEAD.3337f36",t.Control=Te,t.control=ze,t.Browser=Qi,t.Evented=ci,t.Mixin=Be,t.Util=ui,t.Class=v,t.Handler=Ee,t.extend=i,t.bind=e,t.stamp=n,t.setOptions=l,t.DomEvent=Pe,t.DomUtil=ve,t.PosAnimation=Le,t.Draggable=Re,t.LineUtil=Ne,t.PolyUtil=De,t.Point=x,t.point=w,t.Bounds=P,t.bounds=b,t.Transformation=S,t.transformation=Z,t.Projection=He,t.LatLng=M,t.latLng=C,t.LatLngBounds=T,t.latLngBounds=z,t.CRS=di,t.GeoJSON=sn,t.geoJSON=Xt,t.geoJson=an,t.Layer=qe,t.LayerGroup=Ge,t.layerGroup=function(t,i){return new Ge(t,i)},t.FeatureGroup=Ke,t.featureGroup=function(t){return new Ke(t)},t.ImageOverlay=hn,t.imageOverlay=function(t,i,e){return new hn(t,i,e)},t.VideoOverlay=un,t.videoOverlay=function(t,i,e){return new un(t,i,e)},t.DivOverlay=ln,t.Popup=cn,t.popup=function(t,i){return new cn(t,i)},t.Tooltip=_n,t.tooltip=function(t,i){return new _n(t,i)},t.Icon=Ye,t.icon=function(t){return new Ye(t)},t.DivIcon=dn,t.divIcon=function(t){return new dn(t)},t.Marker=$e,t.marker=function(t,i){return new $e(t,i)},t.TileLayer=mn,t.tileLayer=Jt,t.GridLayer=pn,t.gridLayer=function(t){return new pn(t)},t.SVG=Pn,t.svg=Qt,t.Renderer=gn,t.Canvas=vn,t.canvas=$t,t.Path=Qe,t.CircleMarker=tn,t.circleMarker=function(t,i){return new tn(t,i)},t.Circle=en,t.circle=function(t,i,e){return new en(t,i,e)},t.Polyline=nn,t.polyline=function(t,i){return new nn(t,i)},t.Polygon=on,t.polygon=function(t,i){return new on(t,i)},t.Rectangle=Ln,t.rectangle=function(t,i){return new Ln(t,i)},t.Map=be,t.map=function(t,i){return new be(t,i)};var En=window.L;t.noConflict=function(){return window.L=En,this},window.L=t}); \ No newline at end of file +!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L={})}(this,function(t){"use strict";function h(t){for(var i,e,n=1,o=arguments.length;n=this.min.x&&e.x<=this.max.x&&i.y>=this.min.y&&e.y<=this.max.y},intersects:function(t){t=O(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>=i.x&&n.x<=e.x,r=o.y>=i.y&&n.y<=e.y;return s&&r},overlaps:function(t){t=O(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>i.x&&n.xi.y&&n.y=n.lat&&e.lat<=o.lat&&i.lng>=n.lng&&e.lng<=o.lng},intersects:function(t){t=N(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=i.lat&&n.lat<=e.lat,r=o.lng>=i.lng&&n.lng<=e.lng;return s&&r},overlaps:function(t){t=N(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>i.lat&&n.lati.lng&&n.lng';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}();function kt(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var Bt={ie:tt,ielt9:it,edge:et,webkit:nt,android:ot,android23:st,androidStock:at,opera:ht,chrome:ut,gecko:lt,safari:ct,phantom:_t,opera12:dt,win:pt,ie3d:mt,webkit3d:ft,gecko3d:gt,any3d:vt,mobile:yt,mobileWebkit:xt,mobileWebkit3d:wt,msPointer:Pt,pointer:Lt,touch:bt,mobileOpera:Tt,mobileGecko:Mt,retina:zt,passiveEvents:Ct,canvas:St,svg:Zt,vml:Et},At=Pt?"MSPointerDown":"pointerdown",It=Pt?"MSPointerMove":"pointermove",Ot=Pt?"MSPointerUp":"pointerup",Rt=Pt?"MSPointerCancel":"pointercancel",Nt={},Dt=!1;function jt(t,i,e,n){function o(t){Ut(t,r)}var s,r,a,h,u,l,c,_;function d(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Ut(t,h)}return"touchstart"===i?(u=t,l=e,c=n,_=p(function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Ri(t),Ut(t,l)}),u["_leaflet_touchstart"+c]=_,u.addEventListener(At,_,!1),Dt||(document.addEventListener(At,Wt,!0),document.addEventListener(It,Ht,!0),document.addEventListener(Ot,Ft,!0),document.addEventListener(Rt,Ft,!0),Dt=!0)):"touchmove"===i?(h=e,(a=t)["_leaflet_touchmove"+n]=d,a.addEventListener(It,d,!1)):"touchend"===i&&(r=e,(s=t)["_leaflet_touchend"+n]=o,s.addEventListener(Ot,o,!1),s.addEventListener(Rt,o,!1)),this}function Wt(t){Nt[t.pointerId]=t}function Ht(t){Nt[t.pointerId]&&(Nt[t.pointerId]=t)}function Ft(t){delete Nt[t.pointerId]}function Ut(t,i){for(var e in t.touches=[],Nt)t.touches.push(Nt[e]);t.changedTouches=[t],i(t)}var Vt=Pt?"MSPointerDown":Lt?"pointerdown":"touchstart",qt=Pt?"MSPointerUp":Lt?"pointerup":"touchend",Gt="_leaflet_";var Kt,Yt,Xt,Jt,$t,Qt,ti=fi(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ii=fi(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ei="webkitTransition"===ii||"OTransition"===ii?ii+"End":"transitionend";function ni(t){return"string"==typeof t?document.getElementById(t):t}function oi(t,i){var e,n=t.style[i]||t.currentStyle&&t.currentStyle[i];return n&&"auto"!==n||!document.defaultView||(n=(e=document.defaultView.getComputedStyle(t,null))?e[i]:null),"auto"===n?null:n}function si(t,i,e){var n=document.createElement(t);return n.className=i||"",e&&e.appendChild(n),n}function ri(t){var i=t.parentNode;i&&i.removeChild(t)}function ai(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function hi(t){var i=t.parentNode;i&&i.lastChild!==t&&i.appendChild(t)}function ui(t){var i=t.parentNode;i&&i.firstChild!==t&&i.insertBefore(t,i.firstChild)}function li(t,i){if(void 0!==t.classList)return t.classList.contains(i);var e=pi(t);return 0this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,i){this._enforcingBounds=!0;var e=this.getCenter(),n=this._limitCenter(e,this._zoom,N(t));return e.equals(n)||this.panTo(n,i),this._enforcingBounds=!1,this},panInside:function(t,i){var e,n,o=A((i=i||{}).paddingTopLeft||i.padding||[0,0]),s=A(i.paddingBottomRight||i.padding||[0,0]),r=this.getCenter(),a=this.project(r),h=this.project(t),u=this.getPixelBounds(),l=u.getSize().divideBy(2),c=O([u.min.add(o),u.max.subtract(s)]);return c.contains(h)||(this._enforcingBounds=!0,e=a.subtract(h),n=A(h.x+e.x,h.y+e.y),(h.xc.max.x)&&(n.x=a.x-e.x,0c.max.y)&&(n.y=a.y-e.y,0=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,i){for(var e,n=[],o="mouseout"===i||"mouseover"===i,s=t.target||t.srcElement,r=!1;s;){if((e=this._targets[m(s)])&&("click"===i||"preclick"===i)&&!t._simulated&&this._draggableMoved(e)){r=!0;break}if(e&&e.listens(i,!0)){if(o&&!Vi(s,t))break;if(n.push(e),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!Vi(s,t)||(n=[this]),n},_handleDOMEvent:function(t){var i;this._loaded&&!Ui(t)&&("mousedown"!==(i=t.type)&&"keypress"!==i&&"keyup"!==i&&"keydown"!==i||Pi(t.target||t.srcElement),this._fireDOMEvent(t,i))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,i,e){var n;if("click"===t.type&&((n=h({},t)).type="preclick",this._fireDOMEvent(n,n.type,e)),!t._stopped&&(e=(e||[]).concat(this._findEventTargets(t,i))).length){var o=e[0];"contextmenu"===i&&o.listens(i,!0)&&Ri(t);var s,r={originalEvent:t};"keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type&&(s=o.getLatLng&&(!o._radius||o._radius<=10),r.containerPoint=s?this.latLngToContainerPoint(o.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=s?o.getLatLng():this.layerPointToLatLng(r.layerPoint));for(var a=0;athis.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(i),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==e.animate&&!this.getSize().contains(o))&&(M(function(){this._moveStart(!0,!1)._animateZoom(t,i,!0)},this),!0)},_animateZoom:function(t,i,e,n){this._mapPane&&(e&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=i,ci(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:i,noUpdate:n}),setTimeout(p(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&_i(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),M(function(){this._moveEnd(!0)},this))}});function Yi(t){return new Xi(t)}var Xi=S.extend({options:{position:"topright"},initialize:function(t){c(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var i=this._map;return i&&i.removeControl(this),this.options.position=t,i&&i.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var i=this._container=this.onAdd(t),e=this.getPosition(),n=t._controlCorners[e];return ci(i,"leaflet-control"),-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(ri(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0",n=document.createElement("div");return n.innerHTML=e,n.firstChild},_addItem:function(t){var i,e=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((i=document.createElement("input")).type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=n):i=this._createRadioElement("leaflet-base-layers_"+m(this),n),this._layerControlInputs.push(i),i.layerId=m(t.layer),zi(i,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return e.appendChild(s),s.appendChild(i),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t,i,e=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=e.length-1;0<=s;s--)t=e[s],i=this._getLayer(t.layerId).layer,t.checked?n.push(i):t.checked||o.push(i);for(s=0;si.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),$i=Xi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var i="leaflet-control-zoom",e=si("div",i+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,i+"-in",e,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,i+"-out",e,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),e},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,i,e,n,o){var s=si("a",e,n);return s.innerHTML=t,s.href="#",s.title=i,s.setAttribute("role","button"),s.setAttribute("aria-label",i),Oi(s),zi(s,"click",Ni),zi(s,"click",o,this),zi(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,i="leaflet-disabled";_i(this._zoomInButton,i),_i(this._zoomOutButton,i),!this._disabled&&t._zoom!==t.getMinZoom()||ci(this._zoomOutButton,i),!this._disabled&&t._zoom!==t.getMaxZoom()||ci(this._zoomInButton,i)}});Ki.mergeOptions({zoomControl:!0}),Ki.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new $i,this.addControl(this.zoomControl))});var Qi=Xi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var i="leaflet-control-scale",e=si("div",i),n=this.options;return this._addScales(n,i+"-line",e),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),e},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,i,e){t.metric&&(this._mScale=si("div",i,e)),t.imperial&&(this._iScale=si("div",i,e))},_update:function(){var t=this._map,i=t.getSize().y/2,e=t.distance(t.containerPointToLatLng([0,i]),t.containerPointToLatLng([this.options.maxWidth,i]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var i=this._getRoundNum(t),e=i<1e3?i+" m":i/1e3+" km";this._updateScale(this._mScale,e,i/t)},_updateImperial:function(t){var i,e,n,o=3.2808399*t;5280Leaflet'},initialize:function(t){c(this,t),this._attributions={}},onAdd:function(t){for(var i in(t.attributionControl=this)._container=si("div","leaflet-control-attribution"),Oi(this._container),t._layers)t._layers[i].getAttribution&&this.addAttribution(t._layers[i].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t=[];for(var i in this._attributions)this._attributions[i]&&t.push(i);var e=[];this.options.prefix&&e.push(this.options.prefix),t.length&&e.push(t.join(", ")),this._container.innerHTML=e.join(" | ")}}});Ki.mergeOptions({attributionControl:!0}),Ki.addInitHook(function(){this.options.attributionControl&&(new te).addTo(this)});Xi.Layers=Ji,Xi.Zoom=$i,Xi.Scale=Qi,Xi.Attribution=te,Yi.layers=function(t,i,e){return new Ji(t,i,e)},Yi.zoom=function(t){return new $i(t)},Yi.scale=function(t){return new Qi(t)},Yi.attribution=function(t){return new te(t)};var ie=S.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}});ie.addTo=function(t,i){return t.addHandler(i,this),this};var ee,ne={Events:Z},oe=bt?"touchstart mousedown":"mousedown",se={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},re={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},ae=E.extend({options:{clickTolerance:3},initialize:function(t,i,e,n){c(this,n),this._element=t,this._dragStartTarget=i||t,this._preventOutline=e},enable:function(){this._enabled||(zi(this._dragStartTarget,oe,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ae._dragging===this&&this.finishDrag(),Si(this._dragStartTarget,oe,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var i,e;!t._simulated&&this._enabled&&(this._moved=!1,li(this._element,"leaflet-zoom-anim")||ae._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((ae._dragging=this)._preventOutline&&Pi(this._element),xi(),Xt(),this._moving||(this.fire("down"),i=t.touches?t.touches[0]:t,e=bi(this._element),this._startPoint=new k(i.clientX,i.clientY),this._parentScale=Ti(e),zi(document,re[t.type],this._onMove,this),zi(document,se[t.type],this._onUp,this))))},_onMove:function(t){var i,e;!t._simulated&&this._enabled&&(t.touches&&1i&&(e.push(t[n]),o=n);oi.max.x&&(e|=2),t.yi.max.y&&(e|=8),e}function de(t,i,e,n){var o,s=i.x,r=i.y,a=e.x-s,h=e.y-r,u=a*a+h*h;return 0this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()t.y!=n.y>t.y&&t.x<(n.x-e.x)*(t.y-e.y)/(n.y-e.y)+e.x&&(u=!u);return u||Oe.prototype._containsPoint.call(this,t,!0)}});var Ne=Ce.extend({initialize:function(t,i){c(this,i),this._layers={},t&&this.addData(t)},addData:function(t){var i,e,n,o=g(t)?t:t.features;if(o){for(i=0,e=o.length;iu.x&&(l=s.x+n-u.x+h.x),s.x-l-a.x<0&&(l=s.x-a.x),s.y+e+h.y>u.y&&(c=s.y+e-u.y+h.y),s.y-c-a.y<0&&(c=s.y-a.y),(l||c)&&t.fire("autopanstart").panBy([l,c]))},_onCloseButtonClick:function(t){this._close(),Ni(t)},_getAnchor:function(){return A(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Ki.mergeOptions({closePopupOnClick:!0}),Ki.include({openPopup:function(t,i,e){return t instanceof tn||(t=new tn(e).setContent(t)),i&&t.setLatLng(i),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Me.include({bindPopup:function(t,i){return t instanceof tn?(c(t,i),(this._popup=t)._source=this):(this._popup&&!i||(this._popup=new tn(i,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,i){return this._popup&&this._map&&(i=this._popup._prepareOpen(this,t,i),this._map.openPopup(this._popup,i)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var i=t.layer||t.target;this._popup&&this._map&&(Ni(t),i instanceof Be?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===i?this.closePopup():this.openPopup(i,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var en=Qe.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Qe.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Qe.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Qe.prototype.getEvents.call(this);return bt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=si("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var i,e=this._map,n=this._container,o=e.latLngToContainerPoint(e.getCenter()),s=e.layerPointToContainerPoint(t),r=this.options.direction,a=n.offsetWidth,h=n.offsetHeight,u=A(this.options.offset),l=this._getAnchor(),c="top"===r?(i=a/2,h):"bottom"===r?(i=a/2,0):(i="center"===r?a/2:"right"===r?0:"left"===r?a:s.xthis.options.maxZoom||nthis.options.maxZoom||void 0!==this.options.minZoom&&oe.max.x)||!i.wrapLat&&(t.ye.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return N(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var i=this._map,e=this.getTileSize(),n=t.scaleBy(e),o=n.add(e);return[i.unproject(n,t.z),i.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var i=this._tileCoordsToNwSe(t),e=new R(i[0],i[1]);return this.options.noWrap||(e=this._map.wrapLatLngBounds(e)),e},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var i=t.split(":"),e=new k(+i[0],+i[1]);return e.z=+i[2],e},_removeTile:function(t){var i=this._tiles[t];i&&(ri(i.el),delete this._tiles[t],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ci(t,"leaflet-tile");var i=this.getTileSize();t.style.width=i.x+"px",t.style.height=i.y+"px",t.onselectstart=a,t.onmousemove=a,it&&this.options.opacity<1&&mi(t,this.options.opacity),ot&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,i){var e=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),p(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&M(p(this._tileReady,this,t,null,o)),vi(o,e),this._tiles[n]={el:o,coords:t,current:!0},i.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,i,e){i&&this.fire("tileerror",{error:i,tile:e,coords:t});var n=this._tileCoordsToKey(t);(e=this._tiles[n])&&(e.loaded=+new Date,this._map._fadeAnimated?(mi(e.el,0),z(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this)):(e.active=!0,this._pruneTiles()),i||(ci(e.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:e.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),it||!this._map._fadeAnimated?M(this._pruneTiles,this):setTimeout(p(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var i=new k(this._wrapX?o(t.x,this._wrapX):t.x,this._wrapY?o(t.y,this._wrapY):t.y);return i.z=t.z,i},_pxBoundsToTileRange:function(t){var i=this.getTileSize();return new I(t.min.unscaleBy(i).floor(),t.max.unscaleBy(i).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var sn=on.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,i){this._url=t,(i=c(this,i)).detectRetina&&zt&&0')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_n={_initContainer:function(){this._container=si("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(hn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var i=t._container=cn("shape");ci(i,"leaflet-vml-shape "+(this.options.className||"")),i.coordsize="1 1",t._path=cn("path"),i.appendChild(t._path),this._updateStyle(t),this._layers[m(t)]=t},_addPath:function(t){var i=t._container;this._container.appendChild(i),t.options.interactive&&t.addInteractiveTarget(i)},_removePath:function(t){var i=t._container;ri(i),t.removeInteractiveTarget(i),delete this._layers[m(t)]},_updateStyle:function(t){var i=t._stroke,e=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(i=i||(t._stroke=cn("stroke")),o.appendChild(i),i.weight=n.weight+"px",i.color=n.color,i.opacity=n.opacity,n.dashArray?i.dashStyle=g(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):i.dashStyle="",i.endcap=n.lineCap.replace("butt","flat"),i.joinstyle=n.lineJoin):i&&(o.removeChild(i),t._stroke=null),n.fill?(e=e||(t._fill=cn("fill")),o.appendChild(e),e.color=n.fillColor||n.color,e.opacity=n.fillOpacity):e&&(o.removeChild(e),t._fill=null)},_updateCircle:function(t){var i=t._point.round(),e=Math.round(t._radius),n=Math.round(t._radiusY||e);this._setPath(t,t._empty()?"M0 0":"AL "+i.x+","+i.y+" "+e+","+n+" 0,23592600")},_setPath:function(t,i){t._path.v=i},_bringToFront:function(t){hi(t._container)},_bringToBack:function(t){ui(t._container)}},dn=Et?cn:J,pn=hn.extend({getEvents:function(){var t=hn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=dn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=dn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ri(this._container),Si(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){var t,i,e;this._map._animatingZoom&&this._bounds||(hn.prototype._update.call(this),i=(t=this._bounds).getSize(),e=this._container,this._svgSize&&this._svgSize.equals(i)||(this._svgSize=i,e.setAttribute("width",i.x),e.setAttribute("height",i.y)),vi(e,t.min),e.setAttribute("viewBox",[t.min.x,t.min.y,i.x,i.y].join(" ")),this.fire("update"))},_initPath:function(t){var i=t._path=dn("path");t.options.className&&ci(i,t.options.className),t.options.interactive&&ci(i,"leaflet-interactive"),this._updateStyle(t),this._layers[m(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ri(t._path),t.removeInteractiveTarget(t._path),delete this._layers[m(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var i=t._path,e=t.options;i&&(e.stroke?(i.setAttribute("stroke",e.color),i.setAttribute("stroke-opacity",e.opacity),i.setAttribute("stroke-width",e.weight),i.setAttribute("stroke-linecap",e.lineCap),i.setAttribute("stroke-linejoin",e.lineJoin),e.dashArray?i.setAttribute("stroke-dasharray",e.dashArray):i.removeAttribute("stroke-dasharray"),e.dashOffset?i.setAttribute("stroke-dashoffset",e.dashOffset):i.removeAttribute("stroke-dashoffset")):i.setAttribute("stroke","none"),e.fill?(i.setAttribute("fill",e.fillColor||e.color),i.setAttribute("fill-opacity",e.fillOpacity),i.setAttribute("fill-rule",e.fillRule||"evenodd")):i.setAttribute("fill","none"))},_updatePoly:function(t,i){this._setPath(t,$(t._parts,i))},_updateCircle:function(t){var i=t._point,e=Math.max(Math.round(t._radius),1),n="a"+e+","+(Math.max(Math.round(t._radiusY),1)||e)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(i.x-e)+","+i.y+n+2*e+",0 "+n+2*-e+",0 ";this._setPath(t,o)},_setPath:function(t,i){t._path.setAttribute("d",i)},_bringToFront:function(t){hi(t._path)},_bringToBack:function(t){ui(t._path)}});function mn(t){return Zt||Et?new pn(t):null}Et&&pn.include(_n),Ki.include({getRenderer:function(t){var i=(i=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer());return this.hasLayer(i)||this.addLayer(i),i},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var i=this._paneRenderers[t];return void 0===i&&(i=this._createRenderer({pane:t}),this._paneRenderers[t]=i),i},_createRenderer:function(t){return this.options.preferCanvas&&ln(t)||mn(t)}});var fn=Re.extend({initialize:function(t,i){Re.prototype.initialize.call(this,this._boundsToLatLngs(t),i)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=N(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});pn.create=dn,pn.pointsToPath=$,Ne.geometryToLayer=De,Ne.coordsToLatLng=We,Ne.coordsToLatLngs=He,Ne.latLngToCoords=Fe,Ne.latLngsToCoords=Ue,Ne.getFeature=Ve,Ne.asFeature=qe,Ki.mergeOptions({boxZoom:!0});var gn=ie.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){zi(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Si(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ri(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Xt(),xi(),this._startPoint=this._map.mouseEventToContainerPoint(t),zi(document,{contextmenu:Ni,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=si("div","leaflet-zoom-box",this._container),ci(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var i=new I(this._point,this._startPoint),e=i.getSize();vi(this._box,i.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(ri(this._box),_i(this._container,"leaflet-crosshair")),Jt(),wi(),Si(document,{contextmenu:Ni,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){var i;1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(p(this._resetState,this),0),i=new R(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(i).fire("boxzoomend",{boxZoomBounds:i})))},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});Ki.addInitHook("addHandler","boxZoom",gn),Ki.mergeOptions({doubleClickZoom:!0});var vn=ie.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var i=this._map,e=i.getZoom(),n=i.options.zoomDelta,o=t.originalEvent.shiftKey?e-n:e+n;"center"===i.options.doubleClickZoom?i.setZoom(o):i.setZoomAround(t.containerPoint,o)}});Ki.addInitHook("addHandler","doubleClickZoom",vn),Ki.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var yn=ie.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new ae(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),ci(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){_i(this._map._container,"leaflet-grab"),_i(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,i=this._map;i._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=N(this._map.options.maxBounds),this._offsetLimit=O(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,i.fire("movestart").fire("dragstart"),i.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var i,e;this._map.options.inertia&&(i=this._lastTime=+new Date,e=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(e),this._times.push(i),this._prunePositions(i)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1i.max.x&&(t.x=this._viscousLimit(t.x,i.max.x)),t.y>i.max.y&&(t.y=this._viscousLimit(t.y,i.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,i=Math.round(t/2),e=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-i+e)%t+i-e,s=(n+i+e)%t-i-e,r=Math.abs(o+e)i.getMaxZoom()&&1id, sp_get_screen_ids() ) ) { - wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.4.0' ); - wp_enqueue_style( 'control-geocoder', SP()->plugin_url() . '/assets/css/Control.Geocoder.css', array() ); + wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.7.1' ); + wp_enqueue_style( 'control-geocoder', SP()->plugin_url() . '/assets/css/Control.Geocoder.css', array(), '1.13.0' ); } if ( in_array( $screen->id, sp_get_screen_ids() ) ) { - wp_register_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.4.0' ); - wp_register_script( 'control-geocoder', SP()->plugin_url() . '/assets/js/Control.Geocoder.js', array( 'leaflet_js' ) ); + wp_register_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.7.1' ); + wp_register_script( 'control-geocoder', SP()->plugin_url() . '/assets/js/Control.Geocoder.min.js', array( 'leaflet_js' ), '1.13.0' ); wp_register_script( 'sportspress-admin-geocoder', SP()->plugin_url() . '/assets/js/admin/sp-geocoder.js', array( 'leaflet_js', 'control-geocoder' ), SP_VERSION, true ); } @@ -98,8 +98,8 @@ if ( ! class_exists( 'SportsPress_OpenStreetMap' ) ): public function frontend_venue_scripts() { global $post; if( is_tax('sp_venue') || is_singular('sp_event') || ( isset( $post->post_content ) && sp_has_shortcodes( $post->post_content, array('event_full', 'event_venue') ) ) ) { - wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.4.0' ); - wp_enqueue_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.4.0' ); + wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.7.1' ); + wp_enqueue_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.7.1' ); } } @@ -163,11 +163,11 @@ if ( ! class_exists( 'SportsPress_OpenStreetMap' ) ): * Print geocoder script in setup */ public function setup_geocoder_scripts() { - wp_register_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.4.0' ); - wp_register_script( 'control-geocoder', SP()->plugin_url() . '/assets/js/Control.Geocoder.js', array( 'leaflet_js' ) ); + wp_register_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.7.1' ); + wp_register_script( 'control-geocoder', SP()->plugin_url() . '/assets/js/Control.Geocoder.min.js', array( 'leaflet_js' ), '1.13.0' ); wp_register_script( 'sportspress-admin-setup-geocoder', SP()->plugin_url() . '/assets/js/admin/sp-setup-geocoder.js', array( 'leaflet_js', 'control-geocoder' ), SP_VERSION, true ); - wp_enqueue_style( 'control-geocoder', SP()->plugin_url() . '/assets/css/Control.Geocoder.css', array() ); - wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.4.0' ); + wp_enqueue_style( 'control-geocoder', SP()->plugin_url() . '/assets/css/Control.Geocoder.css', array(), '1.13.0' ); + wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.7.1' ); } /**