diff --git a/.babelrc b/.babelrc index 29932a67..22b3530d 100644 --- a/.babelrc +++ b/.babelrc @@ -3,5 +3,10 @@ "es2015", "react", "stage-1" - ] + ], + "plugins": [ + "dev-expression", + "lodash", + "transform-proto-to-assign", + ], } diff --git a/CHANGELOG.md b/CHANGELOG.md index e4e14f03..342b34f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.1.3 (2017-03-15) + +Fixed regressions in `GridLayer` and Babel configuration. + ## v1.1.2 (2017-03-14) Make `GridLayer` inherit `maxZoom` and `minZoom` properties from `Map`. diff --git a/dist/react-leaflet.js b/dist/react-leaflet.js index 36692498..6110e8f5 100644 --- a/dist/react-leaflet.js +++ b/dist/react-leaflet.js @@ -110,23 +110,6 @@ exports.default = _react.PropTypes.oneOfType([_react.PropTypes.arrayOf(_react.Pr "use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _leaflet = __webpack_require__(1); - -var _react = __webpack_require__(0); - -exports.default = _react.PropTypes.instanceOf(_leaflet.Map); - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -207,6 +190,23 @@ Path.childContextTypes = { }; exports.default = Path; +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _leaflet = __webpack_require__(1); + +var _react = __webpack_require__(0); + +exports.default = _react.PropTypes.instanceOf(_leaflet.Map); + /***/ }), /* 5 */ /***/ (function(module, exports) { @@ -291,7 +291,7 @@ var _layerContainer = __webpack_require__(9); var _layerContainer2 = _interopRequireDefault(_layerContainer); -var _map = __webpack_require__(3); +var _map = __webpack_require__(4); var _map2 = _interopRequireDefault(_map); @@ -585,7 +585,7 @@ var _controlPosition = __webpack_require__(8); var _controlPosition2 = _interopRequireDefault(_controlPosition); -var _map = __webpack_require__(3); +var _map = __webpack_require__(4); var _map2 = _interopRequireDefault(_map); @@ -938,10 +938,6 @@ var _children = __webpack_require__(2); var _children2 = _interopRequireDefault(_children); -var _map = __webpack_require__(3); - -var _map2 = _interopRequireDefault(_map); - var _MapLayer2 = __webpack_require__(7); var _MapLayer3 = _interopRequireDefault(_MapLayer2); @@ -966,10 +962,12 @@ var GridLayer = function (_MapLayer) { } GridLayer.prototype.getOptions = function getOptions(props) { - return _extends({ - maxZoom: this.context.map.options.maxZoom, - minZoom: this.context.map.options.minZoom - }, _MapLayer.prototype.getOptions.call(this, props)); + var options = _MapLayer.prototype.getOptions.call(this, props); + var map = this.context.map; + return map ? _extends({ + maxZoom: map.options.maxZoom, + minZoom: map.options.minZoom + }, options) : options; }; GridLayer.prototype.createLeafletElement = function createLeafletElement(props) { @@ -1000,9 +998,6 @@ GridLayer.propTypes = { opacity: _react.PropTypes.number, zIndex: _react.PropTypes.number }; -GridLayer.contextTypes = { - map: _map2.default -}; exports.default = GridLayer; /***/ }), @@ -2113,7 +2108,7 @@ var _latlng = __webpack_require__(6); var _latlng2 = _interopRequireDefault(_latlng); -var _Path2 = __webpack_require__(4); +var _Path2 = __webpack_require__(3); var _Path3 = _interopRequireDefault(_Path2); @@ -2188,7 +2183,7 @@ var _latlng = __webpack_require__(6); var _latlng2 = _interopRequireDefault(_latlng); -var _Path2 = __webpack_require__(4); +var _Path2 = __webpack_require__(3); var _Path3 = _interopRequireDefault(_Path2); @@ -2262,7 +2257,7 @@ var _layerContainer = __webpack_require__(9); var _layerContainer2 = _interopRequireDefault(_layerContainer); -var _Path2 = __webpack_require__(4); +var _Path2 = __webpack_require__(3); var _Path3 = _interopRequireDefault(_Path2); @@ -2334,7 +2329,7 @@ var _children = __webpack_require__(2); var _children2 = _interopRequireDefault(_children); -var _Path2 = __webpack_require__(4); +var _Path2 = __webpack_require__(3); var _Path3 = _interopRequireDefault(_Path2); @@ -2558,7 +2553,7 @@ var _layerContainer = __webpack_require__(9); var _layerContainer2 = _interopRequireDefault(_layerContainer); -var _map = __webpack_require__(3); +var _map = __webpack_require__(4); var _map2 = _interopRequireDefault(_map); @@ -2832,7 +2827,7 @@ var _layerContainer = __webpack_require__(9); var _layerContainer2 = _interopRequireDefault(_layerContainer); -var _map = __webpack_require__(3); +var _map = __webpack_require__(4); var _map2 = _interopRequireDefault(_map); @@ -3135,7 +3130,7 @@ var _children = __webpack_require__(2); var _children2 = _interopRequireDefault(_children); -var _map = __webpack_require__(3); +var _map = __webpack_require__(4); var _map2 = _interopRequireDefault(_map); @@ -3331,7 +3326,7 @@ var _latlngList = __webpack_require__(15); var _latlngList2 = _interopRequireDefault(_latlngList); -var _Path2 = __webpack_require__(4); +var _Path2 = __webpack_require__(3); var _Path3 = _interopRequireDefault(_Path2); @@ -3405,7 +3400,7 @@ var _latlngList = __webpack_require__(15); var _latlngList2 = _interopRequireDefault(_latlngList); -var _Path2 = __webpack_require__(4); +var _Path2 = __webpack_require__(3); var _Path3 = _interopRequireDefault(_Path2); @@ -3474,7 +3469,7 @@ var _latlng = __webpack_require__(6); var _latlng2 = _interopRequireDefault(_latlng); -var _map = __webpack_require__(3); +var _map = __webpack_require__(4); var _map2 = _interopRequireDefault(_map); @@ -3633,7 +3628,7 @@ var _children = __webpack_require__(2); var _children2 = _interopRequireDefault(_children); -var _Path2 = __webpack_require__(4); +var _Path2 = __webpack_require__(3); var _Path3 = _interopRequireDefault(_Path2); @@ -3825,7 +3820,7 @@ var _react = __webpack_require__(0); var _reactDom = __webpack_require__(54); -var _map = __webpack_require__(3); +var _map = __webpack_require__(4); var _map2 = _interopRequireDefault(_map); @@ -4115,7 +4110,7 @@ var _layerContainer2 = __webpack_require__(9); var _layerContainer3 = _interopRequireDefault(_layerContainer2); -var _map2 = __webpack_require__(3); +var _map2 = __webpack_require__(4); var _map3 = _interopRequireDefault(_map2); @@ -6877,7 +6872,7 @@ var _Pane2 = __webpack_require__(65); var _Pane3 = _interopRequireDefault(_Pane2); -var _Path2 = __webpack_require__(4); +var _Path2 = __webpack_require__(3); var _Path3 = _interopRequireDefault(_Path2); diff --git a/dist/react-leaflet.min.js b/dist/react-leaflet.min.js index 65530cff..fe51225b 100644 --- a/dist/react-leaflet.min.js +++ b/dist/react-leaflet.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("leaflet"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","leaflet","react-dom"],t):"object"==typeof exports?exports.ReactLeaflet=t(require("react"),require("leaflet"),require("react-dom")):e.ReactLeaflet=t(e.React,e.L,e.ReactDOM)}(this,function(e,t,n){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=160)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=o.PropTypes.oneOfType([o.PropTypes.arrayOf(o.PropTypes.node),o.PropTypes.node])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),r=n(0);t.default=r.PropTypes.instanceOf(o.Map)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:{};this.leafletElement.setStyle(e)},t.prototype.setStyleIfChanged=function(e,t){var n=this.getPathOptions(t);(0,s.default)(n,this.getPathOptions(e))||this.setStyle(n)},t}(b.default);m.childContextTypes={children:d.default,popupContainer:f.PropTypes.object},t.default=m},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=o.PropTypes.oneOfType([o.PropTypes.arrayOf(o.PropTypes.number),o.PropTypes.shape({lat:o.PropTypes.number,lng:o.PropTypes.number}),o.PropTypes.shape({lat:o.PropTypes.number,lon:o.PropTypes.number})])},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.leafletElement;if(!n||!n.on)return{};var o=(0,h.default)(t);return(0,y.default)(t,function(t,r){e[r]&&t===e[r]||(delete o[r],n.off(r,t))}),(0,y.default)(e,function(e,r){t[r]&&e===t[r]||(o[r]=e,n.on(r,e))}),o},t.prototype.fireLeafletEvent=function(e,t){var n=this.leafletElement;n&&n.fire(e,t)},t.prototype.getOptions=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.pane||this.context.pane;return t?b({},e,{pane:t}):e},t}(v.Component);t.default=O},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o-1&&e%1==0&&e-1&&e%1==0&&e<=o}var o=9007199254740991;e.exports=n},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t,n){var o=n(33),r=n(35),i=n(96),u=n(10),a=n(13),p=n(105),c=n(39),l=n(41),s=1,f=2,y=4,d=c(function(e,t){var n={};if(null==e)return n;var c=!1;t=o(t,function(t){return t=u(t,e),c||(c=t.length>1),t}),a(e,l(e),n),c&&(n=r(n,s|f|y,p));for(var d=t.length;d--;)i(n,t[d]);return n});e.exports=d},function(e,t,n){function o(e){return null==e?"":r(e)}var r=n(95);e.exports=o},function(e,t){e.exports=n},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(2),f=o(s),y=n(6),d=o(y),h=n(4),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.center,n=e.radius,o=i(e,["center","radius"]);return(0,c.circle)(t,n,this.getOptions(o))},t.prototype.updateLeafletElement=function(e,t){t.center!==e.center&&this.leafletElement.setLatLng(t.center),t.radius!==e.radius&&this.leafletElement.setRadius(t.radius)},t}(b.default);v.propTypes={center:d.default.isRequired,children:f.default,radius:l.PropTypes.number.isRequired},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(2),f=o(s),y=n(6),d=o(y),h=n(4),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.center,n=i(e,["center"]);return(0,c.circleMarker)(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){t.center!==e.center&&this.leafletElement.setLatLng(t.center),t.radius!==e.radius&&this.leafletElement.setRadius(t.radius)},t}(b.default);v.propTypes={center:d.default.isRequired,children:f.default,radius:l.PropTypes.number},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(49),l=o(c),s=n(1),f=n(0),y=n(2),d=o(y),h=n(4),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.data,n=i(e,["data"]);return(0,s.geoJSON)(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){(0,l.default)(t.style)?this.setStyle(t.style):this.setStyleIfChanged(e,t)},t}(b.default);v.propTypes={children:d.default,data:f.PropTypes.oneOfType([f.PropTypes.array,f.PropTypes.object]).isRequired},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(14),f=o(s),y=n(2),d=o(y),h=n(7),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.getChildContext=function(){return{popupContainer:this.leafletElement}},t.prototype.createLeafletElement=function(e){var t=e.bounds,n=e.url,o=i(e,["bounds","url"]);return(0,c.imageOverlay)(n,t,this.getOptions(o))},t.prototype.updateLeafletElement=function(e,t){t.url!==e.url&&this.leafletElement.setUrl(t.url),t.opacity!==e.opacity&&this.leafletElement.setOpacity(t.opacity)},t}(b.default);v.propTypes={attribution:l.PropTypes.string,bounds:f.default.isRequired,children:d.default,opacity:l.PropTypes.number,url:l.PropTypes.string.isRequired},v.childContextTypes={popupContainer:l.PropTypes.object},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function i(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o2&&void 0!==arguments[2]&&arguments[2]&&this.context.map.addLayer(e),this.leafletElement.addBaseLayer(e,t)},t.prototype.addOverlay=function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&this.context.map.addLayer(e),this.leafletElement.addOverlay(e,t)},t.prototype.removeLayer=function(e){this.context.map.removeLayer(e)},t.prototype.removeLayerControl=function(e){this.leafletElement.removeLayer(e)},t.prototype.render=function(){var e=this,t=s.Children.map(this.props.children,function(t){return t?(0,s.cloneElement)(t,e.controlProps):null});return f.default.createElement("div",{style:{display:"none"}},t)},t}(g.default);C.propTypes={baseLayers:s.PropTypes.object,children:d.default,overlays:s.PropTypes.object,position:b.default},C.contextTypes={layerContainer:m.default,map:P.default},t.default=C,C.BaseLayer=T,C.Overlay=E},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(2),f=o(s),y=n(6),d=o(y),h=n(7),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.getChildContext=function(){return{popupContainer:this.leafletElement}},t.prototype.createLeafletElement=function(e){var t=e.position,n=i(e,["position"]);return(0,c.marker)(t,this.getOptions(n))},t.prototype.updateLeafletElement=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&&(t.draggable?this.leafletElement.dragging.enable():this.leafletElement.dragging.disable())},t}(b.default);v.propTypes={children:f.default,icon:l.PropTypes.instanceOf(c.Icon),opacity:l.PropTypes.number,position:d.default.isRequired,zIndexOffset:l.PropTypes.number},v.childContextTypes={popupContainer:l.PropTypes.object},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:o.props,t=e.style,n=e.className,r=o.getPane(o.state.name);r&&(n&&r.classList.add(n),t&&(0,y.default)(t,function(e,t){r.style[t]=e}))},r=n,u(o,r)}return a(t,e),t.prototype.getChildContext=function(){return{pane:this.state.name}},t.prototype.componentDidMount=function(){this.createPane(this.props)},t.prototype.componentWillReceiveProps=function(e){if(this.state.name)if(e.name!==this.props.name)this.removePane(),this.createPane(e);else{if(this.props.className&&e.className!==this.props.className){var t=this.getPane();t&&t.classList.remove(this.props.className)}this.setStyle(e)}},t.prototype.componentWillUnmount=function(){this.removePane()},t.prototype.createPane=function(e){var t=this.context.map,n=e.name||"pane-"+(0,c.default)();if(t&&t.createPane){var o=g(n);if(o||this.getPane(n));else t.createPane(n,this.getParentPane());this.setState({name:n},this.setStyle)}},t.prototype.removePane=function(){var e=this.state.name;if(e){var t=this.getPane(e);t&&t.remove&&t.remove();var n=this.context.map;n&&n._panes&&(n._panes=(0,s.default)(n._panes,e),n._paneRenderers=(0,s.default)(n._paneRenderers,e)),this.setState({name:void 0})}},t.prototype.getParentPane=function(){return this.getPane(this.props.pane||this.context.pane)},t.prototype.getPane=function(e){return e?this.context.map.getPane(e):void 0},t.prototype.render=function(){return this.state.name?h.default.createElement("div",{style:w},this.props.children):null},t}(d.Component);_.propTypes={name:d.PropTypes.string,children:m.default,map:P.default,className:d.PropTypes.string,style:d.PropTypes.object,pane:d.PropTypes.string},_.contextTypes={map:P.default,pane:d.PropTypes.string},_.childContextTypes={pane:d.PropTypes.string},t.default=_},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(2),f=o(s),y=n(15),d=o(y),h=n(4),b=o(h),v=l.PropTypes.arrayOf(d.default),m=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.positions,n=i(e,["positions"]);return(0,c.polygon)(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){t.positions!==e.positions&&this.leafletElement.setLatLngs(t.positions),this.setStyleIfChanged(e,t)},t}(b.default);m.propTypes={children:f.default,popupContainer:l.PropTypes.object,positions:l.PropTypes.oneOfType([d.default,v,l.PropTypes.arrayOf(v)]).isRequired},t.default=m},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(2),f=o(s),y=n(15),d=o(y),h=n(4),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.positions,n=i(e,["positions"]);return(0,c.polyline)(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){t.positions!==e.positions&&this.leafletElement.setLatLngs(t.positions),this.setStyleIfChanged(e,t)},t}(b.default);v.propTypes={children:f.default,positions:l.PropTypes.oneOfType([d.default,l.PropTypes.arrayOf(d.default)]).isRequired},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(54),f=n(6),y=o(f),d=n(3),h=o(d),b=n(11),v=o(b),m=function(e){function t(){var n,o,r;u(this,t);for(var i=arguments.length,p=Array(i),c=0;c=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(14),f=o(s),y=n(2),d=o(y),h=n(4),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.bounds,n=i(e,["bounds"]);return(0,c.rectangle)(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){t.bounds!==e.bounds&&this.leafletElement.setBounds(t.bounds),this.setStyleIfChanged(e,t)},t}(b.default);v.propTypes={children:d.default,bounds:f.default.isRequired,popupContainer:l.PropTypes.object},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(2),f=o(s),y=n(23),d=o(y),h=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.url,n=i(e,["url"]);return(0,c.tileLayer)(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){t.url!==e.url&&this.leafletElement.setUrl(t.url)},t}(d.default);h.propTypes={children:f.default,opacity:l.PropTypes.number,url:l.PropTypes.string.isRequired,zIndex:l.PropTypes.number},t.default=h},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(54),f=n(3),y=o(f),d=n(11),h=o(d),b=function(e){function t(){var n,o,r;u(this,t);for(var i=arguments.length,p=Array(i),c=0;c=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(48),l=o(c),s=n(1),f=n(0),y=n(2),d=o(y),h=n(23),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.url,n=i(e,["url"]);return s.tileLayer.wms(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){var n=e.url,o=(e.opacity,e.zIndex,i(e,["url","opacity","zIndex"])),r=t.url,u=(t.opacity,t.zIndex,i(t,["url","opacity","zIndex"]));r!==n&&this.leafletElement.setUrl(r),(0,l.default)(u,o)||this.leafletElement.setParams(u)},t}(b.default);v.propTypes={children:d.default,opacity:f.PropTypes.number,url:f.PropTypes.string.isRequired,zIndex:f.PropTypes.number},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;or?0:r+t),n=n>r?r:n,n<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(r);++of))return!1;var d=l.get(e);if(d&&l.get(t))return d==t;var h=-1,b=!0,v=n&p?new r:void 0;for(l.set(e,t),l.set(t,e);++h-1}var r=n(17);e.exports=o},function(e,t,n){function o(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}var r=n(17);e.exports=o},function(e,t,n){function o(){this.size=0,this.__data__={hash:new r,map:new(u||i),string:new r}}var r=n(76),i=n(16),u=n(29);e.exports=o},function(e,t,n){function o(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}var r=n(18);e.exports=o},function(e,t,n){function o(e){return r(this,e).get(e)}var r=n(18);e.exports=o},function(e,t,n){function o(e){return r(this,e).has(e)}var r=n(18);e.exports=o},function(e,t,n){function o(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}var r=n(18);e.exports=o},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){function o(e,t){return t.length<2?e:r(e,i(t,0,-1))}var r=n(37),i=n(94);e.exports=o},function(e,t){function n(e){return this.__data__.set(e,o),this}var o="__lodash_hash_undefined__";e.exports=n},function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},function(e,t,n){function o(){this.__data__=new r,this.size=0}var r=n(16);e.exports=o},function(e,t){function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}e.exports=n},function(e,t){function n(e){return this.__data__.get(e)}e.exports=n},function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},function(e,t,n){function o(e,t){var n=this.__data__;if(n instanceof r){var o=n.__data__;if(!i||o.length0&&void 0!==arguments[0]?arguments[0]:{};this.leafletElement.setStyle(e)},t.prototype.setStyleIfChanged=function(e,t){var n=this.getPathOptions(t);(0,s.default)(n,this.getPathOptions(e))||this.setStyle(n)},t}(b.default);m.childContextTypes={children:d.default,popupContainer:f.PropTypes.object},t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),r=n(0);t.default=r.PropTypes.instanceOf(o.Map)},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=o.PropTypes.oneOfType([o.PropTypes.arrayOf(o.PropTypes.number),o.PropTypes.shape({lat:o.PropTypes.number,lng:o.PropTypes.number}),o.PropTypes.shape({lat:o.PropTypes.number,lon:o.PropTypes.number})])},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.leafletElement;if(!n||!n.on)return{};var o=(0,h.default)(t);return(0,y.default)(t,function(t,r){e[r]&&t===e[r]||(delete o[r],n.off(r,t))}),(0,y.default)(e,function(e,r){t[r]&&e===t[r]||(o[r]=e,n.on(r,e))}),o},t.prototype.fireLeafletEvent=function(e,t){var n=this.leafletElement;n&&n.fire(e,t)},t.prototype.getOptions=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.pane||this.context.pane;return t?b({},e,{pane:t}):e},t}(v.Component);t.default=O},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o-1&&e%1==0&&e-1&&e%1==0&&e<=o}var o=9007199254740991;e.exports=n},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t,n){var o=n(33),r=n(35),i=n(96),u=n(10),a=n(13),p=n(105),c=n(39),l=n(41),s=1,f=2,y=4,d=c(function(e,t){var n={};if(null==e)return n;var c=!1;t=o(t,function(t){return t=u(t,e),c||(c=t.length>1),t}),a(e,l(e),n),c&&(n=r(n,s|f|y,p));for(var d=t.length;d--;)i(n,t[d]);return n});e.exports=d},function(e,t,n){function o(e){return null==e?"":r(e)}var r=n(95);e.exports=o},function(e,t){e.exports=n},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(2),f=o(s),y=n(6),d=o(y),h=n(3),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.center,n=e.radius,o=i(e,["center","radius"]);return(0,c.circle)(t,n,this.getOptions(o))},t.prototype.updateLeafletElement=function(e,t){t.center!==e.center&&this.leafletElement.setLatLng(t.center),t.radius!==e.radius&&this.leafletElement.setRadius(t.radius)},t}(b.default);v.propTypes={center:d.default.isRequired,children:f.default,radius:l.PropTypes.number.isRequired},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(2),f=o(s),y=n(6),d=o(y),h=n(3),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.center,n=i(e,["center"]);return(0,c.circleMarker)(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){t.center!==e.center&&this.leafletElement.setLatLng(t.center),t.radius!==e.radius&&this.leafletElement.setRadius(t.radius)},t}(b.default);v.propTypes={center:d.default.isRequired,children:f.default,radius:l.PropTypes.number},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(49),l=o(c),s=n(1),f=n(0),y=n(2),d=o(y),h=n(3),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.data,n=i(e,["data"]);return(0,s.geoJSON)(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){(0,l.default)(t.style)?this.setStyle(t.style):this.setStyleIfChanged(e,t)},t}(b.default);v.propTypes={children:d.default,data:f.PropTypes.oneOfType([f.PropTypes.array,f.PropTypes.object]).isRequired},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(14),f=o(s),y=n(2),d=o(y),h=n(7),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.getChildContext=function(){return{popupContainer:this.leafletElement}},t.prototype.createLeafletElement=function(e){var t=e.bounds,n=e.url,o=i(e,["bounds","url"]);return(0,c.imageOverlay)(n,t,this.getOptions(o))},t.prototype.updateLeafletElement=function(e,t){t.url!==e.url&&this.leafletElement.setUrl(t.url),t.opacity!==e.opacity&&this.leafletElement.setOpacity(t.opacity)},t}(b.default);v.propTypes={attribution:l.PropTypes.string,bounds:f.default.isRequired,children:d.default,opacity:l.PropTypes.number,url:l.PropTypes.string.isRequired},v.childContextTypes={popupContainer:l.PropTypes.object},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function i(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o2&&void 0!==arguments[2]&&arguments[2]&&this.context.map.addLayer(e),this.leafletElement.addBaseLayer(e,t)},t.prototype.addOverlay=function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&this.context.map.addLayer(e),this.leafletElement.addOverlay(e,t)},t.prototype.removeLayer=function(e){this.context.map.removeLayer(e)},t.prototype.removeLayerControl=function(e){this.leafletElement.removeLayer(e)},t.prototype.render=function(){var e=this,t=s.Children.map(this.props.children,function(t){return t?(0,s.cloneElement)(t,e.controlProps):null});return f.default.createElement("div",{style:{display:"none"}},t)},t}(g.default);C.propTypes={baseLayers:s.PropTypes.object,children:d.default,overlays:s.PropTypes.object,position:b.default},C.contextTypes={layerContainer:m.default,map:P.default},t.default=C,C.BaseLayer=T,C.Overlay=E},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(2),f=o(s),y=n(6),d=o(y),h=n(7),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.getChildContext=function(){return{popupContainer:this.leafletElement}},t.prototype.createLeafletElement=function(e){var t=e.position,n=i(e,["position"]);return(0,c.marker)(t,this.getOptions(n))},t.prototype.updateLeafletElement=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&&(t.draggable?this.leafletElement.dragging.enable():this.leafletElement.dragging.disable())},t}(b.default);v.propTypes={children:f.default,icon:l.PropTypes.instanceOf(c.Icon),opacity:l.PropTypes.number,position:d.default.isRequired,zIndexOffset:l.PropTypes.number},v.childContextTypes={popupContainer:l.PropTypes.object},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:o.props,t=e.style,n=e.className,r=o.getPane(o.state.name);r&&(n&&r.classList.add(n),t&&(0,y.default)(t,function(e,t){r.style[t]=e}))},r=n,u(o,r)}return a(t,e),t.prototype.getChildContext=function(){return{pane:this.state.name}},t.prototype.componentDidMount=function(){this.createPane(this.props)},t.prototype.componentWillReceiveProps=function(e){if(this.state.name)if(e.name!==this.props.name)this.removePane(),this.createPane(e);else{if(this.props.className&&e.className!==this.props.className){var t=this.getPane();t&&t.classList.remove(this.props.className)}this.setStyle(e)}},t.prototype.componentWillUnmount=function(){this.removePane()},t.prototype.createPane=function(e){var t=this.context.map,n=e.name||"pane-"+(0,c.default)();if(t&&t.createPane){var o=g(n);if(o||this.getPane(n));else t.createPane(n,this.getParentPane());this.setState({name:n},this.setStyle)}},t.prototype.removePane=function(){var e=this.state.name;if(e){var t=this.getPane(e);t&&t.remove&&t.remove();var n=this.context.map;n&&n._panes&&(n._panes=(0,s.default)(n._panes,e),n._paneRenderers=(0,s.default)(n._paneRenderers,e)),this.setState({name:void 0})}},t.prototype.getParentPane=function(){return this.getPane(this.props.pane||this.context.pane)},t.prototype.getPane=function(e){return e?this.context.map.getPane(e):void 0},t.prototype.render=function(){return this.state.name?h.default.createElement("div",{style:w},this.props.children):null},t}(d.Component);_.propTypes={name:d.PropTypes.string,children:m.default,map:P.default,className:d.PropTypes.string,style:d.PropTypes.object,pane:d.PropTypes.string},_.contextTypes={map:P.default,pane:d.PropTypes.string},_.childContextTypes={pane:d.PropTypes.string},t.default=_},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(2),f=o(s),y=n(15),d=o(y),h=n(3),b=o(h),v=l.PropTypes.arrayOf(d.default),m=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.positions,n=i(e,["positions"]);return(0,c.polygon)(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){t.positions!==e.positions&&this.leafletElement.setLatLngs(t.positions),this.setStyleIfChanged(e,t)},t}(b.default);m.propTypes={children:f.default,popupContainer:l.PropTypes.object,positions:l.PropTypes.oneOfType([d.default,v,l.PropTypes.arrayOf(v)]).isRequired},t.default=m},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(2),f=o(s),y=n(15),d=o(y),h=n(3),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.positions,n=i(e,["positions"]);return(0,c.polyline)(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){t.positions!==e.positions&&this.leafletElement.setLatLngs(t.positions),this.setStyleIfChanged(e,t)},t}(b.default);v.propTypes={children:f.default,positions:l.PropTypes.oneOfType([d.default,l.PropTypes.arrayOf(d.default)]).isRequired},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(54),f=n(6),y=o(f),d=n(4),h=o(d),b=n(11),v=o(b),m=function(e){function t(){var n,o,r;u(this,t);for(var i=arguments.length,p=Array(i),c=0;c=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(14),f=o(s),y=n(2),d=o(y),h=n(3),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.bounds,n=i(e,["bounds"]);return(0,c.rectangle)(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){t.bounds!==e.bounds&&this.leafletElement.setBounds(t.bounds),this.setStyleIfChanged(e,t)},t}(b.default);v.propTypes={children:d.default,bounds:f.default.isRequired,popupContainer:l.PropTypes.object},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(2),f=o(s),y=n(23),d=o(y),h=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.url,n=i(e,["url"]);return(0,c.tileLayer)(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){t.url!==e.url&&this.leafletElement.setUrl(t.url)},t}(d.default);h.propTypes={children:f.default,opacity:l.PropTypes.number,url:l.PropTypes.string.isRequired,zIndex:l.PropTypes.number},t.default=h},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(1),l=n(0),s=n(54),f=n(4),y=o(f),d=n(11),h=o(d),b=function(e){function t(){var n,o,r;u(this,t);for(var i=arguments.length,p=Array(i),c=0;c=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(48),l=o(c),s=n(1),f=n(0),y=n(2),d=o(y),h=n(23),b=o(h),v=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return p(t,e),t.prototype.createLeafletElement=function(e){var t=e.url,n=i(e,["url"]);return s.tileLayer.wms(t,this.getOptions(n))},t.prototype.updateLeafletElement=function(e,t){var n=e.url,o=(e.opacity,e.zIndex,i(e,["url","opacity","zIndex"])),r=t.url,u=(t.opacity,t.zIndex,i(t,["url","opacity","zIndex"]));r!==n&&this.leafletElement.setUrl(r),(0,l.default)(u,o)||this.leafletElement.setParams(u)},t}(b.default);v.propTypes={children:d.default,opacity:f.PropTypes.number,url:f.PropTypes.string.isRequired,zIndex:f.PropTypes.number},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),o=0;or?0:r+t),n=n>r?r:n,n<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(r);++of))return!1;var d=l.get(e);if(d&&l.get(t))return d==t;var h=-1,b=!0,v=n&p?new r:void 0;for(l.set(e,t),l.set(t,e);++h-1}var r=n(17);e.exports=o},function(e,t,n){function o(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}var r=n(17);e.exports=o},function(e,t,n){function o(){this.size=0,this.__data__={hash:new r,map:new(u||i),string:new r}}var r=n(76),i=n(16),u=n(29);e.exports=o},function(e,t,n){function o(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}var r=n(18);e.exports=o},function(e,t,n){function o(e){return r(this,e).get(e)}var r=n(18);e.exports=o},function(e,t,n){function o(e){return r(this,e).has(e)}var r=n(18);e.exports=o},function(e,t,n){function o(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}var r=n(18);e.exports=o},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){function o(e,t){return t.length<2?e:r(e,i(t,0,-1))}var r=n(37),i=n(94);e.exports=o},function(e,t){function n(e){return this.__data__.set(e,o),this}var o="__lodash_hash_undefined__";e.exports=n},function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},function(e,t,n){function o(){this.__data__=new r,this.size=0}var r=n(16);e.exports=o},function(e,t){function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}e.exports=n},function(e,t){function n(e){return this.__data__.get(e)}e.exports=n},function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},function(e,t,n){function o(e,t){var n=this.__data__;if(n instanceof r){var o=n.__data__;if(!i||o.length= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var Circle = function (_Path) { _inherits(Circle, _Path); diff --git a/lib/CircleMarker.js b/lib/CircleMarker.js index d2715f62..29313463 100644 --- a/lib/CircleMarker.js +++ b/lib/CircleMarker.js @@ -24,13 +24,15 @@ var _Path3 = _interopRequireDefault(_Path2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var CircleMarker = function (_Path) { _inherits(CircleMarker, _Path); diff --git a/lib/FeatureGroup.js b/lib/FeatureGroup.js index a5546b85..7ed67c55 100644 --- a/lib/FeatureGroup.js +++ b/lib/FeatureGroup.js @@ -26,11 +26,13 @@ var _Path3 = _interopRequireDefault(_Path2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var FeatureGroup = function (_Path) { _inherits(FeatureGroup, _Path); diff --git a/lib/GeoJSON.js b/lib/GeoJSON.js index 3f005c28..fe58c3ee 100644 --- a/lib/GeoJSON.js +++ b/lib/GeoJSON.js @@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _isFunction2 = require('lodash/isFunction'); + +var _isFunction3 = _interopRequireDefault(_isFunction2); + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _leaflet = require('leaflet'); -var _lodash = require('lodash'); - var _react = require('react'); var _children = require('./types/children'); @@ -22,13 +24,15 @@ var _Path3 = _interopRequireDefault(_Path2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var GeoJSON = function (_Path) { _inherits(GeoJSON, _Path); @@ -50,7 +54,7 @@ var GeoJSON = function (_Path) { }, { key: 'updateLeafletElement', value: function updateLeafletElement(fromProps, toProps) { - if ((0, _lodash.isFunction)(toProps.style)) { + if ((0, _isFunction3.default)(toProps.style)) { this.setStyle(toProps.style); } else { this.setStyleIfChanged(fromProps, toProps); diff --git a/lib/GridLayer.js b/lib/GridLayer.js index c56ea625..bf633278 100644 --- a/lib/GridLayer.js +++ b/lib/GridLayer.js @@ -18,21 +18,19 @@ var _children = require('./types/children'); var _children2 = _interopRequireDefault(_children); -var _map = require('./types/map'); - -var _map2 = _interopRequireDefault(_map); - var _MapLayer2 = require('./MapLayer'); var _MapLayer3 = _interopRequireDefault(_MapLayer2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var GridLayer = function (_MapLayer) { _inherits(GridLayer, _MapLayer); @@ -46,10 +44,12 @@ var GridLayer = function (_MapLayer) { _createClass(GridLayer, [{ key: 'getOptions', value: function getOptions(props) { - return _extends({ - maxZoom: this.context.map.options.maxZoom, - minZoom: this.context.map.options.minZoom - }, _get(GridLayer.prototype.__proto__ || Object.getPrototypeOf(GridLayer.prototype), 'getOptions', this).call(this, props)); + var options = _get(GridLayer.prototype.__proto__ || Object.getPrototypeOf(GridLayer.prototype), 'getOptions', this).call(this, props); + var map = this.context.map; + return map ? _extends({ + maxZoom: map.options.maxZoom, + minZoom: map.options.minZoom + }, options) : options; } }, { key: 'createLeafletElement', @@ -84,7 +84,4 @@ GridLayer.propTypes = { opacity: _react.PropTypes.number, zIndex: _react.PropTypes.number }; -GridLayer.contextTypes = { - map: _map2.default -}; exports.default = GridLayer; \ No newline at end of file diff --git a/lib/ImageOverlay.js b/lib/ImageOverlay.js index 2ca2956c..63427122 100644 --- a/lib/ImageOverlay.js +++ b/lib/ImageOverlay.js @@ -24,13 +24,15 @@ var _MapLayer3 = _interopRequireDefault(_MapLayer2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var ImageOverlay = function (_MapLayer) { _inherits(ImageOverlay, _MapLayer); diff --git a/lib/LayerGroup.js b/lib/LayerGroup.js index fd8daa9c..64c43e4e 100644 --- a/lib/LayerGroup.js +++ b/lib/LayerGroup.js @@ -18,11 +18,13 @@ var _MapLayer3 = _interopRequireDefault(_MapLayer2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var LayerGroup = function (_MapLayer) { _inherits(LayerGroup, _MapLayer); diff --git a/lib/LayersControl.js b/lib/LayersControl.js index 0f6a66d0..4083586e 100644 --- a/lib/LayersControl.js +++ b/lib/LayersControl.js @@ -40,11 +40,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var baseControlledLayerPropTypes = { checked: _react.PropTypes.bool, diff --git a/lib/Map.js b/lib/Map.js index 678ae47a..75b4f456 100644 --- a/lib/Map.js +++ b/lib/Map.js @@ -4,6 +4,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _omit2 = require('lodash/omit'); + +var _omit3 = _interopRequireDefault(_omit2); + +var _isUndefined2 = require('lodash/isUndefined'); + +var _isUndefined3 = _interopRequireDefault(_isUndefined2); + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; @@ -12,8 +20,6 @@ var _leaflet = require('leaflet'); var _leaflet2 = _interopRequireDefault(_leaflet); -var _lodash = require('lodash'); - var _react = require('react'); var _react2 = _interopRequireDefault(_react); @@ -44,11 +50,13 @@ var _MapComponent3 = _interopRequireDefault(_MapComponent2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var OTHER_PROPS = ['children', 'className', 'id', 'style', 'useFlyTo']; @@ -132,9 +140,9 @@ var Map = function (_MapComponent) { }, { key: 'componentDidMount', value: function componentDidMount() { - var props = (0, _lodash.omit)(this.props, OTHER_PROPS); + var props = (0, _omit3.default)(this.props, OTHER_PROPS); this.leafletElement = this.createLeafletElement(props); - if (!(0, _lodash.isUndefined)(props.bounds)) { + if (!(0, _isUndefined3.default)(props.bounds)) { this.leafletElement.fitBounds(props.bounds, props.boundsOptions); } _get(Map.prototype.__proto__ || Object.getPrototypeOf(Map.prototype), 'componentDidMount', this).call(this); diff --git a/lib/MapComponent.js b/lib/MapComponent.js index 2e322316..9fd890e7 100644 --- a/lib/MapComponent.js +++ b/lib/MapComponent.js @@ -4,19 +4,37 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _reduce2 = require('lodash/reduce'); + +var _reduce3 = _interopRequireDefault(_reduce2); + +var _keys2 = require('lodash/keys'); + +var _keys3 = _interopRequireDefault(_keys2); + +var _forEach2 = require('lodash/forEach'); + +var _forEach3 = _interopRequireDefault(_forEach2); + +var _clone2 = require('lodash/clone'); + +var _clone3 = _interopRequireDefault(_clone2); + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _lodash = require('lodash'); - var _react = require('react'); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var EVENTS_RE = /^on(.+)$/i; @@ -54,14 +72,14 @@ var MapComponent = function (_Component) { var el = this.leafletElement; if (!el) return; - (0, _lodash.forEach)(this._leafletEvents, function (cb, ev) { + (0, _forEach3.default)(this._leafletEvents, function (cb, ev) { el.off(ev, cb); }); } }, { key: 'extractLeafletEvents', value: function extractLeafletEvents(props) { - return (0, _lodash.reduce)((0, _lodash.keys)(props), function (res, prop) { + return (0, _reduce3.default)((0, _keys3.default)(props), function (res, prop) { if (EVENTS_RE.test(prop)) { var _key = prop.replace(EVENTS_RE, function (match, p) { return p.toLowerCase(); @@ -80,15 +98,15 @@ var MapComponent = function (_Component) { var el = this.leafletElement; if (!el || !el.on) return {}; - var diff = (0, _lodash.clone)(prev); - (0, _lodash.forEach)(prev, function (cb, ev) { + var diff = (0, _clone3.default)(prev); + (0, _forEach3.default)(prev, function (cb, ev) { if (!next[ev] || cb !== next[ev]) { delete diff[ev]; el.off(ev, cb); } }); - (0, _lodash.forEach)(next, function (cb, ev) { + (0, _forEach3.default)(next, function (cb, ev) { if (!prev[ev] || cb !== prev[ev]) { diff[ev] = cb; el.on(ev, cb); diff --git a/lib/MapControl.js b/lib/MapControl.js index 4e245a28..c576da96 100644 --- a/lib/MapControl.js +++ b/lib/MapControl.js @@ -20,11 +20,13 @@ var _map2 = _interopRequireDefault(_map); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var MapControl = function (_Component) { _inherits(MapControl, _Component); diff --git a/lib/MapLayer.js b/lib/MapLayer.js index 38084a3d..a981d427 100644 --- a/lib/MapLayer.js +++ b/lib/MapLayer.js @@ -30,11 +30,13 @@ var _MapComponent3 = _interopRequireDefault(_MapComponent2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var MapLayer = function (_MapComponent) { _inherits(MapLayer, _MapComponent); diff --git a/lib/Marker.js b/lib/Marker.js index 12a2d044..fb8c4ee2 100644 --- a/lib/Marker.js +++ b/lib/Marker.js @@ -24,13 +24,15 @@ var _MapLayer3 = _interopRequireDefault(_MapLayer2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var Marker = function (_MapLayer) { _inherits(Marker, _MapLayer); diff --git a/lib/Pane.js b/lib/Pane.js index 49dc7f10..5107caa4 100644 --- a/lib/Pane.js +++ b/lib/Pane.js @@ -4,9 +4,19 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _uniqueId2 = require('lodash/uniqueId'); + +var _uniqueId3 = _interopRequireDefault(_uniqueId2); + +var _omit2 = require('lodash/omit'); + +var _omit3 = _interopRequireDefault(_omit2); -var _lodash = require('lodash'); +var _forEach2 = require('lodash/forEach'); + +var _forEach3 = _interopRequireDefault(_forEach2); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = require('react'); @@ -26,11 +36,13 @@ var _map2 = _interopRequireDefault(_map); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var LEAFLET_PANES = ['tile', 'shadow', 'overlay', 'map', 'marker', 'tooltip', 'popup']; @@ -73,7 +85,7 @@ var Pane = function (_Component) { pane.classList.add(className); } if (style) { - (0, _lodash.forEach)(style, function (value, key) { + (0, _forEach3.default)(style, function (value, key) { pane.style[key] = value; }); } @@ -128,7 +140,7 @@ var Pane = function (_Component) { key: 'createPane', value: function createPane(props) { var map = this.context.map; - var name = props.name || 'pane-' + (0, _lodash.uniqueId)(); + var name = props.name || 'pane-' + (0, _uniqueId3.default)(); if (map && map.createPane) { var isDefault = isLeafletPane(name); @@ -138,7 +150,7 @@ var Pane = function (_Component) { map.createPane(name, this.getParentPane()); } else { var message = isDefault ? 'You must use a unique name for a pane that is not a default leaflet pane (' + name + ')' : 'A pane with this name already exists. (' + name + ')'; - (0, _warning2.default)(false, message); + process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, message) : void 0; } this.setState({ name: name }, this.setStyle); @@ -156,8 +168,8 @@ var Pane = function (_Component) { var map = this.context.map; if (map && map._panes) { - map._panes = (0, _lodash.omit)(map._panes, name); - map._paneRenderers = (0, _lodash.omit)(map._paneRenderers, name); + map._panes = (0, _omit3.default)(map._panes, name); + map._paneRenderers = (0, _omit3.default)(map._paneRenderers, name); } this.setState({ name: undefined }); diff --git a/lib/Path.js b/lib/Path.js index 0e833cad..571a3734 100644 --- a/lib/Path.js +++ b/lib/Path.js @@ -4,12 +4,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _pick2 = require('lodash/pick'); + +var _pick3 = _interopRequireDefault(_pick2); + +var _isEqual2 = require('lodash/isEqual'); + +var _isEqual3 = _interopRequireDefault(_isEqual2); + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _lodash = require('lodash'); - var _react = require('react'); var _children = require('./types/children'); @@ -22,11 +28,13 @@ var _MapLayer3 = _interopRequireDefault(_MapLayer2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var OPTIONS = ['stroke', 'color', 'weight', 'opacity', 'fill', 'fillColor', 'fillOpacity', 'fillRule', 'dashArray', 'lineCap', 'lineJoin', 'clickable', 'pointerEvents', 'className']; @@ -55,7 +63,7 @@ var Path = function (_MapLayer) { }, { key: 'getPathOptions', value: function getPathOptions(props) { - return (0, _lodash.pick)(props, OPTIONS); + return (0, _pick3.default)(props, OPTIONS); } }, { key: 'setStyle', @@ -68,7 +76,7 @@ var Path = function (_MapLayer) { key: 'setStyleIfChanged', value: function setStyleIfChanged(fromProps, toProps) { var nextStyle = this.getPathOptions(toProps); - if (!(0, _lodash.isEqual)(nextStyle, this.getPathOptions(fromProps))) { + if (!(0, _isEqual3.default)(nextStyle, this.getPathOptions(fromProps))) { this.setStyle(nextStyle); } } diff --git a/lib/Polygon.js b/lib/Polygon.js index 9c79cbb6..1d7c8ff4 100644 --- a/lib/Polygon.js +++ b/lib/Polygon.js @@ -24,13 +24,15 @@ var _Path3 = _interopRequireDefault(_Path2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var multiLatLngListType = _react.PropTypes.arrayOf(_latlngList2.default); diff --git a/lib/Polyline.js b/lib/Polyline.js index 83ac1035..190aff2d 100644 --- a/lib/Polyline.js +++ b/lib/Polyline.js @@ -24,13 +24,15 @@ var _Path3 = _interopRequireDefault(_Path2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var Polyline = function (_Path) { _inherits(Polyline, _Path); diff --git a/lib/Popup.js b/lib/Popup.js index b8d4398c..37826714 100644 --- a/lib/Popup.js +++ b/lib/Popup.js @@ -28,13 +28,15 @@ var _MapComponent3 = _interopRequireDefault(_MapComponent2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var Popup = function (_MapComponent) { _inherits(Popup, _MapComponent); diff --git a/lib/Rectangle.js b/lib/Rectangle.js index 31afcb00..4b2c40bb 100644 --- a/lib/Rectangle.js +++ b/lib/Rectangle.js @@ -24,13 +24,15 @@ var _Path3 = _interopRequireDefault(_Path2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var Rectangle = function (_Path) { _inherits(Rectangle, _Path); diff --git a/lib/ScaleControl.js b/lib/ScaleControl.js index 5ea96c8e..8d5ee0c1 100644 --- a/lib/ScaleControl.js +++ b/lib/ScaleControl.js @@ -20,11 +20,13 @@ var _MapControl3 = _interopRequireDefault(_MapControl2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var ScaleControl = function (_MapControl) { _inherits(ScaleControl, _MapControl); diff --git a/lib/TileLayer.js b/lib/TileLayer.js index 0c0f33eb..04ccc1e8 100644 --- a/lib/TileLayer.js +++ b/lib/TileLayer.js @@ -20,13 +20,15 @@ var _GridLayer3 = _interopRequireDefault(_GridLayer2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var TileLayer = function (_GridLayer) { _inherits(TileLayer, _GridLayer); diff --git a/lib/Tooltip.js b/lib/Tooltip.js index 45cd6225..3c6b9c64 100644 --- a/lib/Tooltip.js +++ b/lib/Tooltip.js @@ -24,13 +24,15 @@ var _MapComponent3 = _interopRequireDefault(_MapComponent2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var Tooltip = function (_MapComponent) { _inherits(Tooltip, _MapComponent); diff --git a/lib/WMSTileLayer.js b/lib/WMSTileLayer.js index d716c2da..3e286abd 100644 --- a/lib/WMSTileLayer.js +++ b/lib/WMSTileLayer.js @@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _isEqual2 = require('lodash/isEqual'); + +var _isEqual3 = _interopRequireDefault(_isEqual2); + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _leaflet = require('leaflet'); -var _lodash = require('lodash'); - var _react = require('react'); var _children = require('./types/children'); @@ -22,13 +24,15 @@ var _GridLayer3 = _interopRequireDefault(_GridLayer2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var WMSTileLayer = function (_GridLayer) { _inherits(WMSTileLayer, _GridLayer); @@ -63,7 +67,7 @@ var WMSTileLayer = function (_GridLayer) { if (url !== prevUrl) { this.leafletElement.setUrl(url); } - if (!(0, _lodash.isEqual)(params, prevParams)) { + if (!(0, _isEqual3.default)(params, prevParams)) { this.leafletElement.setParams(params); } } diff --git a/lib/ZoomControl.js b/lib/ZoomControl.js index 5b4dce56..c36418ca 100644 --- a/lib/ZoomControl.js +++ b/lib/ZoomControl.js @@ -20,11 +20,13 @@ var _controlPosition2 = _interopRequireDefault(_controlPosition); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } var ZoomControl = function (_MapControl) { _inherits(ZoomControl, _MapControl); diff --git a/package.json b/package.json index f7b019a7..d3518bb9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-leaflet", - "version": "1.1.2", + "version": "1.1.3", "description": "React components for Leaflet maps", "main": "lib/index.js", "scripts": { @@ -73,7 +73,7 @@ "react-dom": "^15.4.2", "react-transform-hmr": "^1.0.4", "webpack": "^2.2.1", - "webpack-dev-server": "^2.3.0" + "webpack-dev-server": "^2.4.2" }, "jest": { "collectCoverage": true, diff --git a/src/GridLayer.js b/src/GridLayer.js index 3951879d..94278cde 100644 --- a/src/GridLayer.js +++ b/src/GridLayer.js @@ -4,7 +4,6 @@ import { gridLayer } from 'leaflet' import { PropTypes } from 'react' import childrenType from './types/children' -import mapType from './types/map' import MapLayer from './MapLayer' export default class GridLayer extends MapLayer { @@ -14,16 +13,14 @@ export default class GridLayer extends MapLayer { zIndex: PropTypes.number, } - static contextTypes = { - map: mapType, - } - getOptions (props?: Object): Object { - return { - maxZoom: this.context.map.options.maxZoom, - minZoom: this.context.map.options.minZoom, - ...super.getOptions(props), - } + const options = super.getOptions(props) + const map = this.context.map + return map ? { + maxZoom: map.options.maxZoom, + minZoom: map.options.minZoom, + ...options, + } : options } createLeafletElement (props: Object): Object { diff --git a/yarn.lock b/yarn.lock index abf96536..6fd4e7d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -181,14 +181,14 @@ asn1@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - assert@^1.1.1: version "1.4.1" resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" @@ -1232,8 +1232,8 @@ color-convert@^1.0.0: color-name "^1.1.1" color-name@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" + version "1.1.2" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d" combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" @@ -1388,7 +1388,13 @@ cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": dependencies: cssom "0.3.x" -d@^0.1.1, d@~0.1.1: +d@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" + dependencies: + es5-ext "^0.10.9" + +d@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309" dependencies: @@ -1411,8 +1417,8 @@ debug@2.6.1: ms "0.7.2" debug@^2.1.1, debug@^2.2.0: - version "2.6.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.2.tgz#dfa96a861ee9b8c2f29349b3bcc41aa599a71e0f" + version "2.6.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d" dependencies: ms "0.7.2" @@ -1589,20 +1595,20 @@ es-to-primitive@^1.1.1: is-date-object "^1.0.1" is-symbol "^1.0.1" -es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7: - version "0.10.13" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.13.tgz#a390ab717bde1ce3b4cbaeabe23ca8fbddcb06f6" +es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.11, es5-ext@~0.10.14, es5-ext@~0.10.2: + version "0.10.14" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.14.tgz#625bc9ab9cac0f6fb9dc271525823d1800b3d360" dependencies: es6-iterator "2" es6-symbol "~3.1" -es6-iterator@2: - version "2.0.0" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.0.tgz#bd968567d61635e33c0b80727613c9cb4b096bac" +es6-iterator@2, es6-iterator@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" dependencies: - d "^0.1.1" - es5-ext "^0.10.7" - es6-symbol "3" + d "1" + es5-ext "^0.10.14" + es6-symbol "^3.1" es6-map@^0.1.3: version "0.1.4" @@ -1625,21 +1631,21 @@ es6-set@~0.1.3: es6-symbol "3" event-emitter "~0.3.4" -es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" +es6-symbol@3, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" dependencies: - d "~0.1.1" - es5-ext "~0.10.11" + d "1" + es5-ext "~0.10.14" es6-weak-map@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.1.tgz#0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81" + version "2.0.2" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" dependencies: - d "^0.1.1" - es5-ext "^0.10.8" - es6-iterator "2" - es6-symbol "3" + d "1" + es5-ext "^0.10.14" + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" escape-html@~1.0.3: version "1.0.3" @@ -1783,11 +1789,11 @@ etag@~1.8.0: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.0.tgz#6f631aef336d6c46362b51764044ce216be3c051" event-emitter@~0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.4.tgz#8d63ddfb4cfe1fae3b32ca265c4c720222080bb5" + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" dependencies: - d "~0.1.1" - es5-ext "~0.10.7" + d "1" + es5-ext "~0.10.14" eventemitter3@1.x.x: version "1.2.0" @@ -2283,7 +2289,7 @@ http-errors@~1.6.1: setprototypeof "1.0.3" statuses ">= 1.3.1 < 2" -http-proxy-middleware@~0.17.1: +http-proxy-middleware@~0.17.4: version "0.17.4" resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-0.17.4.tgz#642e8848851d66f09d4f124912846dbaeb41b833" dependencies: @@ -2320,8 +2326,8 @@ ieee754@^1.1.4: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" ignore@^3.2.0: - version "3.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.4.tgz#4055e03596729a8fabe45a43c100ad5ed815c4e8" + version "3.2.5" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.5.tgz#6437903354653e32ebbf562c45e68e4922a95df6" imurmurhash@^0.1.4: version "0.1.4" @@ -2914,9 +2920,10 @@ jsonpointer@^4.0.0: resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" jsprim@^1.2.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.3.1.tgz#2a7256f70412a29ee3670aaca625994c4dcff252" + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" dependencies: + assert-plus "1.0.0" extsprintf "1.0.2" json-schema "0.2.3" verror "1.3.6" @@ -3643,8 +3650,8 @@ read-pkg@^1.0.0: path-type "^1.0.0" "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.0, readable-stream@^2.2.2: - version "2.2.3" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.3.tgz#9cf49463985df016c8ae8813097a9293a9b33729" + version "2.2.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.5.tgz#a0b187304e05bab01a4ce2b4cc9c607d5aa1d606" dependencies: buffer-shims "^1.0.0" core-util-is "~1.0.0" @@ -4425,9 +4432,9 @@ webpack-dev-middleware@^1.9.0: path-is-absolute "^1.0.0" range-parser "^1.0.3" -webpack-dev-server@^2.3.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.4.1.tgz#48556f793186eac0758df94730c034ed9a4d0f12" +webpack-dev-server@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.4.2.tgz#cf595d6b40878452b6d2ad7229056b686f8a16be" dependencies: ansi-html "0.0.7" chokidar "^1.6.0" @@ -4435,7 +4442,7 @@ webpack-dev-server@^2.3.0: connect-history-api-fallback "^1.3.0" express "^4.13.3" html-entities "^1.2.0" - http-proxy-middleware "~0.17.1" + http-proxy-middleware "~0.17.4" opn "4.0.2" portfinder "^1.0.9" serve-index "^1.7.2"