/*! waymark-js 14-01-2020 */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.L={})}(this,function(t){var e=Object.freeze;function l(t){var e,i,n,o;for(i=1,n=arguments.length;i=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=I(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,a=o.y>=e.y&&n.y<=i.y;return s&&a},overlaps:function(t){t=I(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.xe.y&&n.y=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=R(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,a=o.lng>=e.lng&&n.lng<=i.lng;return s&&a},overlaps:function(t){t=R(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.late.lng&&n.lng';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function Dt(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var Bt=(Object.freeze||Object)({ie:et,ielt9:it,edge:nt,webkit:ot,android:st,android23:at,androidStock:lt,opera:ht,chrome:ut,gecko:ct,safari:dt,phantom:pt,opera12:_t,win:mt,ie3d:ft,webkit3d:gt,gecko3d:vt,any3d:yt,mobile:wt,mobileWebkit:Lt,mobileWebkit3d:kt,msPointer:xt,pointer:bt,touch:Pt,mobileOpera:Mt,mobileGecko:Ct,retina:Tt,canvas:Et,svg:St,vml:zt}),Ot=xt?"MSPointerDown":"pointerdown",At=xt?"MSPointerMove":"pointermove",Wt=xt?"MSPointerUp":"pointerup",It=xt?"MSPointerCancel":"pointercancel",Zt=["INPUT","SELECT","OPTION"],Rt={},Ft=!1,Nt=0;function jt(t){Rt[t.pointerId]=t,Nt++}function Ut(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function Vt(t){delete Rt[t.pointerId],Nt--}function Gt(t,e){for(var i in t.touches=[],Rt)t.touches.push(Rt[i]);t.changedTouches=[t],e(t)}var Ht=xt?"MSPointerDown":bt?"pointerdown":"touchstart",qt=xt?"MSPointerUp":bt?"pointerup":"touchend",Qt="_leaflet_";var Kt,Jt,Xt,Yt,$t,te=fe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ee=fe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ie="webkitTransition"===ee||"OTransition"===ee?ee+"End":"transitionend";function ne(t){return"string"==typeof t?document.getElementById(t):t}function oe(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function se(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ae(t){var e=t.parentNode;e&&e.removeChild(t)}function re(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function le(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function he(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ue(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=_e(t);return 0this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,R(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=A((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=A(e.paddingBottomRight||e.padding||[0,0]),o=this.getCenter(),s=this.project(o),a=this.project(t),r=this.getPixelBounds(),l=r.getSize().divideBy(2),h=I([r.min.add(i),r.max.subtract(n)]);if(!h.contains(a)){this._enforcingBounds=!0;var u=s.subtract(a),c=A(a.x+u.x,a.y+u.y);(a.xh.max.x)&&(c.x=s.x-u.x,0h.max.y)&&(c.y=s.y-u.y,0=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,a=!1;s;){if((i=this._targets[h(s)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(o&&!Ge(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n.length||a||o||!Ge(s,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!Ve(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||xe(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var n=l({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var o=i[0];"contextmenu"===e&&o.listens(e,!0)&&We(t);var s={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=o.getLatLng&&(!o._radius||o._radius<=10);s.containerPoint=a?this.latLngToContainerPoint(o.getLatLng()):this.mouseEventToContainerPoint(t),s.layerPoint=this.containerPointToLayerPoint(s.containerPoint),s.latlng=a?o.getLatLng():this.layerPointToLatLng(s.layerPoint)}for(var r=0;rthis.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(C(function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)},this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ce(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),setTimeout(_(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&de(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),C(function(){this._moveEnd(!0)},this))}});function Ke(t){return new Je(t)}var Je=S.extend({options:{position:"topright"},initialize:function(t){p(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return ce(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(ae(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=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+h(this),n),this._layerControlInputs.push(e),e.layerId=h(t.layer),Te(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;0<=s;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;se.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),Ye=Je.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=se("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},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,e,i,n,o){var s=se("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Ae(s),Te(s,"click",Ie),Te(s,"click",o,this),Te(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";de(this._zoomInButton,e),de(this._zoomOutButton,e),!this._disabled&&t._zoom!==t.getMinZoom()||ce(this._zoomOutButton,e),!this._disabled&&t._zoom!==t.getMaxZoom()||ce(this._zoomInButton,e)}});Qe.mergeOptions({zoomControl:!0}),Qe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ye,this.addControl(this.zoomControl))});var $e=Je.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=se("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.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,e,i){t.metric&&(this._mScale=se("div",e,i)),t.imperial&&(this._iScale=se("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;5280Leaflet'},initialize:function(t){p(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=se("div","leaflet-control-attribution"),Ae(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].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 e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});Qe.mergeOptions({attributionControl:!0}),Qe.addInitHook(function(){this.options.attributionControl&&(new ti).addTo(this)}),Je.Layers=Xe,Je.Zoom=Ye,Je.Scale=$e,Je.Attribution=ti,Ke.layers=function(t,e,i){return new Xe(t,e,i)},Ke.zoom=function(t){return new Ye(t)},Ke.scale=function(t){return new $e(t)},Ke.attribution=function(t){return new ti(t)};var ei=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}});ei.addTo=function(t,e){return t.addHandler(e,this),this};var ii,ni={Events:z},oi=Pt?"touchstart mousedown":"mousedown",si={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},ai={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},ri=D.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){p(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Te(this._dragStartTarget,oi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ri._dragging===this&&this.finishDrag(),Se(this._dragStartTarget,oi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!ue(this._element,"leaflet-zoom-anim")&&!(ri._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((ri._dragging=this)._preventOutline&&xe(this._element),Le(),Kt(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Pe(this._element);this._startPoint=new B(e.clientX,e.clientY),this._parentScale=Me(i),Te(document,ai[t.type],this._onMove,this),Te(document,si[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&1e.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function pi(t,e,i,n){var o,s=e.x,a=e.y,r=i.x-s,l=i.y-a,h=r*r+l*l;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-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(h=!h);return h||Wi.prototype._containsPoint.call(this,t,!0)}}),Zi=Ti.extend({initialize:function(t,e){p(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=v(t)?t:t.features;if(o){for(e=0,i=o.length;eh.x&&(u=s.x+n-h.x+l.x),s.x-u-r.x<0&&(u=s.x-r.x),s.y+i+l.y>h.y&&(c=s.y+i-h.y+l.y),s.y-c-r.y<0&&(c=s.y-r.y),(u||c)&&t.fire("autopanstart").panBy([u,c])}},_onCloseButtonClick:function(t){this._close(),Ie(t)},_getAnchor:function(){return A(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Qe.mergeOptions({closePopupOnClick:!0}),Qe.include({openPopup:function(t,e,i){return t instanceof $i||(t=new $i(i).setContent(t)),e&&t.setLatLng(e),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}}),Mi.include({bindPopup:function(t,e){return t instanceof $i?(p(t,e),(this._popup=t)._source=this):(this._popup&&!e||(this._popup=new $i(e,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,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),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 e=t.layer||t.target;this._popup&&this._map&&(Ie(t),e instanceof Bi?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var tn=Yi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Yi.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){Yi.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Yi.prototype.getEvents.call(this);return Pt&&!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=se("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e=this._map,i=this._container,n=e.latLngToContainerPoint(e.getCenter()),o=e.layerPointToContainerPoint(t),s=this.options.direction,a=i.offsetWidth,r=i.offsetHeight,l=A(this.options.offset),h=this._getAnchor();t="top"===s?t.add(A(-a/2+l.x,-r+l.y+h.y,!0)):"bottom"===s?t.subtract(A(a/2-l.x,-l.y,!0)):"center"===s?t.subtract(A(a/2+l.x,r/2-h.y+l.y,!0)):"right"===s||"auto"===s&&o.xthis.options.maxZoom||ithis.options.maxZoom||void 0!==this.options.minZoom&&oi.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return R(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new Z(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new B(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ae(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ce(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=r,t.onmousemove=r,it&&this.options.opacity<1&&me(t,this.options.opacity),st&&!at&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),_(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&C(_(this._tileReady,this,t,null,o)),ve(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(me(i.el,0),T(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(ce(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),it||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(_(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new B(this._wrapX?a(t.x,this._wrapX):t.x,this._wrapY?a(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new W(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),on=nn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=p(this,e)).detectRetina&&Tt&&0')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),cn={_initContainer:function(){this._container=se("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(rn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=un("shape");ce(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=un("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ae(e),t.removeInteractiveTarget(e),delete this._layers[h(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e=e||(t._stroke=un("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=v(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i=i||(t._fill=un("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){le(t._container)},_bringToBack:function(t){he(t._container)}},dn=zt?un:Y,pn=rn.extend({getEvents:function(){var t=rn.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(){ae(this._container),Se(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){rn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),ve(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=dn("path");t.options.className&&ce(e,t.options.className),t.options.interactive&&ce(e,"leaflet-interactive"),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ae(t._path),t.removeInteractiveTarget(t._path),delete this._layers[h(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,$(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){le(t._path)},_bringToBack:function(t){he(t._path)}});function _n(t){return St||zt?new pn(t):null}zt&&pn.include(cn),Qe.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e=e||(this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&hn(t)||_n(t)}});var mn=Ii.extend({initialize:function(t,e){Ii.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=R(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});pn.create=dn,pn.pointsToPath=$,Zi.geometryToLayer=Ri,Zi.coordsToLatLng=Fi,Zi.coordsToLatLngs=Ni,Zi.latLngToCoords=ji,Zi.latLngsToCoords=Ui,Zi.getFeature=Vi,Zi.asFeature=Gi,Qe.mergeOptions({boxZoom:!0});var fn=ei.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(){Te(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Se(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ae(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(),Kt(),Le(),this._startPoint=this._map.mouseEventToContainerPoint(t),Te(document,{contextmenu:Ie,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=se("div","leaflet-zoom-box",this._container),ce(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new W(this._point,this._startPoint),i=e.getSize();ve(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ae(this._box),de(this._container,"leaflet-crosshair")),Jt(),ke(),Se(document,{contextmenu:Ie,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(_(this._resetState,this),0);var e=new Z(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});Qe.addInitHook("addHandler","boxZoom",fn),Qe.mergeOptions({doubleClickZoom:!0});var gn=ei.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});Qe.addInitHook("addHandler","doubleClickZoom",gn),Qe.mergeOptions({dragging:!0,inertia:!at,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var vn=ei.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new ri(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))}ce(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){de(this._map._container,"leaflet-grab"),de(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 e=R(this._map.options.maxBounds);this._offsetLimit=I(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.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 e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)e.getMaxZoom()&&1"'`]/g,s=/[&<>"'`]/,e={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};function a(t){return e[t]}function i(t,e,i,n,o){var s="_l_geocoder_"+r++;e[o||"callback"]=s,window[s]=u.Util.bind(i,n);var a=document.createElement("script");a.type="text/javascript",a.src=t+l(e),a.id=s,document.getElementsByTagName("head")[0].appendChild(a)}function c(t,e,i){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){var e;if(200!==n.status&&304!==n.status)e="";else if("string"==typeof n.response)try{e=JSON.parse(n.response)}catch(t){e=n.response}else e=n.response;i(e)}},n.open("GET",t+l(e),!0),n.responseType="json",n.setRequestHeader("Accept","application/json"),n.send(null)}function n(t,n){return t.replace(/\{ *([\w_]+) *\}/g,function(t,e){var i=n[e];return void 0===i?i="":"function"==typeof i&&(i=i(n)),function(t){return null==t?"":t?(t=""+t,s.test(t)?t.replace(o,a):t):t+""}(i)})}function l(t,e,i){var n=[];for(var o in t){var s=encodeURIComponent(i?o.toUpperCase():o),a=t[o];if(u.Util.isArray(a))for(var r=0;r",app_code:"",geocodingQueryParams:{},reverseQueryParams:{},reverseGeocodeProxRadius:null},initialize:function(t){u.setOptions(this,t)},geocode:function(t,e,i){var n={searchtext:t,gen:9,app_id:this.options.app_id,app_code:this.options.app_code,jsonattributes:1};n=u.Util.extend(n,this.options.geocodingQueryParams),this.getJSON(this.options.geocodeUrl,n,e,i)},reverse:function(t,e,i,n){var o=this.options.reverseGeocodeProxRadius?this.options.reverseGeocodeProxRadius:null,s=o?","+encodeURIComponent(o):"",a={prox:encodeURIComponent(t.lat)+","+encodeURIComponent(t.lng)+s,mode:"retrieveAddresses",app_id:this.options.app_id,app_code:this.options.app_code,gen:9,jsonattributes:1};a=u.Util.extend(a,this.options.reverseQueryParams),this.getJSON(this.options.reverseGeocodeUrl,a,i,n)},getJSON:function(t,e,a,r){c(t,e,function(t){var e,i,n,o=[];if(t.response.view&&t.response.view.length)for(var s=0;s<=t.response.view[0].result.length-1;s++)e=t.response.view[0].result[s].location,i=u.latLng(e.displayPosition.latitude,e.displayPosition.longitude),n=u.latLngBounds(u.latLng(e.mapView.topLeft.latitude,e.mapView.topLeft.longitude),u.latLng(e.mapView.bottomRight.latitude,e.mapView.bottomRight.longitude)),o[s]={name:e.address.label,bbox:n,center:i};a.call(r,o)})}});var m=u.Class.extend({options:{next:void 0,sizeInMeters:1e4},initialize:function(t){u.Util.setOptions(this,t)},geocode:function(t,e,i){var n,o;if((n=t.match(/^([NS])\s*(\d{1,3}(?:\.\d*)?)\W*([EW])\s*(\d{1,3}(?:\.\d*)?)$/))?o=u.latLng((/N/i.test(n[1])?1:-1)*parseFloat(n[2]),(/E/i.test(n[3])?1:-1)*parseFloat(n[4])):(n=t.match(/^(\d{1,3}(?:\.\d*)?)\s*([NS])\W*(\d{1,3}(?:\.\d*)?)\s*([EW])$/))?o=u.latLng((/N/i.test(n[2])?1:-1)*parseFloat(n[1]),(/E/i.test(n[4])?1:-1)*parseFloat(n[3])):(n=t.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?$/))?o=u.latLng((/N/i.test(n[1])?1:-1)*(parseFloat(n[2])+parseFloat(n[3]/60)),(/E/i.test(n[4])?1:-1)*(parseFloat(n[5])+parseFloat(n[6]/60))):(n=t.match(/^(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([NS])\W*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([EW])$/))?o=u.latLng((/N/i.test(n[3])?1:-1)*(parseFloat(n[1])+parseFloat(n[2]/60)),(/E/i.test(n[6])?1:-1)*(parseFloat(n[4])+parseFloat(n[5]/60))):(n=t.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*)?)?["″]?$/))?o=u.latLng((/N/i.test(n[1])?1:-1)*(parseFloat(n[2])+parseFloat(n[3]/60+parseFloat(n[4]/3600))),(/E/i.test(n[5])?1:-1)*(parseFloat(n[6])+parseFloat(n[7]/60)+parseFloat(n[8]/3600))):(n=t.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])$/))?o=u.latLng((/N/i.test(n[4])?1:-1)*(parseFloat(n[1])+parseFloat(n[2]/60+parseFloat(n[3]/3600))),(/E/i.test(n[8])?1:-1)*(parseFloat(n[5])+parseFloat(n[6]/60)+parseFloat(n[7]/3600))):(n=t.match(/^\s*([+-]?\d+(?:\.\d*)?)\s*[\s,]\s*([+-]?\d+(?:\.\d*)?)\s*$/))&&(o=u.latLng(parseFloat(n[1]),parseFloat(n[2]))),o){var s=[{name:t,center:o,bbox:o.toBounds(this.options.sizeInMeters)}];e.call(i,s)}else this.options.next&&this.options.next.geocode(t,e,i)}});var f=u.Class.extend({options:{serviceUrl:"https://api.mapbox.com/geocoding/v5/mapbox.places/",geocodingQueryParams:{},reverseQueryParams:{}},initialize:function(t,e){u.setOptions(this,e),this.options.geocodingQueryParams.access_token=t,this.options.reverseQueryParams.access_token=t},geocode:function(t,l,h){var e=this.options.geocodingQueryParams;void 0!==e.proximity&&void 0!==e.proximity.lat&&void 0!==e.proximity.lng&&(e.proximity=e.proximity.lng+","+e.proximity.lat),c(this.options.serviceUrl+encodeURIComponent(t)+".json",e,function(t){var e,i,n,o=[];if(t.features&&t.features.length)for(var s=0;s<=t.features.length-1;s++){e=t.features[s],i=u.latLng(e.center.reverse()),n=e.bbox?u.latLngBounds(u.latLng(e.bbox.slice(0,2).reverse()),u.latLng(e.bbox.slice(2,4).reverse())):u.latLngBounds(i,i);for(var a={text:e.text,address:e.address},r=0;r<(e.context||[]).length;r++){a[e.context[r].id.split(".")[0]]=e.context[r].text}o[s]={name:e.place_name,bbox:n,center:i,properties:a}}l.call(h,o)})},suggest:function(t,e,i){return this.geocode(t,e,i)},reverse:function(t,e,a,r){c(this.options.serviceUrl+encodeURIComponent(t.lng)+","+encodeURIComponent(t.lat)+".json",this.options.reverseQueryParams,function(t){var e,i,n,o=[];if(t.features&&t.features.length)for(var s=0;s<=t.features.length-1;s++)e=t.features[s],i=u.latLng(e.center.reverse()),n=e.bbox?u.latLngBounds(u.latLng(e.bbox.slice(0,2).reverse()),u.latLng(e.bbox.slice(2,4).reverse())):u.latLngBounds(i,i),o[s]={name:e.place_name,bbox:n,center:i};a.call(r,o)})}});var g=u.Class.extend({options:{serviceUrl:"https://www.mapquestapi.com/geocoding/v1"},initialize:function(t,e){this._key=decodeURIComponent(t),u.Util.setOptions(this,e)},_formatName:function(){var t,e=[];for(t=0;t",apiKey:"",serviceUrl:"https://neutrinoapi.com/"},initialize:function(t){u.Util.setOptions(this,t)},geocode:function(t,o,s){c(this.options.serviceUrl+"geocode-address",{apiKey:this.options.apiKey,userId:this.options.userId,address:t.split(/\s+/).join(".")},function(t){var e,i,n=[];t.locations&&(t.geometry=t.locations[0],e=u.latLng(t.geometry.latitude,t.geometry.longitude),i=u.latLngBounds(e,e),n[0]={name:t.geometry.address,bbox:i,center:e}),o.call(s,n)})},suggest:function(t,e,i){return this.geocode(t,e,i)},reverse:function(o,t,s,a){c(this.options.serviceUrl+"geocode-reverse",{apiKey:this.options.apiKey,userId:this.options.userId,latitude:o.lat,longitude:o.lng},function(t){var e,i,n=[];200==t.status.status&&t.found&&(e=u.latLng(o.lat,o.lng),i=u.latLngBounds(e,e),n[0]={name:t.address,bbox:i,center:e}),s.call(a,n)})}});var y=u.Class.extend({options:{serviceUrl:"https://nominatim.openstreetmap.org/",geocodingQueryParams:{},reverseQueryParams:{},htmlTemplate:function(t){var e=t.address,i=[];return(e.road||e.building)&&i.push("{building} {road} {house_number}"),(e.city||e.town||e.village||e.hamlet)&&i.push('{postcode} {city} {town} {village} {hamlet}'),(e.state||e.country)&&i.push('{state} {country}'),n(i.join("
"),e)}},initialize:function(t){u.Util.setOptions(this,t)},geocode:function(t,s,a){c(this.options.serviceUrl+"search",u.extend({q:t,limit:5,format:"json",addressdetails:1},this.options.geocodingQueryParams),u.bind(function(t){for(var e=[],i=t.length-1;0<=i;i--){for(var n=t[i].boundingbox,o=0;o<4;o++)n[o]=parseFloat(n[o]);e[i]={icon:t[i].icon,name:t[i].display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(t[i]):void 0,bbox:u.latLngBounds([n[0],n[2]],[n[1],n[3]]),center:u.latLng(t[i].lat,t[i].lon),properties:t[i]}}s.call(a,e)},this))},reverse:function(t,e,n,o){c(this.options.serviceUrl+"reverse",u.extend({lat:t.lat,lon:t.lng,zoom:Math.round(Math.log(e/256)/Math.log(2)),addressdetails:1,format:"json"},this.options.reverseQueryParams),u.bind(function(t){var e,i=[];t&&t.lat&&t.lon&&(e=u.latLng(t.lat,t.lon),i.push({name:t.display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(t):void 0,center:e,bounds:u.latLngBounds(e,e),properties:t})),n.call(o,i)},this))}});var w=u.Class.extend({options:{OpenLocationCode:void 0,codeLength:void 0},initialize:function(t){u.setOptions(this,t)},geocode:function(t,e,i){try{var n=this.options.OpenLocationCode.decode(t),o={name:t,center:u.latLng(n.latitudeCenter,n.longitudeCenter),bbox:u.latLngBounds(u.latLng(n.latitudeLo,n.longitudeLo),u.latLng(n.latitudeHi,n.longitudeHi))};e.call(i,[o])}catch(t){console.warn(t),e.call(i,[])}},reverse:function(t,e,i,n){try{var o={name:this.options.OpenLocationCode.encode(t.lat,t.lng,this.options.codeLength),center:u.latLng(t.lat,t.lng),bbox:u.latLngBounds(u.latLng(t.lat,t.lng),u.latLng(t.lat,t.lng))};i.call(n,[o])}catch(t){console.warn(t),i.call(n,[])}}});var L=u.Class.extend({options:{serviceUrl:"https://api.opencagedata.com/geocode/v1/json"},initialize:function(t){this._accessToken=t},geocode:function(t,a,r){c(this.options.serviceUrl,{key:this._accessToken,q:t},function(t){var e,i,n,o=[];if(t.results&&t.results.length)for(var s=0;sthis._lastSuggest&&(this._lastSuggest=t.geocoding.timestamp,e.call(i,n._parseResults(t,"bbox")))},this))},reverse:function(t,e,i,n){var o=this;c(this.options.serviceUrl+"/reverse",u.extend({api_key:this._apiKey,"point.lat":t.lat,"point.lon":t.lng},this.options.reverseQueryParams),function(t){i.call(n,o._parseResults(t,"bounds"))})},_parseResults:function(t,s){var a=[];return u.geoJson(t,{pointToLayer:function(t,e){return u.circleMarker(e)},onEachFeature:function(t,e){var i,n,o={};e.getBounds?n=(i=e.getBounds()).getCenter():i=e.feature.bbox?(n=e.getLatLng(),u.latLngBounds(u.GeoJSON.coordsToLatLng(e.feature.bbox.slice(0,2)),u.GeoJSON.coordsToLatLng(e.feature.bbox.slice(2,4)))):(n=e.getLatLng(),u.latLngBounds(n,n)),o.name=e.feature.properties.label,o.center=n,o[s]=i,o.properties=e.feature.properties,a.push(o)}}),a}});function t(t,e){return new k(t,e)}var x=k,b=t,P=k,M=t,C=P.extend({options:{serviceUrl:"https://api.openrouteservice.org/geocode"}});var T=u.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(t){u.setOptions(this,t)},geocode:function(t,e,i){var n=u.extend({q:t},this.options.geocodingQueryParams);c(this.options.serviceUrl,n,u.bind(function(t){e.call(i,this._decodeFeatures(t))},this))},suggest:function(t,e,i){return this.geocode(t,e,i)},reverse:function(t,e,i,n){var o=u.extend({lat:t.lat,lon:t.lng},this.options.reverseQueryParams);c(this.options.reverseUrl,o,u.bind(function(t){i.call(n,this._decodeFeatures(t))},this))},_decodeFeatures:function(t){var e,i,n,o,s,a,r=[];if(t&&t.features)for(e=0;e=this.options.suggestMinLength?this._suggestTimeout=setTimeout(u.bind(function(){this._geocode(!0)},this),this.options.suggestTimeout):this._clearResults())}});return u.Util.extend(z,S),u.Util.extend(u.Control,{Geocoder:z,geocoder:function(t){return new z(t)}}),z}(L),function(t,e){"function"==typeof define&&define.amd?define(["leaflet"],t):"object"==typeof exports&&(void 0!==e&&e.L?module.exports=t(L):module.exports=t(require("leaflet"))),void 0!==e&&e.L&&(e.L.Control.Locate=t(L))}(function(r){function i(e,i,t){(t=t.split(" ")).forEach(function(t){r.DomUtil[e].call(this,i,t)})}function e(t,e){i("addClass",t,e)}function n(t,e){i("removeClass",t,e)}var t=r.Marker.extend({initialize:function(t,e){r.Util.setOptions(this,e),this._latlng=t,this.createIcon()},createIcon:function(){var t=this.options,e="";void 0!==t.color&&(e+="stroke:"+t.color+";"),void 0!==t.weight&&(e+="stroke-width:"+t.weight+";"),void 0!==t.fillColor&&(e+="fill:"+t.fillColor+";"),void 0!==t.fillOpacity&&(e+="fill-opacity:"+t.fillOpacity+";"),void 0!==t.opacity&&(e+="opacity:"+t.opacity+";");var i=this._getIconSVG(t,e);this._locationIcon=r.divIcon({className:i.className,html:i.svg,iconSize:[i.w,i.h]}),this.setIcon(this._locationIcon)},_getIconSVG:function(t,e){var i=t.radius,n=i+t.weight,o=2*n;return{className:"leaflet-control-locate-location",svg:'',w:o,h:o}},setStyle:function(t){r.Util.setOptions(this,t),this.createIcon()}}),o=t.extend({initialize:function(t,e,i){r.Util.setOptions(this,i),this._latlng=t,this._heading=e,this.createIcon()},setHeading:function(t){this._heading=t},_getIconSVG:function(t,e){var i=t.radius,n=t.width+t.weight,o=2*(i+t.depth+t.weight),s="M0,0 l"+t.width/2+","+t.depth+" l-"+n+",0 z";return{className:"leaflet-control-locate-heading",svg:'',w:n,h:o}}}),s=r.Control.extend({options:{position:"topleft",layer:void 0,setView:"untilPanOrZoom",keepCurrentZoomLevel:!1,getLocationBounds:function(t){return t.bounds},flyTo:!1,clickBehavior:{inView:"stop",outOfView:"setView",inViewNotFollowing:"inView"},returnToPrevBounds:!1,cacheLocation:!0,drawCircle:!0,drawMarker:!0,showCompass:!0,markerClass:t,compassClass:o,circleStyle:{className:"leaflet-control-locate-circle",color:"#136AEC",fillColor:"#136AEC",fillOpacity:.15,weight:0},markerStyle:{className:"leaflet-control-locate-marker",color:"#fff",fillColor:"#2A93EE",fillOpacity:1,weight:3,opacity:1,radius:9},compassStyle:{fillColor:"#2A93EE",fillOpacity:1,weight:0,color:"#fff",opacity:1,radius:9,width:9,depth:6},followCircleStyle:{},followMarkerStyle:{},followCompassStyle:{},icon:"fa fa-map-marker",iconLoading:"fa fa-spinner fa-spin",iconElementTag:"span",circlePadding:[0,0],metric:!0,createButtonCallback:function(t,e){var i=r.DomUtil.create("a","leaflet-bar-part leaflet-bar-part-single",t);return i.title=e.strings.title,{link:i,icon:r.DomUtil.create(e.iconElementTag,e.icon,i)}},onLocationError:function(t,e){alert(t.message)},onLocationOutsideMapBounds:function(t){t.stop(),alert(t.options.strings.outsideMapBoundsMsg)},showPopup:!0,strings:{title:"Show me where I am",metersUnit:"meters",feetUnit:"feet",popup:"You are within {distance} {unit} from this point",outsideMapBoundsMsg:"You seem located outside the boundaries of the map"},locateOptions:{maxZoom:1/0,watch:!0,setView:!1}},initialize:function(t){for(var e in t)"object"==typeof this.options[e]?r.extend(this.options[e],t[e]):this.options[e]=t[e];this.options.followMarkerStyle=r.extend({},this.options.markerStyle,this.options.followMarkerStyle),this.options.followCircleStyle=r.extend({},this.options.circleStyle,this.options.followCircleStyle),this.options.followCompassStyle=r.extend({},this.options.compassStyle,this.options.followCompassStyle)},onAdd:function(t){var e=r.DomUtil.create("div","leaflet-control-locate leaflet-bar leaflet-control");this._layer=this.options.layer||new r.LayerGroup,this._layer.addTo(t),this._event=void 0,this._compassHeading=null,this._prevBounds=null;var i=this.options.createButtonCallback(e,this.options);return this._link=i.link,this._icon=i.icon,r.DomEvent.on(this._link,"click",r.DomEvent.stopPropagation).on(this._link,"click",r.DomEvent.preventDefault).on(this._link,"click",this._onClick,this).on(this._link,"dblclick",r.DomEvent.stopPropagation),this._resetVariables(),this._map.on("unload",this._unload,this),e},_onClick:function(){this._justClicked=!0;var t=this._isFollowing();if(this._userPanned=!1,this._userZoomed=!1,this._active&&!this._event)this.stop();else if(this._active&&void 0!==this._event){var e=this.options.clickBehavior,i=e.outOfView;switch(this._map.getBounds().contains(this._event.latlng)&&(i=t?e.inView:e.inViewNotFollowing),e[i]&&(i=e[i]),i){case"setView":this.setView();break;case"stop":this.stop(),this.options.returnToPrevBounds&&(this.options.flyTo?this._map.flyToBounds:this._map.fitBounds).bind(this._map)(this._prevBounds)}}else this.options.returnToPrevBounds&&(this._prevBounds=this._map.getBounds()),this.start();this._updateContainerStyle()},start:function(){this._activate(),this._event&&(this._drawMarker(this._map),this.options.setView&&this.setView()),this._updateContainerStyle()},stop:function(){this._deactivate(),this._cleanClasses(),this._resetVariables(),this._removeMarker()},stopFollowing:function(){this._userPanned=!0,this._updateContainerStyle(),this._drawMarker()},_activate:function(){this._active||(this._map.locate(this.options.locateOptions),this._active=!0,this._map.on("locationfound",this._onLocationFound,this),this._map.on("locationerror",this._onLocationError,this),this._map.on("dragstart",this._onDrag,this),this._map.on("zoomstart",this._onZoom,this),this._map.on("zoomend",this._onZoomEnd,this),this.options.showCompass&&("ondeviceorientationabsolute"in window?r.DomEvent.on(window,"deviceorientationabsolute",this._onDeviceOrientation,this):"ondeviceorientation"in window&&r.DomEvent.on(window,"deviceorientation",this._onDeviceOrientation,this)))},_deactivate:function(){this._map.stopLocate(),this._active=!1,this.options.cacheLocation||(this._event=void 0),this._map.off("locationfound",this._onLocationFound,this),this._map.off("locationerror",this._onLocationError,this),this._map.off("dragstart",this._onDrag,this),this._map.off("zoomstart",this._onZoom,this),this._map.off("zoomend",this._onZoomEnd,this),this.options.showCompass&&(this._compassHeading=null,"ondeviceorientationabsolute"in window?r.DomEvent.off(window,"deviceorientationabsolute",this._onDeviceOrientation,this):"ondeviceorientation"in window&&r.DomEvent.off(window,"deviceorientation",this._onDeviceOrientation,this))},setView:function(){if(this._drawMarker(),this._isOutsideMapBounds())this._event=void 0,this.options.onLocationOutsideMapBounds(this);else if(this.options.keepCurrentZoomLevel)(t=this.options.flyTo?this._map.flyTo:this._map.panTo).bind(this._map)([this._event.latitude,this._event.longitude]);else{var t=this.options.flyTo?this._map.flyToBounds:this._map.fitBounds;this._ignoreEvent=!0,t.bind(this._map)(this.options.getLocationBounds(this._event),{padding:this.options.circlePadding,maxZoom:this.options.locateOptions.maxZoom}),r.Util.requestAnimFrame(function(){this._ignoreEvent=!1},this)}},_drawCompass:function(){if(this._event){var t=this._event.latlng;if(this.options.showCompass&&t&&null!==this._compassHeading){var e=this._isFollowing()?this.options.followCompassStyle:this.options.compassStyle;this._compass?(this._compass.setLatLng(t),this._compass.setHeading(this._compassHeading),this._compass.setStyle&&this._compass.setStyle(e)):this._compass=new this.options.compassClass(t,this._compassHeading,e).addTo(this._layer)}!this._compass||this.options.showCompass&&null!==this._compassHeading||(this._compass.removeFrom(this._layer),this._compass=null)}},_drawMarker:function(){void 0===this._event.accuracy&&(this._event.accuracy=0);var t,e,i=this._event.accuracy,n=this._event.latlng;if(this.options.drawCircle){var o=this._isFollowing()?this.options.followCircleStyle:this.options.circleStyle;this._circle?this._circle.setLatLng(n).setRadius(i).setStyle(o):this._circle=r.circle(n,i,o).addTo(this._layer)}if(e=this.options.metric?(t=i.toFixed(0),this.options.strings.metersUnit):(t=(3.2808399*i).toFixed(0),this.options.strings.feetUnit),this.options.drawMarker){var s=this._isFollowing()?this.options.followMarkerStyle:this.options.markerStyle;this._marker?(this._marker.setLatLng(n),this._marker.setStyle&&this._marker.setStyle(s)):this._marker=new this.options.markerClass(n,s).addTo(this._layer)}this._drawCompass();var a=this.options.strings.popup;this.options.showPopup&&a&&this._marker&&this._marker.bindPopup(r.Util.template(a,{distance:t,unit:e}))._popup.setLatLng(n),this.options.showPopup&&a&&this._compass&&this._compass.bindPopup(r.Util.template(a,{distance:t,unit:e}))._popup.setLatLng(n)},_removeMarker:function(){this._layer.clearLayers(),this._marker=void 0,this._circle=void 0},_unload:function(){this.stop(),this._map.off("unload",this._unload,this)},_setCompassHeading:function(t){!isNaN(parseFloat(t))&&isFinite(t)?(t=Math.round(t),this._compassHeading=t,r.Util.requestAnimFrame(this._drawCompass,this)):this._compassHeading=null},_onCompassNeedsCalibration:function(){this._setCompassHeading()},_onDeviceOrientation:function(t){this._active&&(t.webkitCompassHeading?this._setCompassHeading(t.webkitCompassHeading):t.absolute&&t.alpha&&this._setCompassHeading(360-t.alpha))},_onLocationError:function(t){3==t.code&&this.options.locateOptions.watch||(this.stop(),this.options.onLocationError(t,this))},_onLocationFound:function(t){if((!this._event||this._event.latlng.lat!==t.latlng.lat||this._event.latlng.lng!==t.latlng.lng||this._event.accuracy!==t.accuracy)&&this._active){switch(this._event=t,this._drawMarker(),this._updateContainerStyle(),this.options.setView){case"once":this._justClicked&&this.setView();break;case"untilPan":this._userPanned||this.setView();break;case"untilPanOrZoom":this._userPanned||this._userZoomed||this.setView();break;case"always":this.setView()}this._justClicked=!1}},_onDrag:function(){this._event&&!this._ignoreEvent&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_onZoom:function(){this._event&&!this._ignoreEvent&&(this._userZoomed=!0,this._updateContainerStyle(),this._drawMarker())},_onZoomEnd:function(){this._event&&this._drawCompass(),this._event&&!this._ignoreEvent&&this._marker&&!this._map.getBounds().pad(-.3).contains(this._marker.getLatLng())&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_isFollowing:function(){return!!this._active&&("always"===this.options.setView||("untilPan"===this.options.setView?!this._userPanned:"untilPanOrZoom"===this.options.setView?!this._userPanned&&!this._userZoomed:void 0))},_isOutsideMapBounds:function(){return void 0!==this._event&&this._map.options.maxBounds&&!this._map.options.maxBounds.contains(this._event.latlng)},_updateContainerStyle:function(){this._container&&(this._active&&!this._event?this._setClasses("requesting"):this._isFollowing()?this._setClasses("following"):this._active?this._setClasses("active"):this._cleanClasses())},_setClasses:function(t){"requesting"==t?(n(this._container,"active following"),e(this._container,"requesting"),n(this._icon,this.options.icon),e(this._icon,this.options.iconLoading)):"active"==t?(n(this._container,"requesting following"),e(this._container,"active"),n(this._icon,this.options.iconLoading),e(this._icon,this.options.icon)):"following"==t&&(n(this._container,"requesting"),e(this._container,"active following"),n(this._icon,this.options.iconLoading),e(this._icon,this.options.icon))},_cleanClasses:function(){r.DomUtil.removeClass(this._container,"requesting"),r.DomUtil.removeClass(this._container,"active"),r.DomUtil.removeClass(this._container,"following"),n(this._icon,this.options.iconLoading),e(this._icon,this.options.icon)},_resetVariables:function(){this._active=!1,this._justClicked=!1,this._userPanned=!1,this._userZoomed=!1}});return r.control.locate=function(t){return new r.Control.Locate(t)},s},window),function(t,i){"use strict";L.AwesomeMarkers={},L.AwesomeMarkers.version="2.0.1",L.AwesomeMarkers.Icon=L.Icon.extend({options:{iconSize:[35,45],iconAnchor:[17,42],popupAnchor:[1,-32],shadowAnchor:[10,12],shadowSize:[36,16],className:"awesome-marker",prefix:"glyphicon",spinClass:"fa-spin",icon:"home",markerColor:"blue",iconColor:"white"},initialize:function(t){t=L.Util.setOptions(this,t)},createIcon:function(){var t=i.createElement("div"),e=this.options;return e.icon&&(t.innerHTML=this._createInner()),e.bgPos&&(t.style.backgroundPosition=-e.bgPos.x+"px "+-e.bgPos.y+"px"),this._setIconStyles(t,"icon-"+e.markerColor),t},_createInner:function(){var t,e="",i="",n="",o=this.options;return t=o.icon.slice(0,o.prefix.length+1)===o.prefix+"-"?o.icon:o.prefix+"-"+o.icon,o.spin&&"string"==typeof o.spinClass&&(e=o.spinClass),o.iconColor&&("white"===o.iconColor||"black"===o.iconColor?i="icon-"+o.iconColor:n="style='color: "+o.iconColor+"' "),""},_setIconStyles:function(t,e){var i,n=this.options,o=L.point(n["shadow"===e?"shadowSize":"iconSize"]);!(i="shadow"===e?L.point(n.shadowAnchor||n.iconAnchor):L.point(n.iconAnchor))&&o&&(i=o.divideBy(2,!0)),t.className="awesome-marker-"+e+" "+n.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},createShadow:function(){var t=i.createElement("div");return this._setIconStyles(t,"shadow"),t}}),L.AwesomeMarkers.icon=function(t){return new L.AwesomeMarkers.Icon(t)}}(0,document),function(t,e){"function"==typeof define&&define.amd?define(["leaflet"],t):"object"==typeof exports&&(module.exports=t(require("leaflet"))),void 0!==e&&e.L&&t(e.L)}(function(l){l.Editable=l.Evented.extend({statics:{FORWARD:1,BACKWARD:-1},options:{zIndex:1e3,polygonClass:l.Polygon,polylineClass:l.Polyline,markerClass:l.Marker,rectangleClass:l.Rectangle,circleClass:l.Circle,drawingCSSClass:"leaflet-editable-drawing",drawingCursor:"crosshair",editLayer:void 0,featuresLayer:void 0,polylineEditorClass:void 0,polygonEditorClass:void 0,markerEditorClass:void 0,rectangleEditorClass:void 0,circleEditorClass:void 0,lineGuideOptions:{},skipMiddleMarkers:!1},initialize:function(t,e){l.setOptions(this,e),this._lastZIndex=this.options.zIndex,this.map=t,this.editLayer=this.createEditLayer(),this.featuresLayer=this.createFeaturesLayer(),this.forwardLineGuide=this.createLineGuide(),this.backwardLineGuide=this.createLineGuide()},fireAndForward:function(t,e){((e=e||{}).editTools=this).fire(t,e),this.map.fire(t,e)},createLineGuide:function(){var t=l.extend({dashArray:"5,10",weight:1,interactive:!1},this.options.lineGuideOptions);return l.polyline([],t)},createVertexIcon:function(t){return l.Browser.mobile&&l.Browser.touch?new l.Editable.TouchVertexIcon(t):new l.Editable.VertexIcon(t)},createEditLayer:function(){return this.options.editLayer||(new l.LayerGroup).addTo(this.map)},createFeaturesLayer:function(){return this.options.featuresLayer||(new l.LayerGroup).addTo(this.map)},moveForwardLineGuide:function(t){this.forwardLineGuide._latlngs.length&&(this.forwardLineGuide._latlngs[1]=t,this.forwardLineGuide._bounds.extend(t),this.forwardLineGuide.redraw())},moveBackwardLineGuide:function(t){this.backwardLineGuide._latlngs.length&&(this.backwardLineGuide._latlngs[1]=t,this.backwardLineGuide._bounds.extend(t),this.backwardLineGuide.redraw())},anchorForwardLineGuide:function(t){this.forwardLineGuide._latlngs[0]=t,this.forwardLineGuide._bounds.extend(t),this.forwardLineGuide.redraw()},anchorBackwardLineGuide:function(t){this.backwardLineGuide._latlngs[0]=t,this.backwardLineGuide._bounds.extend(t),this.backwardLineGuide.redraw()},attachForwardLineGuide:function(){this.editLayer.addLayer(this.forwardLineGuide)},attachBackwardLineGuide:function(){this.editLayer.addLayer(this.backwardLineGuide)},detachForwardLineGuide:function(){this.forwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.forwardLineGuide)},detachBackwardLineGuide:function(){this.backwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.backwardLineGuide)},blockEvents:function(){this._oldTargets||(this._oldTargets=this.map._targets,this.map._targets={})},unblockEvents:function(){this._oldTargets&&(this.map._targets=l.extend(this.map._targets,this._oldTargets),delete this._oldTargets)},registerForDrawing:function(t){this._drawingEditor&&this.unregisterForDrawing(this._drawingEditor),this.blockEvents(),t.reset(),this._drawingEditor=t,this.map.on("mousemove touchmove",t.onDrawingMouseMove,t),this.map.on("mousedown",this.onMousedown,this),this.map.on("mouseup",this.onMouseup,this),l.DomUtil.addClass(this.map._container,this.options.drawingCSSClass),this.defaultMapCursor=this.map._container.style.cursor,this.map._container.style.cursor=this.options.drawingCursor},unregisterForDrawing:function(t){this.unblockEvents(),l.DomUtil.removeClass(this.map._container,this.options.drawingCSSClass),this.map._container.style.cursor=this.defaultMapCursor,(t=t||this._drawingEditor)&&(this.map.off("mousemove touchmove",t.onDrawingMouseMove,t),this.map.off("mousedown",this.onMousedown,this),this.map.off("mouseup",this.onMouseup,this),t===this._drawingEditor&&(delete this._drawingEditor,t._drawing&&t.cancelDrawing()))},onMousedown:function(t){1==t.originalEvent.which&&(this._mouseDown=t,this._drawingEditor.onDrawingMouseDown(t))},onMouseup:function(t){if(this._mouseDown){var e=this._drawingEditor,i=this._mouseDown;if(this._mouseDown=null,e.onDrawingMouseUp(t),this._drawingEditor!==e)return;var n=l.point(i.originalEvent.clientX,i.originalEvent.clientY),o=l.point(t.originalEvent.clientX,t.originalEvent.clientY).distanceTo(n);Math.abs(o)<9*(window.devicePixelRatio||1)&&this._drawingEditor.onDrawingClick(t)}},drawing:function(){return this._drawingEditor&&this._drawingEditor.drawing()},stopDrawing:function(){this.unregisterForDrawing()},commitDrawing:function(t){this._drawingEditor&&this._drawingEditor.commitDrawing(t)},connectCreatedToMap:function(t){return this.featuresLayer.addLayer(t)},startPolyline:function(t,e){var i=this.createPolyline([],e);return i.enableEdit(this.map).newShape(t),i},startPolygon:function(t,e){var i=this.createPolygon([],e);return i.enableEdit(this.map).newShape(t),i},startMarker:function(t,e){t=t||this.map.getCenter().clone();var i=this.createMarker(t,e);return i.enableEdit(this.map).startDrawing(),i},startRectangle:function(t,e){var i=t||l.latLng([0,0]),n=new l.LatLngBounds(i,i),o=this.createRectangle(n,e);return o.enableEdit(this.map).startDrawing(),o},startCircle:function(t,e){t=t||this.map.getCenter().clone();var i=this.createCircle(t,e);return i.enableEdit(this.map).startDrawing(),i},startHole:function(t,e){t.newHole(e)},createLayer:function(t,e,i){var n=new t(e,i=l.Util.extend({editOptions:{editTools:this}},i));return this.fireAndForward("editable:created",{layer:n}),n},createPolyline:function(t,e){return this.createLayer(e&&e.polylineClass||this.options.polylineClass,t,e)},createPolygon:function(t,e){return this.createLayer(e&&e.polygonClass||this.options.polygonClass,t,e)},createMarker:function(t,e){return this.createLayer(e&&e.markerClass||this.options.markerClass,t,e)},createRectangle:function(t,e){return this.createLayer(e&&e.rectangleClass||this.options.rectangleClass,t,e)},createCircle:function(t,e){return this.createLayer(e&&e.circleClass||this.options.circleClass,t,e)}}),l.extend(l.Editable,{makeCancellable:function(t){t.cancel=function(){t._cancelled=!0}}}),l.Map.mergeOptions({editToolsClass:l.Editable,editable:!1,editOptions:{}}),l.Map.addInitHook(function(){this.whenReady(function(){this.options.editable&&(this.editTools=new this.options.editToolsClass(this,this.options.editOptions))})}),l.Editable.VertexIcon=l.DivIcon.extend({options:{iconSize:new l.Point(8,8)}}),l.Editable.TouchVertexIcon=l.Editable.VertexIcon.extend({options:{iconSize:new l.Point(20,20)}}),l.Editable.VertexMarker=l.Marker.extend({options:{draggable:!0,className:"leaflet-div-icon leaflet-vertex-icon"},initialize:function(t,e,i,n){this.latlng=t,this.latlngs=e,this.editor=i,l.Marker.prototype.initialize.call(this,t,n),this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),(this.latlng.__vertex=this).editor.editLayer.addLayer(this),this.setZIndexOffset(i.tools._lastZIndex+1)},onAdd:function(t){l.Marker.prototype.onAdd.call(this,t),this.on("drag",this.onDrag),this.on("dragstart",this.onDragStart),this.on("dragend",this.onDragEnd),this.on("mouseup",this.onMouseup),this.on("click",this.onClick),this.on("contextmenu",this.onContextMenu),this.on("mousedown touchstart",this.onMouseDown),this.on("mouseover",this.onMouseOver),this.on("mouseout",this.onMouseOut),this.addMiddleMarkers()},onRemove:function(t){this.middleMarker&&this.middleMarker.delete(),delete this.latlng.__vertex,this.off("drag",this.onDrag),this.off("dragstart",this.onDragStart),this.off("dragend",this.onDragEnd),this.off("mouseup",this.onMouseup),this.off("click",this.onClick),this.off("contextmenu",this.onContextMenu),this.off("mousedown touchstart",this.onMouseDown),this.off("mouseover",this.onMouseOver),this.off("mouseout",this.onMouseOut),l.Marker.prototype.onRemove.call(this,t)},onDrag:function(t){(t.vertex=this).editor.onVertexMarkerDrag(t);var e=l.DomUtil.getPosition(this._icon),i=this._map.layerPointToLatLng(e);this.latlng.update(i),this._latlng=this.latlng,this.editor.refresh(),this.middleMarker&&this.middleMarker.updateLatLng();var n=this.getNext();n&&n.middleMarker&&n.middleMarker.updateLatLng()},onDragStart:function(t){(t.vertex=this).editor.onVertexMarkerDragStart(t)},onDragEnd:function(t){(t.vertex=this).editor.onVertexMarkerDragEnd(t)},onClick:function(t){(t.vertex=this).editor.onVertexMarkerClick(t)},onMouseup:function(t){l.DomEvent.stop(t),(t.vertex=this).editor.map.fire("mouseup",t)},onContextMenu:function(t){(t.vertex=this).editor.onVertexMarkerContextMenu(t)},onMouseDown:function(t){(t.vertex=this).editor.onVertexMarkerMouseDown(t)},onMouseOver:function(t){(t.vertex=this).editor.onVertexMarkerMouseOver(t)},onMouseOut:function(t){(t.vertex=this).editor.onVertexMarkerMouseOut(t)},delete:function(){var t=this.getNext();this.latlngs.splice(this.getIndex(),1),this.editor.editLayer.removeLayer(this),this.editor.onVertexDeleted({latlng:this.latlng,vertex:this}),this.latlngs.length||this.editor.deleteShape(this.latlngs),t&&t.resetMiddleMarker(),this.editor.refresh()},getIndex:function(){return this.latlngs.indexOf(this.latlng)},getLastIndex:function(){return this.latlngs.length-1},getPrevious:function(){if(!(this.latlngs.length<2)){var t=this.getIndex(),e=t-1;0===t&&this.editor.CLOSED&&(e=this.getLastIndex());var i=this.latlngs[e];return i?i.__vertex:void 0}},getNext:function(){if(!(this.latlngs.length<2)){var t=this.getIndex(),e=t+1;t===this.getLastIndex()&&this.editor.CLOSED&&(e=0);var i=this.latlngs[e];return i?i.__vertex:void 0}},addMiddleMarker:function(t){this.editor.hasMiddleMarkers()&&(t=t||this.getPrevious())&&!this.middleMarker&&(this.middleMarker=this.editor.addMiddleMarker(t,this,this.latlngs,this.editor))},addMiddleMarkers:function(){if(this.editor.hasMiddleMarkers()){var t=this.getPrevious();t&&this.addMiddleMarker(t);var e=this.getNext();e&&e.resetMiddleMarker()}},resetMiddleMarker:function(){this.middleMarker&&this.middleMarker.delete(),this.addMiddleMarker()},split:function(){this.editor.splitShape&&this.editor.splitShape(this.latlngs,this.getIndex())},continue:function(){if(this.editor.continueBackward){var t=this.getIndex();0===t?this.editor.continueBackward(this.latlngs):t===this.getLastIndex()&&this.editor.continueForward(this.latlngs)}}}),l.Editable.mergeOptions({vertexMarkerClass:l.Editable.VertexMarker}),l.Editable.MiddleMarker=l.Marker.extend({options:{opacity:.5,className:"leaflet-div-icon leaflet-middle-icon",draggable:!0},initialize:function(t,e,i,n,o){this.left=t,this.right=e,this.editor=n,this.latlngs=i,l.Marker.prototype.initialize.call(this,this.computeLatLng(),o),this._opacity=this.options.opacity,this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.editor.editLayer.addLayer(this),this.setVisibility()},setVisibility:function(){var t=this._map.latLngToContainerPoint(this.left.latlng),e=this._map.latLngToContainerPoint(this.right.latlng),i=l.point(this.options.icon.options.iconSize);t.distanceTo(e)<3*i.x?this.hide():this.show()},show:function(){this.setOpacity(this._opacity)},hide:function(){this.setOpacity(0)},updateLatLng:function(){this.setLatLng(this.computeLatLng()),this.setVisibility()},computeLatLng:function(){var t=this.editor.map.latLngToContainerPoint(this.left.latlng),e=this.editor.map.latLngToContainerPoint(this.right.latlng),i=(t.y+e.y)/2,n=(t.x+e.x)/2;return this.editor.map.containerPointToLatLng([n,i])},onAdd:function(t){l.Marker.prototype.onAdd.call(this,t),l.DomEvent.on(this._icon,"mousedown touchstart",this.onMouseDown,this),t.on("zoomend",this.setVisibility,this)},onRemove:function(t){delete this.right.middleMarker,l.DomEvent.off(this._icon,"mousedown touchstart",this.onMouseDown,this),t.off("zoomend",this.setVisibility,this),l.Marker.prototype.onRemove.call(this,t)},onMouseDown:function(t){var e=l.DomUtil.getPosition(this._icon);if(t={originalEvent:t,latlng:this.editor.map.layerPointToLatLng(e)},0!==this.options.opacity&&(l.Editable.makeCancellable(t),this.editor.onMiddleMarkerMouseDown(t),!t._cancelled)){this.latlngs.splice(this.index(),0,t.latlng),this.editor.refresh();var i=this._icon,n=this.editor.addVertexMarker(t.latlng,this.latlngs);this.editor.onNewVertex(n);var o=n._icon.parentNode;o.removeChild(n._icon),n._icon=i,o.appendChild(n._icon),n._initIcon(),n._initInteraction(),n.setOpacity(1),l.Draggable._dragging=!1,n.dragging._draggable._onDown(t.originalEvent),this.delete()}},delete:function(){this.editor.editLayer.removeLayer(this)},index:function(){return this.latlngs.indexOf(this.right.latlng)}}),l.Editable.mergeOptions({middleMarkerClass:l.Editable.MiddleMarker}),l.Editable.BaseEditor=l.Handler.extend({initialize:function(t,e,i){l.setOptions(this,i),this.map=t,this.feature=e,(this.feature.editor=this).editLayer=new l.LayerGroup,this.tools=this.options.editTools||t.editTools},addHooks:function(){this.isConnected()?this.onFeatureAdd():this.feature.once("add",this.onFeatureAdd,this),this.onEnable(),this.feature.on(this._getEvents(),this)},removeHooks:function(){this.feature.off(this._getEvents(),this),this.feature.dragging&&this.feature.dragging.disable(),this.editLayer.clearLayers(),this.tools.editLayer.removeLayer(this.editLayer),this.onDisable(),this._drawing&&this.cancelDrawing()},drawing:function(){return!!this._drawing},reset:function(){},onFeatureAdd:function(){this.tools.editLayer.addLayer(this.editLayer),this.feature.dragging&&this.feature.dragging.enable()},hasMiddleMarkers:function(){return!this.options.skipMiddleMarkers&&!this.tools.options.skipMiddleMarkers},fireAndForward:function(t,e){(e=e||{}).layer=this.feature,this.feature.fire(t,e),this.tools.fireAndForward(t,e)},onEnable:function(){this.fireAndForward("editable:enable")},onDisable:function(){this.fireAndForward("editable:disable")},onEditing:function(){this.fireAndForward("editable:editing")},onStartDrawing:function(){this.fireAndForward("editable:drawing:start")},onEndDrawing:function(){this.fireAndForward("editable:drawing:end")},onCancelDrawing:function(){this.fireAndForward("editable:drawing:cancel")},onCommitDrawing:function(t){this.fireAndForward("editable:drawing:commit",t)},onDrawingMouseDown:function(t){this.fireAndForward("editable:drawing:mousedown",t)},onDrawingMouseUp:function(t){this.fireAndForward("editable:drawing:mouseup",t)},startDrawing:function(){this._drawing||(this._drawing=l.Editable.FORWARD),this.tools.registerForDrawing(this),this.onStartDrawing()},commitDrawing:function(t){this.onCommitDrawing(t),this.endDrawing()},cancelDrawing:function(){l.Draggable._dragging=!1,this.onCancelDrawing(),this.endDrawing()},endDrawing:function(){this._drawing=!1,this.tools.unregisterForDrawing(this),this.onEndDrawing()},onDrawingClick:function(t){this.drawing()&&(l.Editable.makeCancellable(t),this.fireAndForward("editable:drawing:click",t),t._cancelled||(this.isConnected()||this.connect(t),this.processDrawingClick(t)))},isConnected:function(){return this.map.hasLayer(this.feature)},connect:function(){this.tools.connectCreatedToMap(this.feature),this.tools.editLayer.addLayer(this.editLayer)},onMove:function(t){this.fireAndForward("editable:drawing:move",t)},onDrawingMouseMove:function(t){this.onMove(t)},_getEvents:function(){return{dragstart:this.onDragStart,drag:this.onDrag,dragend:this.onDragEnd,remove:this.disable}},onDragStart:function(t){this.onEditing(),this.fireAndForward("editable:dragstart",t)},onDrag:function(t){this.onMove(t),this.fireAndForward("editable:drag",t)},onDragEnd:function(t){this.fireAndForward("editable:dragend",t)}}),l.Editable.MarkerEditor=l.Editable.BaseEditor.extend({onDrawingMouseMove:function(t){l.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,t),this._drawing&&this.feature.setLatLng(t.latlng)},processDrawingClick:function(t){this.fireAndForward("editable:drawing:clicked",t),this.commitDrawing(t)},connect:function(t){t&&(this.feature._latlng=t.latlng),l.Editable.BaseEditor.prototype.connect.call(this,t)}}),l.Editable.PathEditor=l.Editable.BaseEditor.extend({CLOSED:!1,MIN_VERTEX:2,addHooks:function(){return l.Editable.BaseEditor.prototype.addHooks.call(this),this.feature&&this.initVertexMarkers(),this},initVertexMarkers:function(t){if(this.enabled())if(t=t||this.getLatLngs(),r(t))this.addVertexMarkers(t);else for(var e=0;e=this.MIN_VERTEX-1&&(e=!0):0===i&&this._drawing===l.Editable.BACKWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX?e=!0:0===i&&this._drawing===l.Editable.FORWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX&&this.CLOSED?e=!0:this.onVertexRawMarkerClick(t),this.fireAndForward("editable:vertex:clicked",t),e&&this.commitDrawing(t)}},onVertexRawMarkerClick:function(t){this.fireAndForward("editable:vertex:rawclick",t),t._cancelled||this.vertexCanBeDeleted(t.vertex)&&t.vertex.delete()},vertexCanBeDeleted:function(t){return t.latlngs.length>this.MIN_VERTEX},onVertexDeleted:function(t){this.fireAndForward("editable:vertex:deleted",t)},onVertexMarkerCtrlClick:function(t){this.fireAndForward("editable:vertex:ctrlclick",t)},onVertexMarkerShiftClick:function(t){this.fireAndForward("editable:vertex:shiftclick",t)},onVertexMarkerMetaKeyClick:function(t){this.fireAndForward("editable:vertex:metakeyclick",t)},onVertexMarkerAltClick:function(t){this.fireAndForward("editable:vertex:altclick",t)},onVertexMarkerContextMenu:function(t){this.fireAndForward("editable:vertex:contextmenu",t)},onVertexMarkerMouseDown:function(t){this.fireAndForward("editable:vertex:mousedown",t)},onVertexMarkerMouseOver:function(t){this.fireAndForward("editable:vertex:mouseover",t)},onVertexMarkerMouseOut:function(t){this.fireAndForward("editable:vertex:mouseout",t)},onMiddleMarkerMouseDown:function(t){this.fireAndForward("editable:middlemarker:mousedown",t)},onVertexMarkerDrag:function(t){this.onMove(t),this.feature._bounds&&this.extendBounds(t),this.fireAndForward("editable:vertex:drag",t)},onVertexMarkerDragStart:function(t){this.fireAndForward("editable:vertex:dragstart",t)},onVertexMarkerDragEnd:function(t){this.fireAndForward("editable:vertex:dragend",t)},setDrawnLatLngs:function(t){this._drawnLatLngs=t||this.getDefaultLatLngs()},startDrawing:function(){this._drawnLatLngs||this.setDrawnLatLngs(),l.Editable.BaseEditor.prototype.startDrawing.call(this)},startDrawingForward:function(){this.startDrawing()},endDrawing:function(){this.tools.detachForwardLineGuide(),this.tools.detachBackwardLineGuide(),this._drawnLatLngs&&this._drawnLatLngs.length=t.length-1)){this.ensureMulti();var i=this.feature._latlngs.indexOf(t);if(-1!==i){var n=t.slice(0,e+1),o=t.slice(e);o[0]=l.latLng(o[0].lat,o[0].lng,o[0].alt),this.feature._latlngs.splice(i,1,n,o),this.refresh(),this.reset()}}}}),l.Editable.PolygonEditor=l.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:3,newPointForward:function(t){l.Editable.PathEditor.prototype.newPointForward.call(this,t),this.tools.backwardLineGuide._latlngs.length||this.tools.anchorBackwardLineGuide(t),2===this._drawnLatLngs.length&&this.tools.attachBackwardLineGuide()},addNewEmptyHole:function(t){this.ensureNotFlat();var e=this.feature.shapeAt(t);if(e){var i=[];return e.push(i),i}},newHole:function(t){var e=this.addNewEmptyHole(t);e&&(this.setDrawnLatLngs(e),this.startDrawingForward(),t&&this.newPointForward(t))},addNewEmptyShape:function(){if(this.feature._latlngs.length&&this.feature._latlngs[0].length){var t=[];return this.appendShape(t),t}return this.feature._latlngs},ensureMulti:function(){this.feature._latlngs.length&&r(this.feature._latlngs[0])&&(this.feature._latlngs=[this.feature._latlngs])},ensureNotFlat:function(){this.feature._latlngs.length&&!r(this.feature._latlngs)||(this.feature._latlngs=[this.feature._latlngs])},vertexCanBeDeleted:function(t){var e=this.feature.parentShape(t.latlngs);return 0t.lat!=n.lat>t.lat&&t.lng<(n.lng-i.lng)*(t.lat-i.lat)/(n.lat-i.lat)+i.lng&&(r=!r);return r},parentShape:function(t,e){if(e=e||this._latlngs){var i=l.Util.indexOf(e,t);if(-1!==i)return e;for(var n=0;nWaymark | Leaflet'}).addTo(Waymark.map),void 0!==Waymark.config.map_init_latlng?Waymark.map.setView(Waymark.config.map_init_latlng):Waymark.map.setView(Waymark.fallback_latlng),void 0!==Waymark.config.map_init_zoom?Waymark.map.setZoom(Waymark.config.map_init_zoom):Waymark.map.setZoom(Waymark.fallback_zoom),L.Path.mergeOptions({color:"#b42714"}),L.control.zoom({position:Waymark.config.map_options.button_position}).addTo(Waymark.map),L.control.locate({position:"bottomright",icon:"ion ion-android-locate",drawCircle:!1}).addTo(Waymark.map),L.control.fullscreen({position:Waymark.config.map_options.button_position}).addTo(Waymark.map),Waymark.setup_tile_layers(),Waymark.create_data_layer(),Waymark.create_buttons()},this.handle_resize=function(){Waymark=this,jQuery(window).on("resize",function(){var t=jQuery(Waymark.map.getContainer());Waymark.config.map_height=t.height(),Waymark.config.map_width=t.width()})},this.create_data_layer=function(){Waymark=this,Waymark.map_data=L.geoJSON(null,{pointToLayer:function(t,e){return void 0!==t.properties&&t.properties.radius?new L.Circle(e,t.properties.radius):Waymark.create_marker(e)},onEachFeature:function(t,e){switch(t.geometry.type){case"Point":if(t.properties=Waymark.parse_shape_data(t),t.properties.radius){var i=Waymark.get_feature_type("shape",t);e.setStyle({color:i.shape_colour,fillOpacity:i.fill_opacity}),Waymark.info_window("shape",t,e),Waymark.tooltip("shape",t,e);break}t.properties=Waymark.parse_marker_data(t);i=Waymark.get_feature_type("marker",t);e.setIcon(L.AwesomeMarkers.icon({icon:i.marker_icon,markerColor:i.marker_colour,iconColor:i.icon_colour})),Waymark.info_window("marker",t,e),Waymark.tooltip("marker",t,e);break;case"LineString":case"MultiLineString":t.properties=Waymark.parse_line_data(t);i=Waymark.get_feature_type("line",t);e.setStyle({color:i.line_colour,weight:i.line_weight,opacity:"0.7"}),Waymark.info_window("line",t,e),Waymark.tooltip("line",t,e);break;case"Polygon":t.properties=Waymark.parse_shape_data(t),t.properties.rectangle;i=Waymark.get_feature_type("shape",t);e.setStyle({color:i.shape_colour,fillOpacity:i.fill_opacity}),Waymark.info_window("shape",t,e),Waymark.tooltip("shape",t,e)}}}).addTo(Waymark.map)},this.create_buttons=function(){},this.load_json=function(t){Waymark=this,"object"==typeof t&&void 0!==t.features&&(Waymark.map_data.addData(t),void 0===Waymark.config.map_init_latlng&&void 0===Waymark.config.map_init_zoom?Waymark.map.fitBounds(Waymark.map_data.getBounds()):void 0!==Waymark.config.map_init_latlng&&void 0!==Waymark.config.map_init_zoom?Waymark.map.setView(Waymark.config.map_init_latlng,Waymark.config.map_init_zoom):(void 0!==Waymark.config.map_init_latlng&&(Waymark.map.setView(Waymark.config.map_init_latlng),Waymark.map.setZoom(Waymark.map.getBoundsZoom(Waymark.map_data.getBounds()))),void 0!==Waymark.config.map_init_zoom&&(Waymark.map.setZoom(Waymark.config.map_init_zoom),Waymark.map.setView(Waymark.map_data.getBounds().getCenter()))))},this.create_marker=function(t){return L.marker(t)},this.setup_tile_layers=function(){Waymark=this;var t=[],e=0;if(void 0!==Waymark.config.map_init_basemap)for(i in Waymark.config.tile_layers){Waymark.config.map_init_basemap.toUpperCase()===Waymark.config.tile_layers[i].layer_name.toUpperCase()&&(e=i)}for(i in Waymark.config.tile_layers){void 0!==Waymark.config.tile_layers[i].append&&(Waymark.config.tile_layers[i].layer_url+=Waymark.config.tile_layers[i].append);var n=Waymark.config.tile_layers[i].layer_name.replace(/ /g,""),o=L.tileLayer(Waymark.config.tile_layers[i].layer_url,{id:n,attribution:Waymark.config.tile_layers[i].layer_attribution});t[Waymark.config.tile_layers[i].layer_name]=o,i==e&&o.addTo(Waymark.map)}1<=i&&L.control.layers(t).addTo(Waymark.map)},this.parse_marker_data=function(t){if("object"==typeof t.properties)var e=t.properties;else e=Object.assign({},Waymark.config.marker_data_defaults);for(key in Waymark.config.marker_data_defaults)if(void 0===e[key])for(prop in t.properties)switch(prop){case"title":case"name":e.title=t.properties[prop];break;case"desc":case"description":case"notes":e.description=t.properties[prop];break;case"photos":for(i in e.type="photo",t.properties[prop])void 0!==t.properties[prop][i].web_url&&(e.image_thumbnail_url=t.properties[prop][i].web_url),void 0!==t.properties[prop][i].web_url&&(e.image_large_url=t.properties[prop][i].scaled_url)}for(prop in t.properties)Waymark.config.marker_data_defaults.hasOwnProperty(prop)||delete t.properties[prop];return e},this.parse_line_data=function(t){if(Waymark=this,"object"==typeof t.properties)var e=t.properties;else e=Object.assign({},Waymark.config.line_data_defaults);return e},this.parse_shape_data=function(t){if(Waymark=this,"object"==typeof t.properties)var e=t.properties;else e=Object.assign({},Waymark.config.shape_data_defaults);return e},this.tooltip=function(t,e,i){Waymark=this;var n="";if("1"==Waymark.config.map_options.show_type_labels){var o=Waymark.get_feature_type(t,e);if(o){var s=o[t+"_title"];s&&(n="["+s+"] ")}}e.properties.title&&(n+=e.properties.title),n&&(i.bindTooltip(n),i.on("mouseover",function(t){var e=t.target.getTooltip();e.setLatLng(t.latlng),e.openTooltip()}),i.on("mousemove",function(t){t.target.getTooltip().setLatLng(t.latlng)}))},this.build_content=function(t,e){Waymark=this;var i=jQuery("
"),n=jQuery("