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

react-leaflet

Package Overview
Dependencies
Maintainers
1
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-leaflet - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## v2.4.0 (2019-06-09)
- Added `ZoomPanOptions` and `FitBoundsOptions` to `Map` component ([PR #593](https://github.com/PaulLeCam/react-leaflet/pull/593) by _scailbc_).
- Updated Flow types support for Flow v0.100.
- [website] Updated Docusaurus.
## v2.3.0 (2019-05-12)

@@ -2,0 +8,0 @@

2

dist/react-leaflet.min.js

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("leaflet"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","leaflet","react-dom"],t):t((e=e||self).ReactLeaflet={},e.React,e.L,e.ReactDOM)}(this,function(e,l,i,t){"use strict";var a="default"in l?l.default:l;function n(e,t){return e(t={exports:{}},t.exports),t.exports}var o,r=n(function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},t.apply(this,arguments)}e.exports=t}),s=n(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103,l=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,i=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,p=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,c=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116;function d(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case p:case f:case r:case i:case a:case h:return e;default:switch(e=e&&e.$$typeof){case u:case c:case s:return e;default:return t}}case y:case m:case l:return t}}}function v(e){return d(e)===f}t.typeOf=d,t.AsyncMode=p,t.ConcurrentMode=f,t.ContextConsumer=u,t.ContextProvider=s,t.Element=o,t.ForwardRef=c,t.Fragment=r,t.Lazy=y,t.Memo=m,t.Portal=l,t.Profiler=i,t.StrictMode=a,t.Suspense=h,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===f||e===i||e===a||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===s||e.$$typeof===u||e.$$typeof===c)},t.isAsyncMode=function(e){return v(e)||d(e)===p},t.isConcurrentMode=v,t.isContextConsumer=function(e){return d(e)===u},t.isContextProvider=function(e){return d(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return d(e)===c},t.isFragment=function(e){return d(e)===r},t.isLazy=function(e){return d(e)===y},t.isMemo=function(e){return d(e)===m},t.isPortal=function(e){return d(e)===l},t.isProfiler=function(e){return d(e)===i},t.isStrictMode=function(e){return d(e)===a},t.isSuspense=function(e){return d(e)===h}});(o=s)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")&&o.default;s.typeOf,s.AsyncMode,s.ConcurrentMode,s.ContextConsumer,s.ContextProvider,s.Element,s.ForwardRef,s.Fragment,s.Lazy,s.Memo,s.Portal,s.Profiler,s.StrictMode,s.Suspense,s.isValidElementType,s.isAsyncMode,s.isConcurrentMode,s.isContextConsumer,s.isContextProvider,s.isElement,s.isForwardRef,s.isFragment,s.isLazy,s.isMemo,s.isPortal,s.isProfiler,s.isStrictMode,s.isSuspense;var u=n(function(e){e.exports=s}),p={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},f={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},c={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},h={};function m(e){return u.isMemo(e)?c:h[e.$$typeof]||p}h[u.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var y=Object.defineProperty,d=Object.getOwnPropertyNames,v=Object.getOwnPropertySymbols,E=Object.getOwnPropertyDescriptor,b=Object.getPrototypeOf,g=Object.prototype;function L(o){function e(t,n){return a.createElement(C,null,function(e){return a.createElement(o,r({},t,{leaflet:e,ref:n}))})}var t=o.displayName||o.name||"Component";e.displayName="Leaflet(".concat(t,")");var n=l.forwardRef(e);return k(n,o),n}var k=function e(t,n,o){if("string"==typeof n)return t;if(g){var l=b(n);l&&l!==g&&e(t,l,o)}var r=d(n);v&&(r=r.concat(v(n)));for(var a=m(t),i=m(n),s=0;s<r.length;++s){var u=r[s];if(!(f[u]||o&&o[u]||i&&i[u]||a&&a[u])){var p=E(n,u);try{y(t,u,p)}catch(e){}}}return t},O=l.createContext({}),C=O.Consumer,x=O.Provider;var w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function P(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var S=function(e,t,n){return t&&P(e.prototype,t),n&&P(e,n),e},_=n(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=o=function(e){return n(e)}:t.exports=o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},o(e)}t.exports=o});var M=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};var j=function(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?M(e):t},U=n(function(t){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}t.exports=n}),V=n(function(n){function o(e,t){return n.exports=o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}n.exports=o});var D=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&V(e,t)};var T=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},z=function(e){function n(e){var t;return w(this,n),t=j(this,U(n).call(this,e)),T(M(t),"leafletElement",void 0),t.leafletElement=t.createLeafletElement(t.props),t}return D(n,e),S(n,[{key:"createLeafletElement",value:function(e){throw new Error("createLeafletElement() must be implemented")}},{key:"updateLeafletElement",value:function(e,t){t.position!==e.position&&this.leafletElement.setPosition(t.position)}},{key:"componentDidMount",value:function(){this.leafletElement.addTo(this.props.leaflet.map)}},{key:"componentDidUpdate",value:function(e){this.updateLeafletElement(e,this.props)}},{key:"componentWillUnmount",value:function(){this.leafletElement.remove()}},{key:"render",value:function(){return null}}]),n}(l.Component),Z=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,z),S(t,[{key:"createLeafletElement",value:function(e){return new i.Control.Attribution(e)}}]),t}());var I=function(e,t){if(null==e)return{};var n,o,l={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],0<=t.indexOf(n)||(l[n]=e[n]);return l};var R=function(e,t){if(null==e)return{};var n,o,l=I(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l};var N=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(e){T(t,e,n[e])})}return t};function B(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var n,o,l,r=W(e),a=W(t);if(r&&a){if((o=e.length)!=t.length)return!1;for(n=o;0!=n--;)if(!B(e[n],t[n]))return!1;return!0}if(r!=a)return!1;var i=e instanceof Date,s=t instanceof Date;if(i!=s)return!1;if(i&&s)return e.getTime()==t.getTime();var u=e instanceof RegExp,p=t instanceof RegExp;if(u!=p)return!1;if(u&&p)return e.toString()==t.toString();var f=F(e);if((o=f.length)!==F(t).length)return!1;for(n=o;0!=n--;)if(!G.call(t,f[n]))return!1;for(n=o;0!=n--;)if(!B(e[l=f[n]],t[l]))return!1;return!0}return e!=e&&t!=t}var $=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=U(e)););return e},A=n(function(o){function l(e,t,n){return"undefined"!=typeof Reflect&&Reflect.get?o.exports=l=Reflect.get:o.exports=l=function(e,t,n){var o=$(e,t);if(o){var l=Object.getOwnPropertyDescriptor(o,t);return l.get?l.get.call(n):l.value}},l(e,t,n||e)}o.exports=l}),W=Array.isArray,F=Object.keys,G=Object.prototype.hasOwnProperty,q=/^on(.+)$/i,J=function(e){function n(e){var t;return w(this,n),t=j(this,U(n).call(this,e)),T(M(t),"_leafletEvents",void 0),T(M(t),"leafletElement",void 0),t._leafletEvents=t.extractLeafletEvents(e),t}return D(n,e),S(n,[{key:"componentDidMount",value:function(){this.bindLeafletEvents(this._leafletEvents)}},{key:"componentDidUpdate",value:function(e){this._leafletEvents=this.bindLeafletEvents(this.extractLeafletEvents(this.props),this._leafletEvents)}},{key:"componentWillUnmount",value:function(){var t=this,n=this.leafletElement;n&&Object.keys(this._leafletEvents).forEach(function(e){n.off(e,t._leafletEvents[e])})}},{key:"extractLeafletEvents",value:function(n){return Object.keys(n).reduce(function(e,t){q.test(t)&&null!=n[t]&&(e[t.replace(q,function(e,t){return t.toLowerCase()})]=n[t]);return e},{})}},{key:"bindLeafletEvents",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},o=this.leafletElement;if(null==o||null==o.on)return{};var l=N({},n);return Object.keys(n).forEach(function(e){null!=t[e]&&n[e]===t[e]||(delete l[e],o.off(e,n[e]))}),Object.keys(t).forEach(function(e){null!=n[e]&&t[e]===n[e]||(l[e]=t[e],o.on(e,t[e]))}),l}},{key:"fireLeafletEvent",value:function(e,t){var n=this.leafletElement;n&&n.fire(e,t)}}]),n}(l.Component),H=function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,J),S(t,[{key:"getOptions",value:function(e){return null!=e.pane?e:null!=e.leaflet&&null!=e.leaflet.pane?N({},e,{pane:e.leaflet.pane}):e}}]),t}(),K=function(e){function n(e){var t;return w(this,n),t=j(this,U(n).call(this,e)),T(M(t),"contextValue",void 0),T(M(t),"leafletElement",void 0),t.leafletElement=t.createLeafletElement(e),t}return D(n,H),S(n,[{key:"createLeafletElement",value:function(e){throw new Error("createLeafletElement() must be implemented")}},{key:"updateLeafletElement",value:function(e,t){}},{key:"componentDidMount",value:function(){A(U(n.prototype),"componentDidMount",this).call(this),this.layerContainer.addLayer(this.leafletElement)}},{key:"componentDidUpdate",value:function(e){if(A(U(n.prototype),"componentDidUpdate",this).call(this,e),this.props.attribution!==e.attribution){var t=this.props.leaflet.map;null!=t&&null!=t.attributionControl&&(t.attributionControl.removeAttribution(e.attribution),t.attributionControl.addAttribution(this.props.attribution))}this.updateLeafletElement(e,this.props)}},{key:"componentWillUnmount",value:function(){A(U(n.prototype),"componentWillUnmount",this).call(this),this.layerContainer.removeLayer(this.leafletElement)}},{key:"render",value:function(){var e=this.props.children;return null==e?null:null==this.contextValue?a.createElement(l.Fragment,null,e):a.createElement(x,{value:this.contextValue},e)}},{key:"layerContainer",get:function(){return this.props.leaflet.layerContainer||this.props.leaflet.map}}]),n}();function Q(){return(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"").split(" ").filter(Boolean)}function X(t,e){Q(e).forEach(function(e){i.DomUtil.addClass(t,e)})}function Y(t,e){Q(e).forEach(function(e){i.DomUtil.removeClass(t,e)})}function ee(e,t,n){null!=e&&n!==t&&(null!=t&&0<t.length&&Y(e,t),null!=n&&0<n.length&&X(e,n))}var te=["stroke","color","weight","opacity","lineCap","lineJoin","dashArray","dashOffset","fill","fillColor","fillOpacity","fillRule","bubblingMouseEvents","renderer","className","interactive","pane","attribution"],ne=function(e){function n(e){var t;return w(this,n),null==(t=j(this,U(n).call(this,e))).contextValue&&(t.contextValue=N({},e.leaflet,{popupContainer:t.leafletElement})),t}return D(n,K),S(n,[{key:"componentDidUpdate",value:function(e){A(U(n.prototype),"componentDidUpdate",this).call(this,e),this.setStyleIfChanged(e,this.props)}},{key:"getPathOptions",value:function(e){return function(n,e){return e.reduce(function(e,t){return n[t]&&(e[t]=n[t]),e},{})}(e,te)}},{key:"setStyle",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.leafletElement.setStyle(e)}},{key:"setStyleIfChanged",value:function(e,t){var n=this.getPathOptions(t);B(n,this.getPathOptions(e))||this.setStyle(n)}}]),n}(),oe=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,ne),S(t,[{key:"createLeafletElement",value:function(e){var t=e.center,n=e.radius,o=R(e,["center","radius"]);return new i.Circle(t,n,this.getOptions(o))}},{key:"updateLeafletElement",value:function(e,t){t.center!==e.center&&this.leafletElement.setLatLng(t.center),t.radius!==e.radius&&this.leafletElement.setRadius(t.radius)}}]),t}()),le=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,ne),S(t,[{key:"createLeafletElement",value:function(e){var t=new i.CircleMarker(e.center,this.getOptions(e));return this.contextValue=N({},e.leaflet,{popupContainer:t}),t}},{key:"updateLeafletElement",value:function(e,t){t.center!==e.center&&this.leafletElement.setLatLng(t.center),t.radius!==e.radius&&this.leafletElement.setRadius(t.radius)}}]),t}()),re=function(e){function n(e){var t;return w(this,n),t=j(this,U(n).call(this,e)),T(M(t),"onClose",function(){t.props.onClose&&t.props.onClose()}),T(M(t),"onOpen",function(){t.forceUpdate(),t.props.onOpen&&t.props.onOpen()}),t.leafletElement=t.createLeafletElement(e),t}return D(n,H),S(n,[{key:"createLeafletElement",value:function(e){throw new Error("createLeafletElement() must be implemented")}},{key:"updateLeafletElement",value:function(e,t){}},{key:"componentDidUpdate",value:function(e){ee(this.leafletElement._container,e.className,this.props.className),this.updateLeafletElement(e,this.props),this.leafletElement.isOpen()&&(this.leafletElement.update(),this.onRender())}},{key:"onRender",value:function(){}},{key:"render",value:function(){return this.leafletElement._contentNode?t.createPortal(this.props.children,this.leafletElement._contentNode):null}}]),n}(),ae=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,ne),S(t,[{key:"createLeafletElement",value:function(e){var t=new i.FeatureGroup(this.getOptions(e));return this.contextValue=N({},e.leaflet,{layerContainer:t,popupContainer:t}),t}},{key:"componentDidMount",value:function(){A(U(t.prototype),"componentDidMount",this).call(this),this.setStyle(this.props)}}]),t}()),ie=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,ne),S(t,[{key:"createLeafletElement",value:function(e){return new i.GeoJSON(e.data,this.getOptions(e))}},{key:"updateLeafletElement",value:function(e,t){"function"==typeof t.style?this.setStyle(t.style):this.setStyleIfChanged(e,t)}}]),t}()),se=function(e){function n(){return w(this,n),j(this,U(n).apply(this,arguments))}return D(n,K),S(n,[{key:"createLeafletElement",value:function(e){return new i.GridLayer(this.getOptions(e))}},{key:"updateLeafletElement",value:function(e,t){var n=t.opacity,o=t.zIndex;n!==e.opacity&&this.leafletElement.setOpacity(n),o!==e.zIndex&&this.leafletElement.setZIndex(o)}},{key:"getOptions",value:function(e){var t=A(U(n.prototype),"getOptions",this).call(this,e);return null==e.leaflet.map?t:N({maxZoom:e.leaflet.map.options.maxZoom,minZoom:e.leaflet.map.options.minZoom},t)}},{key:"render",value:function(){return null}}]),n}(),ue=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,K),S(t,[{key:"createLeafletElement",value:function(e){var t=new i.ImageOverlay(e.url,e.bounds,this.getOptions(e));return this.contextValue=N({},e.leaflet,{popupContainer:t}),t}},{key:"updateLeafletElement",value:function(e,t){t.url!==e.url&&this.leafletElement.setUrl(t.url),t.bounds!==e.bounds&&this.leafletElement.setBounds(i.latLngBounds(t.bounds)),t.opacity!==e.opacity&&this.leafletElement.setOpacity(t.opacity),t.zIndex!==e.zIndex&&this.leafletElement.setZIndex(t.zIndex)}}]),t}()),pe=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,K),S(t,[{key:"createLeafletElement",value:function(e){var t=new i.LayerGroup([],this.getOptions(e));return this.contextValue=N({},e.leaflet,{layerContainer:t}),t}}]),t}()),fe=function(e){function r(){var e,t;w(this,r);for(var n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];return t=j(this,(e=U(r)).call.apply(e,[this].concat(o))),T(M(t),"contextValue",void 0),T(M(t),"layer",void 0),t}return D(r,e),S(r,[{key:"componentDidUpdate",value:function(e){var t=e.checked;null!=this.props.leaflet.map&&(!0!==this.props.checked||null!=t&&!1!==t?!0!==t||null!=this.props.checked&&!1!==this.props.checked||this.props.leaflet.map.removeLayer(this.layer):this.props.leaflet.map.addLayer(this.layer))}},{key:"componentWillUnmount",value:function(){this.props.removeLayerControl(this.layer)}},{key:"addLayer",value:function(){throw new Error("Must be implemented in extending class")}},{key:"removeLayer",value:function(e){this.props.removeLayer(e)}},{key:"render",value:function(){var e=this.props.children;return e?a.createElement(x,{value:this.contextValue},e):null}}]),r}(l.Component),ce=function(e){function t(e){var l;return w(this,t),l=j(this,U(t).call(this,e)),T(M(l),"addLayer",function(e){l.layer=e;var t=l.props,n=t.addBaseLayer,o=t.checked;n(e,t.name,o)}),l.contextValue=N({},e.leaflet,{layerContainer:{addLayer:l.addLayer.bind(M(l)),removeLayer:l.removeLayer.bind(M(l))}}),l}return D(t,fe),t}(),he=function(e){function t(e){var l;return w(this,t),l=j(this,U(t).call(this,e)),T(M(l),"addLayer",function(e){l.layer=e;var t=l.props,n=t.addOverlay,o=t.checked;n(e,t.name,o)}),l.contextValue=N({},e.leaflet,{layerContainer:{addLayer:l.addLayer.bind(M(l)),removeLayer:l.removeLayer.bind(M(l))}}),l}return D(t,fe),t}(),me=L(function(e){function n(e){var t;return w(this,n),t=j(this,U(n).call(this,e)),T(M(t),"controlProps",void 0),t.controlProps={addBaseLayer:t.addBaseLayer.bind(M(t)),addOverlay:t.addOverlay.bind(M(t)),leaflet:e.leaflet,removeLayer:t.removeLayer.bind(M(t)),removeLayerControl:t.removeLayerControl.bind(M(t))},t}return D(n,z),S(n,[{key:"createLeafletElement",value:function(e){e.children;var t=R(e,["children"]);return new i.Control.Layers(void 0,void 0,t)}},{key:"updateLeafletElement",value:function(e,t){A(U(n.prototype),"updateLeafletElement",this).call(this,e,t),t.collapsed!==e.collapsed&&(!0===t.collapsed?this.leafletElement.collapse():this.leafletElement.expand())}},{key:"componentWillUnmount",value:function(){var e=this;setTimeout(function(){A(U(n.prototype),"componentWillUnmount",e).call(e)},0)}},{key:"addBaseLayer",value:function(e,t){2<arguments.length&&void 0!==arguments[2]&&arguments[2]&&null!=this.props.leaflet.map&&this.props.leaflet.map.addLayer(e),this.leafletElement.addBaseLayer(e,t)}},{key:"addOverlay",value:function(e,t){2<arguments.length&&void 0!==arguments[2]&&arguments[2]&&null!=this.props.leaflet.map&&this.props.leaflet.map.addLayer(e),this.leafletElement.addOverlay(e,t)}},{key:"removeLayer",value:function(e){null!=this.props.leaflet.map&&this.props.leaflet.map.removeLayer(e)}},{key:"removeLayerControl",value:function(e){this.leafletElement.removeLayer(e)}},{key:"render",value:function(){var t=this,e=l.Children.map(this.props.children,function(e){return e?l.cloneElement(e,t.controlProps):null});return a.createElement(l.Fragment,null,e)}}]),n}());function ye(n){for(var e=arguments.length,o=new Array(1<e?e-1:0),t=1;t<e;t++)o[t-1]=arguments[t];return Object.keys(n).reduce(function(e,t){return-1===o.indexOf(t)&&(e[t]=n[t]),e},{})}me.BaseLayer=ce,me.Overlay=he;function de(e){return Array.isArray(e)?[e[0],e[1]]:[e.lat,e.lon?e.lon:e.lng]}var ve=["children","className","id","style","useFlyTo","whenReady"],Ee=function(e){function n(e){var t;return w(this,n),t=j(this,U(n).call(this,e)),T(M(t),"className",void 0),T(M(t),"contextValue",void 0),T(M(t),"container",void 0),T(M(t),"viewport",{center:void 0,zoom:void 0}),T(M(t),"_ready",!1),T(M(t),"_updating",!1),T(M(t),"onViewportChange",function(){var e=t.leafletElement.getCenter();t.viewport={center:e?[e.lat,e.lng]:void 0,zoom:t.leafletElement.getZoom()},t.props.onViewportChange&&!t._updating&&t.props.onViewportChange(t.viewport)}),T(M(t),"onViewportChanged",function(){t.props.onViewportChanged&&!t._updating&&t.props.onViewportChanged(t.viewport)}),T(M(t),"bindContainer",function(e){t.container=e}),t.className=e.className,t}return D(n,J),S(n,[{key:"createLeafletElement",value:function(e){var t=e.viewport,n=R(e,["viewport"]);return t&&(t.center&&(n.center=t.center),"number"==typeof t.zoom&&(n.zoom=t.zoom)),new i.Map(this.container,n)}},{key:"updateLeafletElement",value:function(e,t){this._updating=!0;var n=t.animate,o=t.bounds,l=t.boundsOptions,r=t.boxZoom,a=t.center,i=t.className,s=t.doubleClickZoom,u=t.dragging,p=t.keyboard,f=t.maxBounds,c=t.scrollWheelZoom,h=t.tap,m=t.touchZoom,y=t.useFlyTo,d=t.viewport,v=t.zoom;if(ee(this.container,e.className,i),d&&d!==e.viewport){var E=d.center?d.center:a,b=null==d.zoom?v:d.zoom;!0===y?this.leafletElement.flyTo(E,b,{animate:n}):this.leafletElement.setView(E,b,{animate:n})}else a&&this.shouldUpdateCenter(a,e.center)?!0===y?this.leafletElement.flyTo(a,v,{animate:n}):this.leafletElement.setView(a,v,{animate:n}):"number"==typeof v&&v!==e.zoom&&(null==e.zoom?this.leafletElement.setView(a,v):this.leafletElement.setZoom(v));f&&this.shouldUpdateBounds(f,e.maxBounds)&&this.leafletElement.setMaxBounds(f),o&&(this.shouldUpdateBounds(o,e.bounds)||l!==e.boundsOptions)&&(!0===y?this.leafletElement.flyToBounds(o,l):this.leafletElement.fitBounds(o,l)),r!==e.boxZoom&&(!0===r?this.leafletElement.boxZoom.enable():this.leafletElement.boxZoom.disable()),s!==e.doubleClickZoom&&(!0===s?this.leafletElement.doubleClickZoom.enable():this.leafletElement.doubleClickZoom.disable()),u!==e.dragging&&(!0===u?this.leafletElement.dragging.enable():this.leafletElement.dragging.disable()),p!==e.keyboard&&(!0===p?this.leafletElement.keyboard.enable():this.leafletElement.keyboard.disable()),c!==e.scrollWheelZoom&&(!0===c||"string"==typeof c?(this.leafletElement.options.scrollWheelZoom=c,this.leafletElement.scrollWheelZoom.enable()):this.leafletElement.scrollWheelZoom.disable()),h!==e.tap&&(!0===h?this.leafletElement.tap.enable():this.leafletElement.tap.disable()),m!==e.touchZoom&&(!0===m||"string"==typeof m?(this.leafletElement.options.touchZoom=m,this.leafletElement.touchZoom.enable()):this.leafletElement.touchZoom.disable()),this._updating=!1}},{key:"componentDidMount",value:function(){var e=ye.apply(void 0,[this.props].concat(ve));this.leafletElement=this.createLeafletElement(e),this.leafletElement.on("move",this.onViewportChange),this.leafletElement.on("moveend",this.onViewportChanged),null!=e.bounds&&this.leafletElement.fitBounds(e.bounds,e.boundsOptions),this.contextValue={layerContainer:this.leafletElement,map:this.leafletElement},A(U(n.prototype),"componentDidMount",this).call(this),this.forceUpdate()}},{key:"componentDidUpdate",value:function(e){!1===this._ready&&(this._ready=!0,this.props.whenReady&&this.leafletElement.whenReady(this.props.whenReady)),A(U(n.prototype),"componentDidUpdate",this).call(this,e),this.updateLeafletElement(e,this.props)}},{key:"componentWillUnmount",value:function(){A(U(n.prototype),"componentWillUnmount",this).call(this),this.leafletElement.off("move",this.onViewportChange),this.leafletElement.off("moveend",this.onViewportChanged),!0===this.props.preferCanvas?(this.leafletElement._initEvents(!0),this.leafletElement._stop()):this.leafletElement.remove()}},{key:"shouldUpdateCenter",value:function(e,t){return!t||(e=de(e),t=de(t),e[0]!==t[0]||e[1]!==t[1])}},{key:"shouldUpdateBounds",value:function(e,t){return!t||!i.latLngBounds(e).equals(i.latLngBounds(t))}},{key:"render",value:function(){return a.createElement("div",{className:this.className,id:this.props.id,ref:this.bindContainer,style:this.props.style},this.contextValue?a.createElement(x,{value:this.contextValue},this.props.children):null)}}]),n}(),be=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,K),S(t,[{key:"createLeafletElement",value:function(e){var t=new i.Marker(e.position,this.getOptions(e));return this.contextValue=N({},e.leaflet,{popupContainer:t}),t}},{key:"updateLeafletElement",value:function(e,t){t.position!==e.position&&this.leafletElement.setLatLng(t.position),t.icon!==e.icon&&this.leafletElement.setIcon(t.icon),t.zIndexOffset!==e.zIndexOffset&&this.leafletElement.setZIndexOffset(t.zIndexOffset),t.opacity!==e.opacity&&this.leafletElement.setOpacity(t.opacity),t.draggable!==e.draggable&&(!0===t.draggable?this.leafletElement.dragging.enable():this.leafletElement.dragging.disable())}},{key:"render",value:function(){var e=this.props.children;return null==e||null==this.contextValue?null:a.createElement(x,{value:this.contextValue},e)}}]),t}()),ge=0,Le=["tile","shadow","overlay","map","marker","tooltip","popup"],ke=/-*pane/gi,Oe={position:"absolute",top:0,right:0,bottom:0,left:0},Ce=L(function(e){function r(){var e,l;w(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return l=j(this,(e=U(r)).call.apply(e,[this].concat(n))),T(M(l),"state",{name:void 0,context:void 0}),T(M(l),"setStyle",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:l.props,t=e.style,n=e.className,o=l.getPane(l.state.name);o&&(n&&X(o,n),t&&Object.keys(t).forEach(function(e){o.style[e]=t[e]}))}),l}return D(r,e),S(r,[{key:"componentDidMount",value:function(){this.createPane(this.props)}},{key:"componentDidUpdate",value:function(e){if(this.state.name)if(this.props.name!==e.name)this.removePane(),this.createPane(this.props);else{if(e.className&&this.props.className!==e.className){var t=this.getPane(this.state.name);null!=t&&null!=e.className&&Y(t,e.className)}this.setStyle(this.props)}}},{key:"componentWillUnmount",value:function(){this.removePane()}},{key:"createPane",value:function(e){var t=e.leaflet.map,n=e.name||"pane-".concat(++ge);null!=t&&null!=t.createPane&&(null==(function(e){return-1!==Le.indexOf(e.replace(ke,""))}(n)||this.getPane(n))&&t.createPane(n,this.getParentPane()),this.setState({name:n,context:N({},e.leaflet,{pane:n})},this.setStyle))}},{key:"removePane",value:function(){var e=this.state.name;if(null!=e){var t=this.getPane(e);null!=t&&t.remove&&t.remove();var n=this.props.leaflet.map;null!=n&&null!=n._panes&&(n._panes=ye(n._panes,e),n._paneRenderers=ye(n._paneRenderers,e))}}},{key:"getParentPane",value:function(){return this.getPane(this.props.pane||this.props.leaflet.pane)}},{key:"getPane",value:function(e){if(null!=e&&null!=this.props.leaflet.map)return this.props.leaflet.map.getPane(e)}},{key:"render",value:function(){var e=this.state.context;return e?a.createElement(x,{value:e},a.createElement("div",{style:Oe},this.props.children)):null}}]),r}(l.Component)),xe=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,ne),S(t,[{key:"createLeafletElement",value:function(e){return new i.Polygon(e.positions,this.getOptions(e))}},{key:"updateLeafletElement",value:function(e,t){t.positions!==e.positions&&this.leafletElement.setLatLngs(t.positions),this.setStyleIfChanged(e,t)}}]),t}()),we=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,ne),S(t,[{key:"createLeafletElement",value:function(e){return new i.Polyline(e.positions,this.getOptions(e))}},{key:"updateLeafletElement",value:function(e,t){t.positions!==e.positions&&this.leafletElement.setLatLngs(t.positions),this.setStyleIfChanged(e,t)}}]),t}()),Pe=function(e){function r(){var e,t;w(this,r);for(var n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];return t=j(this,(e=U(r)).call.apply(e,[this].concat(o))),T(M(t),"onPopupOpen",function(e){e.popup===t.leafletElement&&t.onOpen()}),T(M(t),"onPopupClose",function(e){e.popup===t.leafletElement&&t.onClose()}),T(M(t),"onRender",function(){!1!==t.props.autoPan&&t.leafletElement.isOpen()&&(t.leafletElement._map&&t.leafletElement._map._panAnim&&(t.leafletElement._map._panAnim=void 0),t.leafletElement._adjustPan())}),t}return D(r,re),S(r,[{key:"getOptions",value:function(e){return N({},A(U(r.prototype),"getOptions",this).call(this,e),{autoPan:!1})}},{key:"createLeafletElement",value:function(e){var t=this.getOptions(e);return t.autoPan=!1!==e.autoPan,new i.Popup(t,e.leaflet.popupContainer)}},{key:"updateLeafletElement",value:function(e,t){t.position!==e.position&&this.leafletElement.setLatLng(t.position)}},{key:"componentDidMount",value:function(){var e=this.props.position,t=this.props.leaflet,n=t.map,o=t.popupContainer,l=this.leafletElement;null!=n&&n.on({popupopen:this.onPopupOpen,popupclose:this.onPopupClose}),o?o.bindPopup(l):(e&&l.setLatLng(e),l.openOn(n))}},{key:"componentWillUnmount",value:function(){var e=this.props.leaflet.map;null!=e&&(e.off({popupopen:this.onPopupOpen,popupclose:this.onPopupClose}),e.removeLayer(this.leafletElement)),A(U(r.prototype),"componentWillUnmount",this).call(this)}}]),r}();T(Pe,"defaultProps",{pane:"popupPane"});var Se=L(Pe),_e=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,ne),S(t,[{key:"createLeafletElement",value:function(e){return new i.Rectangle(e.bounds,this.getOptions(e))}},{key:"updateLeafletElement",value:function(e,t){t.bounds!==e.bounds&&this.leafletElement.setBounds(t.bounds),this.setStyleIfChanged(e,t)}}]),t}()),Me=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,z),S(t,[{key:"createLeafletElement",value:function(e){return new i.Control.Scale(e)}}]),t}()),je=L(function(e){function n(){return w(this,n),j(this,U(n).apply(this,arguments))}return D(n,se),S(n,[{key:"createLeafletElement",value:function(e){return new i.TileLayer(e.url,this.getOptions(e))}},{key:"updateLeafletElement",value:function(e,t){A(U(n.prototype),"updateLeafletElement",this).call(this,e,t),t.url!==e.url&&this.leafletElement.setUrl(t.url)}}]),n}()),Ue=function(e){function r(){var e,t;w(this,r);for(var n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];return t=j(this,(e=U(r)).call.apply(e,[this].concat(o))),T(M(t),"onTooltipOpen",function(e){e.tooltip===t.leafletElement&&t.onOpen()}),T(M(t),"onTooltipClose",function(e){e.tooltip===t.leafletElement&&t.onClose()}),t}return D(r,re),S(r,[{key:"createLeafletElement",value:function(e){return new i.Tooltip(this.getOptions(e),e.leaflet.popupContainer)}},{key:"componentDidMount",value:function(){var e=this.props.leaflet.popupContainer;null!=e&&(e.on({tooltipopen:this.onTooltipOpen,tooltipclose:this.onTooltipClose}),e.bindTooltip(this.leafletElement))}},{key:"componentWillUnmount",value:function(){var e=this.props.leaflet.popupContainer;null!=e&&(e.off({tooltipopen:this.onTooltipOpen,tooltipclose:this.onTooltipClose}),null!=e._map&&e.unbindTooltip(this.leafletElement))}}]),r}();T(Ue,"defaultProps",{pane:"tooltipPane"});var Ve=L(Ue),De=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,K),S(t,[{key:"createLeafletElement",value:function(e){return new i.VideoOverlay(e.url,e.bounds,this.getOptions(e))}},{key:"componentDidMount",value:function(){A(U(t.prototype),"componentDidMount",this).call(this),!0===this.props.play&&this.leafletElement.getElement().play()}},{key:"updateLeafletElement",value:function(e,t){t.url!==e.url&&this.leafletElement.setUrl(t.url),t.bounds!==e.bounds&&this.leafletElement.setBounds(i.latLngBounds(t.bounds)),t.opacity!==e.opacity&&this.leafletElement.setOpacity(t.opacity),t.zIndex!==e.zIndex&&this.leafletElement.setZIndex(t.zIndex),!0!==t.play||e.play?t.play||!0!==e.play||this.leafletElement.getElement().pause():this.leafletElement.getElement().play()}}]),t}()),Te=L(function(e){function a(){return w(this,a),j(this,U(a).apply(this,arguments))}return D(a,se),S(a,[{key:"createLeafletElement",value:function(e){var t=e.url,n=R(e,["url"]);return new i.TileLayer.WMS(t,this.getOptions(n))}},{key:"updateLeafletElement",value:function(e,t){A(U(a.prototype),"updateLeafletElement",this).call(this,e,t);var n=e.url,o=(e.opacity,e.zIndex,R(e,["url","opacity","zIndex"])),l=t.url,r=(t.opacity,t.zIndex,R(t,["url","opacity","zIndex"]));l!==n&&this.leafletElement.setUrl(l),B(r,o)||this.leafletElement.setParams(r)}},{key:"getOptions",value:function(e){var n=A(U(a.prototype),"getOptions",this).call(this,e);return Object.keys(n).reduce(function(e,t){return q.test(t)||(e[t]=n[t]),e},{})}}]),a}()),ze=L(function(e){function t(){return w(this,t),j(this,U(t).apply(this,arguments))}return D(t,z),S(t,[{key:"createLeafletElement",value:function(e){return new i.Control.Zoom(e)}}]),t}());e.AttributionControl=Z,e.Circle=oe,e.CircleMarker=le,e.ControlledLayer=fe,e.DivOverlay=re,e.FeatureGroup=ae,e.GeoJSON=ie,e.GridLayer=se,e.ImageOverlay=ue,e.LayerGroup=pe,e.LayersControl=me,e.LeafletConsumer=C,e.LeafletProvider=x,e.Map=Ee,e.MapComponent=H,e.MapControl=z,e.MapEvented=J,e.MapLayer=K,e.Marker=be,e.Pane=Ce,e.Path=ne,e.Polygon=xe,e.Polyline=we,e.Popup=Se,e.Rectangle=_e,e.ScaleControl=Me,e.TileLayer=je,e.Tooltip=Ve,e.VideoOverlay=De,e.WMSTileLayer=Te,e.ZoomControl=ze,e.useLeaflet=function(){return l.useContext(O)},e.withLeaflet=L,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("leaflet"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","leaflet","react-dom"],t):t((e=e||self).ReactLeaflet={},e.React,e.L,e.ReactDOM)}(this,function(e,l,i,t){"use strict";var a="default"in l?l.default:l;function n(e,t){return e(t={exports:{}},t.exports),t.exports}var o,r=n(function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},t.apply(this,arguments)}e.exports=t}),s=n(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103,l=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,i=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,p=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,c=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116;function d(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case p:case f:case r:case i:case a:case h:return e;default:switch(e=e&&e.$$typeof){case u:case c:case s:return e;default:return t}}case y:case m:case l:return t}}}function v(e){return d(e)===f}t.typeOf=d,t.AsyncMode=p,t.ConcurrentMode=f,t.ContextConsumer=u,t.ContextProvider=s,t.Element=o,t.ForwardRef=c,t.Fragment=r,t.Lazy=y,t.Memo=m,t.Portal=l,t.Profiler=i,t.StrictMode=a,t.Suspense=h,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===f||e===i||e===a||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===s||e.$$typeof===u||e.$$typeof===c)},t.isAsyncMode=function(e){return v(e)||d(e)===p},t.isConcurrentMode=v,t.isContextConsumer=function(e){return d(e)===u},t.isContextProvider=function(e){return d(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return d(e)===c},t.isFragment=function(e){return d(e)===r},t.isLazy=function(e){return d(e)===y},t.isMemo=function(e){return d(e)===m},t.isPortal=function(e){return d(e)===l},t.isProfiler=function(e){return d(e)===i},t.isStrictMode=function(e){return d(e)===a},t.isSuspense=function(e){return d(e)===h}});(o=s)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")&&o.default;s.typeOf,s.AsyncMode,s.ConcurrentMode,s.ContextConsumer,s.ContextProvider,s.Element,s.ForwardRef,s.Fragment,s.Lazy,s.Memo,s.Portal,s.Profiler,s.StrictMode,s.Suspense,s.isValidElementType,s.isAsyncMode,s.isConcurrentMode,s.isContextConsumer,s.isContextProvider,s.isElement,s.isForwardRef,s.isFragment,s.isLazy,s.isMemo,s.isPortal,s.isProfiler,s.isStrictMode,s.isSuspense;var u=n(function(e){e.exports=s}),p={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},f={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},c={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},h={};function m(e){return u.isMemo(e)?c:h[e.$$typeof]||p}h[u.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var y=Object.defineProperty,d=Object.getOwnPropertyNames,v=Object.getOwnPropertySymbols,E=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,b=Object.prototype;function L(o){function e(t,n){return a.createElement(C,null,function(e){return a.createElement(o,r({},t,{leaflet:e,ref:n}))})}var t=o.displayName||o.name||"Component";e.displayName="Leaflet(".concat(t,")");var n=l.forwardRef(e);return O(n,o),n}var O=function e(t,n,o){if("string"==typeof n)return t;if(b){var l=g(n);l&&l!==b&&e(t,l,o)}var r=d(n);v&&(r=r.concat(v(n)));for(var a=m(t),i=m(n),s=0;s<r.length;++s){var u=r[s];if(!(f[u]||o&&o[u]||i&&i[u]||a&&a[u])){var p=E(n,u);try{y(t,u,p)}catch(e){}}}return t},k=l.createContext({}),C=k.Consumer,P=k.Provider;var x=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function w(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var S=function(e,t,n){return t&&w(e.prototype,t),n&&w(e,n),e},M=n(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=o=function(e){return n(e)}:t.exports=o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},o(e)}t.exports=o});var _=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};var j=function(e,t){return!t||"object"!==M(t)&&"function"!=typeof t?_(e):t},Z=n(function(t){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}t.exports=n}),U=n(function(n){function o(e,t){return n.exports=o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}n.exports=o});var V=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&U(e,t)};var D=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},T=function(e){function n(e){var t;return x(this,n),t=j(this,Z(n).call(this,e)),D(_(t),"leafletElement",void 0),t.leafletElement=t.createLeafletElement(t.props),t}return V(n,e),S(n,[{key:"createLeafletElement",value:function(e){throw new Error("createLeafletElement() must be implemented")}},{key:"updateLeafletElement",value:function(e,t){t.position!==e.position&&this.leafletElement.setPosition(t.position)}},{key:"componentDidMount",value:function(){this.leafletElement.addTo(this.props.leaflet.map)}},{key:"componentDidUpdate",value:function(e){this.updateLeafletElement(e,this.props)}},{key:"componentWillUnmount",value:function(){this.leafletElement.remove()}},{key:"render",value:function(){return null}}]),n}(l.Component),z=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,T),S(t,[{key:"createLeafletElement",value:function(e){return new i.Control.Attribution(e)}}]),t}());var I=function(e,t){if(null==e)return{};var n,o,l={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],0<=t.indexOf(n)||(l[n]=e[n]);return l};var R=function(e,t){if(null==e)return{};var n,o,l=I(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l};var B=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(e){D(t,e,n[e])})}return t};function N(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var n,o,l,r=A(e),a=A(t);if(r&&a){if((o=e.length)!=t.length)return!1;for(n=o;0!=n--;)if(!N(e[n],t[n]))return!1;return!0}if(r!=a)return!1;var i=e instanceof Date,s=t instanceof Date;if(i!=s)return!1;if(i&&s)return e.getTime()==t.getTime();var u=e instanceof RegExp,p=t instanceof RegExp;if(u!=p)return!1;if(u&&p)return e.toString()==t.toString();var f=W(e);if((o=f.length)!==W(t).length)return!1;for(n=o;0!=n--;)if(!G.call(t,f[n]))return!1;for(n=o;0!=n--;)if(!N(e[l=f[n]],t[l]))return!1;return!0}return e!=e&&t!=t}var $=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Z(e)););return e},F=n(function(o){function l(e,t,n){return"undefined"!=typeof Reflect&&Reflect.get?o.exports=l=Reflect.get:o.exports=l=function(e,t,n){var o=$(e,t);if(o){var l=Object.getOwnPropertyDescriptor(o,t);return l.get?l.get.call(n):l.value}},l(e,t,n||e)}o.exports=l}),A=Array.isArray,W=Object.keys,G=Object.prototype.hasOwnProperty,q=/^on(.+)$/i,J=function(e){function n(e){var t;return x(this,n),t=j(this,Z(n).call(this,e)),D(_(t),"_leafletEvents",void 0),D(_(t),"leafletElement",void 0),t._leafletEvents=t.extractLeafletEvents(e),t}return V(n,e),S(n,[{key:"componentDidMount",value:function(){this.bindLeafletEvents(this._leafletEvents)}},{key:"componentDidUpdate",value:function(e){this._leafletEvents=this.bindLeafletEvents(this.extractLeafletEvents(this.props),this._leafletEvents)}},{key:"componentWillUnmount",value:function(){var t=this,n=this.leafletElement;n&&Object.keys(this._leafletEvents).forEach(function(e){n.off(e,t._leafletEvents[e])})}},{key:"extractLeafletEvents",value:function(n){return Object.keys(n).reduce(function(e,t){q.test(t)&&null!=n[t]&&(e[t.replace(q,function(e,t){return t.toLowerCase()})]=n[t]);return e},{})}},{key:"bindLeafletEvents",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},o=this.leafletElement;if(null==o||null==o.on)return{};var l=B({},n);return Object.keys(n).forEach(function(e){null!=t[e]&&n[e]===t[e]||(delete l[e],o.off(e,n[e]))}),Object.keys(t).forEach(function(e){null!=n[e]&&t[e]===n[e]||(l[e]=t[e],o.on(e,t[e]))}),l}},{key:"fireLeafletEvent",value:function(e,t){var n=this.leafletElement;n&&n.fire(e,t)}}]),n}(l.Component),H=function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,J),S(t,[{key:"getOptions",value:function(e){return null!=e.pane?e:null!=e.leaflet&&null!=e.leaflet.pane?B({},e,{pane:e.leaflet.pane}):e}}]),t}(),K=function(e){function n(e){var t;return x(this,n),t=j(this,Z(n).call(this,e)),D(_(t),"contextValue",void 0),D(_(t),"leafletElement",void 0),t.leafletElement=t.createLeafletElement(e),t}return V(n,H),S(n,[{key:"createLeafletElement",value:function(e){throw new Error("createLeafletElement() must be implemented")}},{key:"updateLeafletElement",value:function(e,t){}},{key:"componentDidMount",value:function(){F(Z(n.prototype),"componentDidMount",this).call(this),this.layerContainer.addLayer(this.leafletElement)}},{key:"componentDidUpdate",value:function(e){if(F(Z(n.prototype),"componentDidUpdate",this).call(this,e),this.props.attribution!==e.attribution){var t=this.props.leaflet.map;null!=t&&null!=t.attributionControl&&(t.attributionControl.removeAttribution(e.attribution),t.attributionControl.addAttribution(this.props.attribution))}this.updateLeafletElement(e,this.props)}},{key:"componentWillUnmount",value:function(){F(Z(n.prototype),"componentWillUnmount",this).call(this),this.layerContainer.removeLayer(this.leafletElement)}},{key:"render",value:function(){var e=this.props.children;return null==e?null:null==this.contextValue?a.createElement(l.Fragment,null,e):a.createElement(P,{value:this.contextValue},e)}},{key:"layerContainer",get:function(){return this.props.leaflet.layerContainer||this.props.leaflet.map}}]),n}();function Q(){return(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"").split(" ").filter(Boolean)}function X(t,e){Q(e).forEach(function(e){i.DomUtil.addClass(t,e)})}function Y(t,e){Q(e).forEach(function(e){i.DomUtil.removeClass(t,e)})}function ee(e,t,n){null!=e&&n!==t&&(null!=t&&0<t.length&&Y(e,t),null!=n&&0<n.length&&X(e,n))}var te=["stroke","color","weight","opacity","lineCap","lineJoin","dashArray","dashOffset","fill","fillColor","fillOpacity","fillRule","bubblingMouseEvents","renderer","className","interactive","pane","attribution"],ne=function(e){function n(e){var t;return x(this,n),null==(t=j(this,Z(n).call(this,e))).contextValue&&(t.contextValue=B({},e.leaflet,{popupContainer:t.leafletElement})),t}return V(n,K),S(n,[{key:"componentDidUpdate",value:function(e){F(Z(n.prototype),"componentDidUpdate",this).call(this,e),this.setStyleIfChanged(e,this.props)}},{key:"getPathOptions",value:function(e){return function(n,e){return e.reduce(function(e,t){return n[t]&&(e[t]=n[t]),e},{})}(e,te)}},{key:"setStyle",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.leafletElement.setStyle(e)}},{key:"setStyleIfChanged",value:function(e,t){var n=this.getPathOptions(t);N(n,this.getPathOptions(e))||this.setStyle(n)}}]),n}(),oe=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,ne),S(t,[{key:"createLeafletElement",value:function(e){var t=e.center,n=e.radius,o=R(e,["center","radius"]);return new i.Circle(t,n,this.getOptions(o))}},{key:"updateLeafletElement",value:function(e,t){t.center!==e.center&&this.leafletElement.setLatLng(t.center),t.radius!==e.radius&&this.leafletElement.setRadius(t.radius)}}]),t}()),le=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,ne),S(t,[{key:"createLeafletElement",value:function(e){var t=new i.CircleMarker(e.center,this.getOptions(e));return this.contextValue=B({},e.leaflet,{popupContainer:t}),t}},{key:"updateLeafletElement",value:function(e,t){t.center!==e.center&&this.leafletElement.setLatLng(t.center),t.radius!==e.radius&&this.leafletElement.setRadius(t.radius)}}]),t}()),re=function(e){function n(e){var t;return x(this,n),t=j(this,Z(n).call(this,e)),D(_(t),"onClose",function(){t.props.onClose&&t.props.onClose()}),D(_(t),"onOpen",function(){t.forceUpdate(),t.props.onOpen&&t.props.onOpen()}),t.leafletElement=t.createLeafletElement(e),t}return V(n,H),S(n,[{key:"createLeafletElement",value:function(e){throw new Error("createLeafletElement() must be implemented")}},{key:"updateLeafletElement",value:function(e,t){}},{key:"componentDidUpdate",value:function(e){ee(this.leafletElement._container,e.className,this.props.className),this.updateLeafletElement(e,this.props),this.leafletElement.isOpen()&&(this.leafletElement.update(),this.onRender())}},{key:"onRender",value:function(){}},{key:"render",value:function(){return this.leafletElement._contentNode?t.createPortal(this.props.children,this.leafletElement._contentNode):null}}]),n}(),ae=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,ne),S(t,[{key:"createLeafletElement",value:function(e){var t=new i.FeatureGroup(this.getOptions(e));return this.contextValue=B({},e.leaflet,{layerContainer:t,popupContainer:t}),t}},{key:"componentDidMount",value:function(){F(Z(t.prototype),"componentDidMount",this).call(this),this.setStyle(this.props)}}]),t}()),ie=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,ne),S(t,[{key:"createLeafletElement",value:function(e){return new i.GeoJSON(e.data,this.getOptions(e))}},{key:"updateLeafletElement",value:function(e,t){"function"==typeof t.style?this.leafletElement.setStyle(t.style):this.setStyleIfChanged(e,t)}}]),t}()),se=function(e){function n(){return x(this,n),j(this,Z(n).apply(this,arguments))}return V(n,K),S(n,[{key:"createLeafletElement",value:function(e){return new i.GridLayer(this.getOptions(e))}},{key:"updateLeafletElement",value:function(e,t){var n=t.opacity,o=t.zIndex;n!==e.opacity&&this.leafletElement.setOpacity(n),o!==e.zIndex&&this.leafletElement.setZIndex(o)}},{key:"getOptions",value:function(e){var t=F(Z(n.prototype),"getOptions",this).call(this,e);return null==e.leaflet.map?t:B({maxZoom:e.leaflet.map.options.maxZoom,minZoom:e.leaflet.map.options.minZoom},t)}},{key:"render",value:function(){return null}}]),n}(),ue=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,K),S(t,[{key:"createLeafletElement",value:function(e){var t=new i.ImageOverlay(e.url,e.bounds,this.getOptions(e));return this.contextValue=B({},e.leaflet,{popupContainer:t}),t}},{key:"updateLeafletElement",value:function(e,t){t.url!==e.url&&this.leafletElement.setUrl(t.url),t.bounds!==e.bounds&&this.leafletElement.setBounds(i.latLngBounds(t.bounds)),t.opacity!==e.opacity&&this.leafletElement.setOpacity(t.opacity),t.zIndex!==e.zIndex&&this.leafletElement.setZIndex(t.zIndex)}}]),t}()),pe=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,K),S(t,[{key:"createLeafletElement",value:function(e){var t=new i.LayerGroup([],this.getOptions(e));return this.contextValue=B({},e.leaflet,{layerContainer:t}),t}}]),t}()),fe=function(e){function r(){var e,t;x(this,r);for(var n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];return t=j(this,(e=Z(r)).call.apply(e,[this].concat(o))),D(_(t),"contextValue",void 0),D(_(t),"layer",void 0),t}return V(r,e),S(r,[{key:"componentDidUpdate",value:function(e){var t=e.checked;null!=this.props.leaflet.map&&(!0!==this.props.checked||null!=t&&!1!==t?!0!==t||null!=this.props.checked&&!1!==this.props.checked||this.props.leaflet.map.removeLayer(this.layer):this.props.leaflet.map.addLayer(this.layer))}},{key:"componentWillUnmount",value:function(){this.props.removeLayerControl(this.layer)}},{key:"addLayer",value:function(){throw new Error("Must be implemented in extending class")}},{key:"removeLayer",value:function(e){this.props.removeLayer(e)}},{key:"render",value:function(){var e=this.props.children;return e?a.createElement(P,{value:this.contextValue},e):null}}]),r}(l.Component),ce=function(e){function t(e){var l;return x(this,t),l=j(this,Z(t).call(this,e)),D(_(l),"addLayer",function(e){l.layer=e;var t=l.props,n=t.addBaseLayer,o=t.checked;n(e,t.name,o)}),l.contextValue=B({},e.leaflet,{layerContainer:{addLayer:l.addLayer.bind(_(l)),removeLayer:l.removeLayer.bind(_(l))}}),l}return V(t,fe),t}(),he=function(e){function t(e){var l;return x(this,t),l=j(this,Z(t).call(this,e)),D(_(l),"addLayer",function(e){l.layer=e;var t=l.props,n=t.addOverlay,o=t.checked;n(e,t.name,o)}),l.contextValue=B({},e.leaflet,{layerContainer:{addLayer:l.addLayer.bind(_(l)),removeLayer:l.removeLayer.bind(_(l))}}),l}return V(t,fe),t}(),me=L(function(e){function n(e){var t;return x(this,n),t=j(this,Z(n).call(this,e)),D(_(t),"controlProps",void 0),t.controlProps={addBaseLayer:t.addBaseLayer.bind(_(t)),addOverlay:t.addOverlay.bind(_(t)),leaflet:e.leaflet,removeLayer:t.removeLayer.bind(_(t)),removeLayerControl:t.removeLayerControl.bind(_(t))},t}return V(n,T),S(n,[{key:"createLeafletElement",value:function(e){e.children;var t=R(e,["children"]);return new i.Control.Layers(void 0,void 0,t)}},{key:"updateLeafletElement",value:function(e,t){F(Z(n.prototype),"updateLeafletElement",this).call(this,e,t),t.collapsed!==e.collapsed&&(!0===t.collapsed?this.leafletElement.collapse():this.leafletElement.expand())}},{key:"componentWillUnmount",value:function(){var e=this;setTimeout(function(){F(Z(n.prototype),"componentWillUnmount",e).call(e)},0)}},{key:"addBaseLayer",value:function(e,t){2<arguments.length&&void 0!==arguments[2]&&arguments[2]&&null!=this.props.leaflet.map&&this.props.leaflet.map.addLayer(e),this.leafletElement.addBaseLayer(e,t)}},{key:"addOverlay",value:function(e,t){2<arguments.length&&void 0!==arguments[2]&&arguments[2]&&null!=this.props.leaflet.map&&this.props.leaflet.map.addLayer(e),this.leafletElement.addOverlay(e,t)}},{key:"removeLayer",value:function(e){null!=this.props.leaflet.map&&this.props.leaflet.map.removeLayer(e)}},{key:"removeLayerControl",value:function(e){this.leafletElement.removeLayer(e)}},{key:"render",value:function(){var t=this,e=l.Children.map(this.props.children,function(e){return e?l.cloneElement(e,t.controlProps):null});return a.createElement(l.Fragment,null,e)}}]),n}());function ye(n){for(var e=arguments.length,o=new Array(1<e?e-1:0),t=1;t<e;t++)o[t-1]=arguments[t];return Object.keys(n).reduce(function(e,t){return-1===o.indexOf(t)&&(e[t]=n[t]),e},{})}me.BaseLayer=ce,me.Overlay=he;function de(e){return Array.isArray(e)?[e[0],e[1]]:[e.lat,e.lon?e.lon:e.lng]}var ve=["children","className","id","style","useFlyTo","whenReady"],Ee=function(e){function n(e){var t;return x(this,n),t=j(this,Z(n).call(this,e)),D(_(t),"className",void 0),D(_(t),"contextValue",void 0),D(_(t),"container",void 0),D(_(t),"viewport",{center:void 0,zoom:void 0}),D(_(t),"_ready",!1),D(_(t),"_updating",!1),D(_(t),"onViewportChange",function(){var e=t.leafletElement.getCenter();t.viewport={center:e?[e.lat,e.lng]:void 0,zoom:t.leafletElement.getZoom()},t.props.onViewportChange&&!t._updating&&t.props.onViewportChange(t.viewport)}),D(_(t),"onViewportChanged",function(){t.props.onViewportChanged&&!t._updating&&t.props.onViewportChanged(t.viewport)}),D(_(t),"bindContainer",function(e){t.container=e}),t.className=e.className,t}return V(n,J),S(n,[{key:"createLeafletElement",value:function(e){var t=e.viewport,n=R(e,["viewport"]);return t&&(t.center&&(n.center=t.center),"number"==typeof t.zoom&&(n.zoom=t.zoom)),new i.Map(this.container,n)}},{key:"updateLeafletElement",value:function(e,t){this._updating=!0;var n=t.bounds,o=t.boundsOptions,l=t.boxZoom,r=t.center,a=t.className,i=t.doubleClickZoom,s=t.dragging,u=t.keyboard,p=t.maxBounds,f=t.scrollWheelZoom,c=t.tap,h=t.touchZoom,m=t.useFlyTo,y=t.viewport,d=t.zoom;if(ee(this.container,e.className,a),y&&y!==e.viewport){var v=y.center?y.center:r,E=null==y.zoom?d:y.zoom;!0===m?this.leafletElement.flyTo(v,E,this.getZoomPanOptions(t)):this.leafletElement.setView(v,E,this.getZoomPanOptions(t))}else r&&this.shouldUpdateCenter(r,e.center)?!0===m?this.leafletElement.flyTo(r,d,this.getZoomPanOptions(t)):this.leafletElement.setView(r,d,this.getZoomPanOptions(t)):"number"==typeof d&&d!==e.zoom&&(null==e.zoom?this.leafletElement.setView(r,d,this.getZoomPanOptions(t)):this.leafletElement.setZoom(d,this.getZoomPanOptions(t)));p&&this.shouldUpdateBounds(p,e.maxBounds)&&this.leafletElement.setMaxBounds(p),n&&(this.shouldUpdateBounds(n,e.bounds)||o!==e.boundsOptions)&&(!0===m?this.leafletElement.flyToBounds(n,this.getFitBoundsOptions(t)):this.leafletElement.fitBounds(n,this.getFitBoundsOptions(t))),l!==e.boxZoom&&(!0===l?this.leafletElement.boxZoom.enable():this.leafletElement.boxZoom.disable()),i!==e.doubleClickZoom&&(!0===i?this.leafletElement.doubleClickZoom.enable():this.leafletElement.doubleClickZoom.disable()),s!==e.dragging&&(!0===s?this.leafletElement.dragging.enable():this.leafletElement.dragging.disable()),u!==e.keyboard&&(!0===u?this.leafletElement.keyboard.enable():this.leafletElement.keyboard.disable()),f!==e.scrollWheelZoom&&(!0===f||"string"==typeof f?(this.leafletElement.options.scrollWheelZoom=f,this.leafletElement.scrollWheelZoom.enable()):this.leafletElement.scrollWheelZoom.disable()),c!==e.tap&&(!0===c?this.leafletElement.tap.enable():this.leafletElement.tap.disable()),h!==e.touchZoom&&(!0===h||"string"==typeof h?(this.leafletElement.options.touchZoom=h,this.leafletElement.touchZoom.enable()):this.leafletElement.touchZoom.disable()),this._updating=!1}},{key:"getZoomPanOptions",value:function(e){return{animate:e.animate,duration:e.duration,easeLinearity:e.easeLinearity,noMoveStart:e.noMoveStart}}},{key:"getFitBoundsOptions",value:function(e){var t=this.getZoomPanOptions(e);return B({},t,e.boundsOptions)}},{key:"componentDidMount",value:function(){var e=ye.apply(void 0,[this.props].concat(ve));this.leafletElement=this.createLeafletElement(e),this.leafletElement.on("move",this.onViewportChange),this.leafletElement.on("moveend",this.onViewportChanged),null!=e.bounds&&this.leafletElement.fitBounds(e.bounds,this.getFitBoundsOptions(e)),this.contextValue={layerContainer:this.leafletElement,map:this.leafletElement},F(Z(n.prototype),"componentDidMount",this).call(this),this.forceUpdate()}},{key:"componentDidUpdate",value:function(e){!1===this._ready&&(this._ready=!0,this.props.whenReady&&this.leafletElement.whenReady(this.props.whenReady)),F(Z(n.prototype),"componentDidUpdate",this).call(this,e),this.updateLeafletElement(e,this.props)}},{key:"componentWillUnmount",value:function(){F(Z(n.prototype),"componentWillUnmount",this).call(this),this.leafletElement.off("move",this.onViewportChange),this.leafletElement.off("moveend",this.onViewportChanged),!0===this.props.preferCanvas?(this.leafletElement._initEvents(!0),this.leafletElement._stop()):this.leafletElement.remove()}},{key:"shouldUpdateCenter",value:function(e,t){return!t||(e=de(e),t=de(t),e[0]!==t[0]||e[1]!==t[1])}},{key:"shouldUpdateBounds",value:function(e,t){return!t||!i.latLngBounds(e).equals(i.latLngBounds(t))}},{key:"render",value:function(){return a.createElement("div",{className:this.className,id:this.props.id,ref:this.bindContainer,style:this.props.style},this.contextValue?a.createElement(P,{value:this.contextValue},this.props.children):null)}}]),n}(),ge=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,K),S(t,[{key:"createLeafletElement",value:function(e){var t=new i.Marker(e.position,this.getOptions(e));return this.contextValue=B({},e.leaflet,{popupContainer:t}),t}},{key:"updateLeafletElement",value:function(e,t){t.position!==e.position&&this.leafletElement.setLatLng(t.position),t.icon!==e.icon&&this.leafletElement.setIcon(t.icon),t.zIndexOffset!==e.zIndexOffset&&this.leafletElement.setZIndexOffset(t.zIndexOffset),t.opacity!==e.opacity&&this.leafletElement.setOpacity(t.opacity),t.draggable!==e.draggable&&(!0===t.draggable?this.leafletElement.dragging.enable():this.leafletElement.dragging.disable())}},{key:"render",value:function(){var e=this.props.children;return null==e||null==this.contextValue?null:a.createElement(P,{value:this.contextValue},e)}}]),t}()),be=0,Le=["tile","shadow","overlay","map","marker","tooltip","popup"],Oe=/-*pane/gi,ke={position:"absolute",top:0,right:0,bottom:0,left:0},Ce=L(function(e){function r(){var e,l;x(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return l=j(this,(e=Z(r)).call.apply(e,[this].concat(n))),D(_(l),"state",{name:void 0,context:void 0}),D(_(l),"setStyle",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:l.props,t=e.style,n=e.className,o=l.getPane(l.state.name);o&&(n&&X(o,n),t&&Object.keys(t).forEach(function(e){o.style[e]=t[e]}))}),l}return V(r,e),S(r,[{key:"componentDidMount",value:function(){this.createPane(this.props)}},{key:"componentDidUpdate",value:function(e){if(this.state.name)if(this.props.name!==e.name)this.removePane(),this.createPane(this.props);else{if(e.className&&this.props.className!==e.className){var t=this.getPane(this.state.name);null!=t&&null!=e.className&&Y(t,e.className)}this.setStyle(this.props)}}},{key:"componentWillUnmount",value:function(){this.removePane()}},{key:"createPane",value:function(e){var t=e.leaflet.map,n=e.name||"pane-".concat(++be);null!=t&&null!=t.createPane&&(null==(function(e){return-1!==Le.indexOf(e.replace(Oe,""))}(n)||this.getPane(n))&&t.createPane(n,this.getParentPane()),this.setState({name:n,context:B({},e.leaflet,{pane:n})},this.setStyle))}},{key:"removePane",value:function(){var e=this.state.name;if(null!=e){var t=this.getPane(e);null!=t&&t.remove&&t.remove();var n=this.props.leaflet.map;null!=n&&null!=n._panes&&(n._panes=ye(n._panes,e),n._paneRenderers=ye(n._paneRenderers,e))}}},{key:"getParentPane",value:function(){return this.getPane(this.props.pane||this.props.leaflet.pane)}},{key:"getPane",value:function(e){if(null!=e&&null!=this.props.leaflet.map)return this.props.leaflet.map.getPane(e)}},{key:"render",value:function(){var e=this.state.context;return e?a.createElement(P,{value:e},a.createElement("div",{style:ke},this.props.children)):null}}]),r}(l.Component)),Pe=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,ne),S(t,[{key:"createLeafletElement",value:function(e){return new i.Polygon(e.positions,this.getOptions(e))}},{key:"updateLeafletElement",value:function(e,t){t.positions!==e.positions&&this.leafletElement.setLatLngs(t.positions),this.setStyleIfChanged(e,t)}}]),t}()),xe=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,ne),S(t,[{key:"createLeafletElement",value:function(e){return new i.Polyline(e.positions,this.getOptions(e))}},{key:"updateLeafletElement",value:function(e,t){t.positions!==e.positions&&this.leafletElement.setLatLngs(t.positions),this.setStyleIfChanged(e,t)}}]),t}()),we=function(e){function r(){var e,t;x(this,r);for(var n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];return t=j(this,(e=Z(r)).call.apply(e,[this].concat(o))),D(_(t),"onPopupOpen",function(e){e.popup===t.leafletElement&&t.onOpen()}),D(_(t),"onPopupClose",function(e){e.popup===t.leafletElement&&t.onClose()}),D(_(t),"onRender",function(){!1!==t.props.autoPan&&t.leafletElement.isOpen()&&(t.leafletElement._map&&t.leafletElement._map._panAnim&&(t.leafletElement._map._panAnim=void 0),t.leafletElement._adjustPan())}),t}return V(r,re),S(r,[{key:"getOptions",value:function(e){return B({},F(Z(r.prototype),"getOptions",this).call(this,e),{autoPan:!1})}},{key:"createLeafletElement",value:function(e){var t=this.getOptions(e);return t.autoPan=!1!==e.autoPan,new i.Popup(t,e.leaflet.popupContainer)}},{key:"updateLeafletElement",value:function(e,t){t.position!==e.position&&this.leafletElement.setLatLng(t.position)}},{key:"componentDidMount",value:function(){var e=this.props.position,t=this.props.leaflet,n=t.map,o=t.popupContainer,l=this.leafletElement;null!=n&&n.on({popupopen:this.onPopupOpen,popupclose:this.onPopupClose}),o?o.bindPopup(l):(e&&l.setLatLng(e),l.openOn(n))}},{key:"componentWillUnmount",value:function(){var e=this.props.leaflet.map;null!=e&&(e.off({popupopen:this.onPopupOpen,popupclose:this.onPopupClose}),e.removeLayer(this.leafletElement)),F(Z(r.prototype),"componentWillUnmount",this).call(this)}}]),r}();D(we,"defaultProps",{pane:"popupPane"});var Se=L(we),Me=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,ne),S(t,[{key:"createLeafletElement",value:function(e){return new i.Rectangle(e.bounds,this.getOptions(e))}},{key:"updateLeafletElement",value:function(e,t){t.bounds!==e.bounds&&this.leafletElement.setBounds(t.bounds),this.setStyleIfChanged(e,t)}}]),t}()),_e=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,T),S(t,[{key:"createLeafletElement",value:function(e){return new i.Control.Scale(e)}}]),t}()),je=L(function(e){function n(){return x(this,n),j(this,Z(n).apply(this,arguments))}return V(n,se),S(n,[{key:"createLeafletElement",value:function(e){return new i.TileLayer(e.url,this.getOptions(e))}},{key:"updateLeafletElement",value:function(e,t){F(Z(n.prototype),"updateLeafletElement",this).call(this,e,t),t.url!==e.url&&this.leafletElement.setUrl(t.url)}}]),n}()),Ze=function(e){function r(){var e,t;x(this,r);for(var n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];return t=j(this,(e=Z(r)).call.apply(e,[this].concat(o))),D(_(t),"onTooltipOpen",function(e){e.tooltip===t.leafletElement&&t.onOpen()}),D(_(t),"onTooltipClose",function(e){e.tooltip===t.leafletElement&&t.onClose()}),t}return V(r,re),S(r,[{key:"createLeafletElement",value:function(e){return new i.Tooltip(this.getOptions(e),e.leaflet.popupContainer)}},{key:"componentDidMount",value:function(){var e=this.props.leaflet.popupContainer;null!=e&&(e.on({tooltipopen:this.onTooltipOpen,tooltipclose:this.onTooltipClose}),e.bindTooltip(this.leafletElement))}},{key:"componentWillUnmount",value:function(){var e=this.props.leaflet.popupContainer;null!=e&&(e.off({tooltipopen:this.onTooltipOpen,tooltipclose:this.onTooltipClose}),null!=e._map&&e.unbindTooltip(this.leafletElement))}}]),r}();D(Ze,"defaultProps",{pane:"tooltipPane"});var Ue=L(Ze),Ve=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,K),S(t,[{key:"createLeafletElement",value:function(e){return new i.VideoOverlay(e.url,e.bounds,this.getOptions(e))}},{key:"componentDidMount",value:function(){F(Z(t.prototype),"componentDidMount",this).call(this),!0===this.props.play&&this.leafletElement.getElement().play()}},{key:"updateLeafletElement",value:function(e,t){t.url!==e.url&&this.leafletElement.setUrl(t.url),t.bounds!==e.bounds&&this.leafletElement.setBounds(i.latLngBounds(t.bounds)),t.opacity!==e.opacity&&this.leafletElement.setOpacity(t.opacity),t.zIndex!==e.zIndex&&this.leafletElement.setZIndex(t.zIndex),!0!==t.play||e.play?t.play||!0!==e.play||this.leafletElement.getElement().pause():this.leafletElement.getElement().play()}}]),t}()),De=L(function(e){function a(){return x(this,a),j(this,Z(a).apply(this,arguments))}return V(a,se),S(a,[{key:"createLeafletElement",value:function(e){var t=e.url,n=R(e,["url"]);return new i.TileLayer.WMS(t,this.getOptions(n))}},{key:"updateLeafletElement",value:function(e,t){F(Z(a.prototype),"updateLeafletElement",this).call(this,e,t);var n=e.url,o=(e.opacity,e.zIndex,R(e,["url","opacity","zIndex"])),l=t.url,r=(t.opacity,t.zIndex,R(t,["url","opacity","zIndex"]));l!==n&&this.leafletElement.setUrl(l),N(r,o)||this.leafletElement.setParams(r)}},{key:"getOptions",value:function(e){var n=F(Z(a.prototype),"getOptions",this).call(this,e);return Object.keys(n).reduce(function(e,t){return q.test(t)||(e[t]=n[t]),e},{})}}]),a}()),Te=L(function(e){function t(){return x(this,t),j(this,Z(t).apply(this,arguments))}return V(t,T),S(t,[{key:"createLeafletElement",value:function(e){return new i.Control.Zoom(e)}}]),t}());e.AttributionControl=z,e.Circle=oe,e.CircleMarker=le,e.ControlledLayer=fe,e.DivOverlay=re,e.FeatureGroup=ae,e.GeoJSON=ie,e.GridLayer=se,e.ImageOverlay=ue,e.LayerGroup=pe,e.LayersControl=me,e.LeafletConsumer=C,e.LeafletProvider=P,e.Map=Ee,e.MapComponent=H,e.MapControl=T,e.MapEvented=J,e.MapLayer=K,e.Marker=ge,e.Pane=Ce,e.Path=ne,e.Polygon=Pe,e.Polyline=xe,e.Popup=Se,e.Rectangle=Me,e.ScaleControl=_e,e.TileLayer=je,e.Tooltip=Ue,e.VideoOverlay=Ve,e.WMSTileLayer=De,e.ZoomControl=Te,e.useLeaflet=function(){return l.useContext(k)},e.withLeaflet=L,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -25,3 +25,3 @@ "use strict";

if (typeof toProps.style === 'function') {
this.setStyle(toProps.style);
this.leafletElement.setStyle(toProps.style);
} else {

@@ -28,0 +28,0 @@ this.setStyleIfChanged(fromProps, toProps);

"use strict";
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";

@@ -92,4 +93,3 @@ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";

this._updating = true;
var animate = toProps.animate,
bounds = toProps.bounds,
var bounds = toProps.bounds,
boundsOptions = toProps.boundsOptions,

@@ -116,25 +116,17 @@ boxZoom = toProps.boxZoom,

if (useFlyTo === true) {
this.leafletElement.flyTo(c, z, {
animate: animate
});
this.leafletElement.flyTo(c, z, this.getZoomPanOptions(toProps));
} else {
this.leafletElement.setView(c, z, {
animate: animate
});
this.leafletElement.setView(c, z, this.getZoomPanOptions(toProps));
}
} else if (center && this.shouldUpdateCenter(center, fromProps.center)) {
if (useFlyTo === true) {
this.leafletElement.flyTo(center, zoom, {
animate: animate
});
this.leafletElement.flyTo(center, zoom, this.getZoomPanOptions(toProps));
} else {
this.leafletElement.setView(center, zoom, {
animate: animate
});
this.leafletElement.setView(center, zoom, this.getZoomPanOptions(toProps));
}
} else if (typeof zoom === 'number' && zoom !== fromProps.zoom) {
if (fromProps.zoom == null) {
this.leafletElement.setView(center, zoom);
this.leafletElement.setView(center, zoom, this.getZoomPanOptions(toProps));
} else {
this.leafletElement.setZoom(zoom);
this.leafletElement.setZoom(zoom, this.getZoomPanOptions(toProps));
}

@@ -149,5 +141,5 @@ }

if (useFlyTo === true) {
this.leafletElement.flyToBounds(bounds, boundsOptions);
this.leafletElement.flyToBounds(bounds, this.getFitBoundsOptions(toProps));
} else {
this.leafletElement.fitBounds(bounds, boundsOptions);
this.leafletElement.fitBounds(bounds, this.getFitBoundsOptions(toProps));
}

@@ -217,2 +209,20 @@ }

_proto.getZoomPanOptions = function getZoomPanOptions(props) {
var animate = props.animate,
duration = props.duration,
easeLinearity = props.easeLinearity,
noMoveStart = props.noMoveStart;
return {
animate: animate,
duration: duration,
easeLinearity: easeLinearity,
noMoveStart: noMoveStart
};
};
_proto.getFitBoundsOptions = function getFitBoundsOptions(props) {
var zoomPanOptions = this.getZoomPanOptions(props);
return _extends({}, zoomPanOptions, props.boundsOptions);
};
_proto.componentDidMount = function componentDidMount() {

@@ -225,3 +235,3 @@ var props = omit.apply(void 0, [this.props].concat(OTHER_PROPS));

if (props.bounds != null) {
this.leafletElement.fitBounds(props.bounds, props.boundsOptions);
this.leafletElement.fitBounds(props.bounds, this.getFitBoundsOptions(props));
}

@@ -228,0 +238,0 @@

@@ -33,3 +33,3 @@ "use strict";

if (typeof toProps.style === 'function') {
this.setStyle(toProps.style);
this.leafletElement.setStyle(toProps.style);
} else {

@@ -36,0 +36,0 @@ this.setStyleIfChanged(fromProps, toProps);

@@ -8,2 +8,4 @@ "use strict";

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));

@@ -98,4 +100,3 @@

this._updating = true;
var animate = toProps.animate,
bounds = toProps.bounds,
var bounds = toProps.bounds,
boundsOptions = toProps.boundsOptions,

@@ -122,25 +123,17 @@ boxZoom = toProps.boxZoom,

if (useFlyTo === true) {
this.leafletElement.flyTo(c, z, {
animate: animate
});
this.leafletElement.flyTo(c, z, this.getZoomPanOptions(toProps));
} else {
this.leafletElement.setView(c, z, {
animate: animate
});
this.leafletElement.setView(c, z, this.getZoomPanOptions(toProps));
}
} else if (center && this.shouldUpdateCenter(center, fromProps.center)) {
if (useFlyTo === true) {
this.leafletElement.flyTo(center, zoom, {
animate: animate
});
this.leafletElement.flyTo(center, zoom, this.getZoomPanOptions(toProps));
} else {
this.leafletElement.setView(center, zoom, {
animate: animate
});
this.leafletElement.setView(center, zoom, this.getZoomPanOptions(toProps));
}
} else if (typeof zoom === 'number' && zoom !== fromProps.zoom) {
if (fromProps.zoom == null) {
this.leafletElement.setView(center, zoom);
this.leafletElement.setView(center, zoom, this.getZoomPanOptions(toProps));
} else {
this.leafletElement.setZoom(zoom);
this.leafletElement.setZoom(zoom, this.getZoomPanOptions(toProps));
}

@@ -155,5 +148,5 @@ }

if (useFlyTo === true) {
this.leafletElement.flyToBounds(bounds, boundsOptions);
this.leafletElement.flyToBounds(bounds, this.getFitBoundsOptions(toProps));
} else {
this.leafletElement.fitBounds(bounds, boundsOptions);
this.leafletElement.fitBounds(bounds, this.getFitBoundsOptions(toProps));
}

@@ -223,2 +216,20 @@ }

_proto.getZoomPanOptions = function getZoomPanOptions(props) {
var animate = props.animate,
duration = props.duration,
easeLinearity = props.easeLinearity,
noMoveStart = props.noMoveStart;
return {
animate: animate,
duration: duration,
easeLinearity: easeLinearity,
noMoveStart: noMoveStart
};
};
_proto.getFitBoundsOptions = function getFitBoundsOptions(props) {
var zoomPanOptions = this.getZoomPanOptions(props);
return (0, _extends2.default)({}, zoomPanOptions, props.boundsOptions);
};
_proto.componentDidMount = function componentDidMount() {

@@ -232,3 +243,3 @@ var props = _omit.default.apply(void 0, [this.props].concat(OTHER_PROPS));

if (props.bounds != null) {
this.leafletElement.fitBounds(props.bounds, props.boundsOptions);
this.leafletElement.fitBounds(props.bounds, this.getFitBoundsOptions(props));
}

@@ -235,0 +246,0 @@

{
"name": "react-leaflet",
"version": "2.3.0",
"version": "2.4.0",
"description": "React components for Leaflet maps",

@@ -52,3 +52,3 @@ "main": "lib/index.js",

"dependencies": {
"@babel/runtime": "^7.4.4",
"@babel/runtime": "^7.4.5",
"fast-deep-equal": "^2.0.1",

@@ -65,3 +65,3 @@ "hoist-non-react-statics": "^3.3.0",

"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.4.4",

@@ -72,3 +72,3 @@ "@babel/plugin-proposal-export-default-from": "^7.2.0",

"@babel/plugin-transform-strict-mode": "^7.2.0",
"@babel/preset-env": "^7.4.4",
"@babel/preset-env": "^7.4.5",
"@babel/preset-flow": "^7.0.0",

@@ -82,16 +82,16 @@ "@babel/preset-react": "^7.0.0",

"eslint": "^5.16.0",
"eslint-config-prettier": "^4.2.0",
"eslint-plugin-flowtype": "^3.8.2",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-node": "^9.0.1",
"eslint-config-prettier": "^4.3.0",
"eslint-plugin-flowtype": "^3.9.1",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-node": "^9.1.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-react": "^7.13.0",
"file-loader": "^3.0.1",
"flow-bin": "^0.98.1",
"flow-copy-source": "^2.0.4",
"flow-typed": "^2.5.1",
"file-loader": "^4.0.0",
"flow-bin": "^0.100.0",
"flow-copy-source": "^2.0.6",
"flow-typed": "^2.5.2",
"jest": "^24.8.0",
"leaflet": "^1.5.1",
"prettier": "^1.17.0",
"prettier": "^1.18.2",
"prettier-eslint": "^8.8.2",

@@ -101,11 +101,11 @@ "react": "^16.8.6",

"rimraf": "^2.6.2",
"rollup": "^1.11.3",
"rollup": "^1.14.5",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-node-resolve": "^4.2.4",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-node-resolve": "^5.0.1",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-uglify": "^6.0.2",
"webpack": "^4.30.0",
"webpack-cli": "^3.3.2",
"webpack-dev-server": "^3.3.1"
"webpack": "^4.33.0",
"webpack-cli": "^3.3.3",
"webpack-dev-server": "^3.7.1"
},

@@ -112,0 +112,0 @@ "jest": {

@@ -29,3 +29,3 @@ // @flow

if (typeof toProps.style === 'function') {
this.setStyle(toProps.style)
this.leafletElement.setStyle(toProps.style)
} else {

@@ -32,0 +32,0 @@ this.setStyleIfChanged(fromProps, toProps)

@@ -83,4 +83,6 @@ // @flow

animate?: boolean,
duration?: number,
noMoveStart?: boolean,
bounds?: LatLngBounds,
boundsOptions?: {
boundsOptions?: {|
paddingTopLeft?: Point,

@@ -90,3 +92,3 @@ paddingBottomRight?: Point,

maxZoom?: number,
},
|},
children: Node,

@@ -135,3 +137,2 @@ className?: string,

const {
animate,
bounds,

@@ -160,17 +161,25 @@ boundsOptions,

if (useFlyTo === true) {
this.leafletElement.flyTo(c, z, { animate })
this.leafletElement.flyTo(c, z, this.getZoomPanOptions(toProps))
} else {
this.leafletElement.setView(c, z, { animate })
this.leafletElement.setView(c, z, this.getZoomPanOptions(toProps))
}
} else if (center && this.shouldUpdateCenter(center, fromProps.center)) {
if (useFlyTo === true) {
this.leafletElement.flyTo(center, zoom, { animate })
this.leafletElement.flyTo(center, zoom, this.getZoomPanOptions(toProps))
} else {
this.leafletElement.setView(center, zoom, { animate })
this.leafletElement.setView(
center,
zoom,
this.getZoomPanOptions(toProps),
)
}
} else if (typeof zoom === 'number' && zoom !== fromProps.zoom) {
if (fromProps.zoom == null) {
this.leafletElement.setView(center, zoom)
this.leafletElement.setView(
center,
zoom,
this.getZoomPanOptions(toProps),
)
} else {
this.leafletElement.setZoom(zoom)
this.leafletElement.setZoom(zoom, this.getZoomPanOptions(toProps))
}

@@ -189,5 +198,8 @@ }

if (useFlyTo === true) {
this.leafletElement.flyToBounds(bounds, boundsOptions)
this.leafletElement.flyToBounds(
bounds,
this.getFitBoundsOptions(toProps),
)
} else {
this.leafletElement.fitBounds(bounds, boundsOptions)
this.leafletElement.fitBounds(bounds, this.getFitBoundsOptions(toProps))
}

@@ -257,2 +269,20 @@ }

getZoomPanOptions(props: Props) {
const { animate, duration, easeLinearity, noMoveStart } = props
return {
animate,
duration,
easeLinearity,
noMoveStart,
}
}
getFitBoundsOptions(props: Props) {
const zoomPanOptions = this.getZoomPanOptions(props)
return {
...zoomPanOptions,
...props.boundsOptions,
}
}
onViewportChange = () => {

@@ -283,3 +313,6 @@ const center = this.leafletElement.getCenter()

if (props.bounds != null) {
this.leafletElement.fitBounds(props.bounds, props.boundsOptions)
this.leafletElement.fitBounds(
props.bounds,
this.getFitBoundsOptions(props),
)
}

@@ -286,0 +319,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc