diff --git a/.babelrc b/.babelrc index 357c26fd..4687bc4f 100644 --- a/.babelrc +++ b/.babelrc @@ -1,13 +1,3 @@ { - "presets": ["es2015", "react"], - "plugins": [ - "syntax-class-properties", - "syntax-export-extensions", - "syntax-function-bind", - "syntax-object-rest-spread", - "transform-class-properties", - "transform-export-extensions", - "transform-function-bind", - "transform-object-rest-spread" - ] + "presets": ["es2015", "react", "stage-0"] } diff --git a/.eslintrc b/.eslintrc.json similarity index 82% rename from .eslintrc rename to .eslintrc.json index a6072f88..08b75588 100644 --- a/.eslintrc +++ b/.eslintrc.json @@ -1,25 +1,17 @@ { "env": { - "browser": true, - "es6": true, - "node": true + "es6": true }, + "extends": "eslint:recommended", "parser": "babel-eslint", + "parserOptions": { + "ecmaVersion": 6, + "jsx": true, + "sourceType": "module" + }, "plugins": [ "react" ], - "ecmaFeatures": { - "arrowFunctions": true, - "blockBindings": true, - "classes": true, - "defaultParams": true, - "destructuring": true, - "spread": true, - "superInFunctions": true, - "modules": true, - "jsx": true, - "experimentalObjectRestSpread": true - }, "rules": { "comma-dangle": [1, "always-multiline"], "no-cond-assign": 2, @@ -68,10 +60,6 @@ "no-use-before-define": 1, "quotes": [2, "single", "avoid-escape"], "jsx-quotes": [1, "prefer-single"], - "constructor-super": 2, - "no-class-assign": 2, - "no-const-assign": 2, - "no-this-before-super": 2, "no-var": 2, "prefer-const": 1, "react/display-name": 0, diff --git a/CHANGELOG.md b/CHANGELOG.md index dda9ff98..f8402445 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v0.10.2 (12/03/16) + +- Added `animate` optional property to `Map` ([PR #126](https://github.com/PaulLeCam/react-leaflet/pull/126) by *mariusandra*). +- Added React v15.0.0-rc.1 support as peer dependencies. + ## v0.10.1 (22/02/16) - Added the popup container as source layer to `Popup` creation, fixes [#113](https://github.com/PaulLeCam/react-leaflet/issues/113) ([PR #112](https://github.com/PaulLeCam/react-leaflet/pull/112) by *amarant*). diff --git a/README.md b/README.md index a2648208..9185bd2e 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,7 @@ Base class extending [`MapLayer`](#maplayer) with the following methods: This is the top-level component that must be mounted for children ones to be rendered. Refer to [Leaflet documentation](http://leafletjs.com/reference.html#map-options) for more information about the properties. **Dynamic properties** +- `animate: boolean` (optional): If `true`, panning will always be animated if possible. Defaults to `false`. - `bounds: bounds` (optional): A rectangle for the map to contain. It will be centered, and the map will zoom in as close as it can while still showing the full bounds. This property is dynamic, if you change it it will be reflected on the map. - `boundsOptions: object` (optional): Options passed to the `fitBounds()` method. - `center: latLng` (optional): Center of the map. This property is dynamic, if you change it it will be reflected in the map. @@ -151,7 +152,6 @@ This is the top-level component that must be mounted for children ones to be ren **Other properties** - `id: string` (optional): The ID of the `
` container for the map. If you don't provide it, a unique one will be created. -- `animate: boolean` (optional): If `true`, panning will always be animated if possible. Defaults to `false`. #### UI Layers diff --git a/bower.json b/bower.json index 5a390a36..efd93c98 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "react-leaflet", - "version": "0.10.1", + "version": "0.10.2", "homepage": "https://github.com/PaulLeCam/react-leaflet", "authors": [ "Paul Le Cam " diff --git a/dist/react-leaflet.js b/dist/react-leaflet.js index af3a7a23..bda479ec 100644 --- a/dist/react-leaflet.js +++ b/dist/react-leaflet.js @@ -6203,6 +6203,7 @@ return /******/ (function(modules) { // webpackBootstrap }(_MapComponent3.default); Map.propTypes = { + animate: _react.PropTypes.bool, bounds: _bounds2.default, boundsOptions: _react.PropTypes.object, center: _latlng2.default, @@ -6213,8 +6214,7 @@ return /******/ (function(modules) { // webpackBootstrap maxZoom: _react.PropTypes.number, minZoom: _react.PropTypes.number, style: _react.PropTypes.object, - zoom: _react.PropTypes.number, - animate: _react.PropTypes.bool + zoom: _react.PropTypes.number }; Map.defaultProps = { animate: false diff --git a/dist/react-leaflet.min.js b/dist/react-leaflet.min.js index acf3aa47..ec4dfe9e 100644 --- a/dist/react-leaflet.min.js +++ b/dist/react-leaflet.min.js @@ -1,3 +1,3 @@ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("leaflet"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["leaflet","react","react-dom"],t):"object"==typeof exports?exports.ReactLeaflet=t(require("leaflet"),require("react"),require("react-dom")):e.ReactLeaflet=t(e.L,e.React,e.ReactDOM)}(this,function(e,t,n){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.setIconDefaultImagePath=t.ZoomControl=t.WMSTileLayer=t.TileLayer=t.ScaleControl=t.Rectangle=t.Popup=t.Polyline=t.Polygon=t.Path=t.MultiPolyline=t.MultiPolygon=t.Marker=t.MapLayer=t.MapControl=t.MapComponent=t.Map=t.LayersControl=t.LayerGroup=t.ImageOverlay=t.GeoJson=t.FeatureGroup=t.CircleMarker=t.Circle=t.CanvasTileLayer=t.BaseTileLayer=t.AttributionControl=t.PropTypes=void 0;var i=n(1),u=o(i),a=n(83),c=r(a),l=n(62),f=o(l),p=n(15),s=o(p),y=n(63),v=o(y),b=n(64),h=o(b),d=n(65),O=o(d),m=n(66),j=o(m),g=n(67),P=o(g),_=n(68),w=o(_),x=n(69),E=o(x),T=n(70),M=o(T),k=n(71),C=o(k),S=n(16),L=o(S),W=n(13),R=o(W),A=n(7),D=o(A),I=n(72),U=o(I),F=n(73),B=o(F),q=n(74),z=o(q),G=n(4),N=o(G),$=n(75),Z=o($),J=n(76),V=o(J),H=n(77),K=o(H),Q=n(78),X=o(Q),Y=n(79),ee=o(Y),te=n(80),ne=o(te),re=n(81),oe=o(re),ie=n(82),ue=o(ie);t.PropTypes=c,t.AttributionControl=f["default"],t.BaseTileLayer=s["default"],t.CanvasTileLayer=v["default"],t.Circle=h["default"],t.CircleMarker=O["default"],t.FeatureGroup=j["default"],t.GeoJson=P["default"],t.ImageOverlay=w["default"],t.LayerGroup=E["default"],t.LayersControl=M["default"],t.Map=C["default"],t.MapComponent=L["default"],t.MapControl=R["default"],t.MapLayer=D["default"],t.Marker=U["default"],t.MultiPolygon=B["default"],t.MultiPolyline=z["default"],t.Path=N["default"],t.Polygon=Z["default"],t.Polyline=V["default"],t.Popup=K["default"],t.Rectangle=X["default"],t.ScaleControl=ee["default"],t.TileLayer=ne["default"],t.WMSTileLayer=oe["default"],t.ZoomControl=ue["default"];var ae=t.setIconDefaultImagePath=function(e){u["default"].Icon.Default.imagePath=e};ae("//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images")},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 u(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n-1&&e%1==0&&r>=e}var r=9007199254740991;e.exports=n},function(e,t,n){function r(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1&&e%1==0&&t>e}var r=9007199254740991,o=/^(?:0|[1-9]\d*)$/;e.exports=n},function(e,t,n){function r(e,t){return"number"==typeof e?!0:!o(e)&&(u.test(e)||!i.test(e)||null!=t&&e in Object(t))}var o=n(3),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;e.exports=r},function(e,t){function n(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||r;return e===n}var r=Object.prototype;e.exports=n},function(e,t){function n(e,t){return e===t||e!==e&&t!==t}e.exports=n},function(e,t,n){function r(e){return o(e)&&a.call(e,"callee")&&(!l.call(e,"callee")||c.call(e)==i)}var o=n(57),i="[object Arguments]",u=Object.prototype,a=u.hasOwnProperty,c=u.toString,l=u.propertyIsEnumerable;e.exports=r},function(e,t,n){function r(e){var t=o(e)?c.call(e):"";return t==i||t==u}var o=n(6),i="[object Function]",u="[object GeneratorFunction]",a=Object.prototype,c=a.toString;e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t["default"]=r.PropTypes.oneOf(["topleft","topright","bottomleft","bottomright"])},function(e,t,n){var r=n(10),o=r.Uint8Array;e.exports=o},function(e,t){function n(e,t){for(var n=-1,r=e.length;++nn)return!1;var r=e.length-1;return n==r?e.pop():u.call(e,n,1),!0}var o=n(19),i=Array.prototype,u=i.splice;e.exports=r},function(e,t,n){function r(e,t){var n=o(e,t);return 0>n?void 0:e[n][1]}var o=n(19);e.exports=r},function(e,t,n){function r(e,t){return o(e,t)>-1}var o=n(19);e.exports=r},function(e,t,n){function r(e,t,n){var r=o(e,t);0>r?e.push([t,n]):e[r][1]=n}var o=n(19);e.exports=r},function(e,t,n){function r(e){return o(e)?e:i(e)}var o=n(3),i=n(152);e.exports=r},function(e,t,n){var r=n(45),o=n(124),i=o(r);e.exports=i},function(e,t,n){function r(e,t){return e&&o(e,t,i)}var o=n(99),i=n(12);e.exports=r},function(e,t,n){function r(e,t){t=i(t,e)?[t+""]:o(t);for(var n=0,r=t.length;null!=e&&r>n;)e=e[t[n++]];return n&&n==r?e:void 0}var o=n(43),i=n(31);e.exports=r},function(e,t){function n(e,t){return o.call(e,t)||"object"==typeof e&&t in e&&null===i(e)}var r=Object.prototype,o=r.hasOwnProperty,i=Object.getPrototypeOf;e.exports=n},function(e,t){function n(e){return function(t){return null==t?void 0:t[e]}}e.exports=n},function(e,t,n){function r(e){var t=new e.constructor(e.byteLength);return new o(t).set(new o(e)),t}var o=n(37);e.exports=r},function(e,t,n){function r(e,t,n,r,a,c){var l=-1,f=a&u,p=a&i,s=e.length,y=t.length;if(s!=y&&!(f&&y>s))return!1;var v=c.get(e);if(v)return v==t;var b=!0;for(c.set(e,t);++l=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){ -for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 a(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n0&&a(p)&&(n||u(p)||i(p))?t>1?r(p,t-1,n,c):o(c,p):n||(c[c.length]=p)}return c}var o=n(92),i=n(34),u=n(3),a=n(57);e.exports=r},function(e,t,n){var r=n(125),o=r();e.exports=o},function(e,t){function n(e,t){return t in Object(e)}e.exports=n},function(e,t,n){function r(e,t,n,r,h,O){var m=l(e),j=l(t),g=v,P=v;m||(g=c(e),g=g==y?b:g),j||(P=c(t),P=P==y?b:P);var _=g==b&&!f(e),w=P==b&&!f(t),x=g==P;if(x&&!_)return O||(O=new o),m||p(e)?i(e,t,n,r,h,O):u(e,t,g,n,r,h,O);if(!(h&s)){var E=_&&d.call(e,"__wrapped__"),T=w&&d.call(t,"__wrapped__");if(E||T)return O||(O=new o),n(E?e.value():e,T?t.value():t,r,h,O)}return x?(O||(O=new o),a(e,t,n,r,h,O)):!1}var o=n(24),i=n(50),u=n(126),a=n(127),c=n(51),l=n(3),f=n(29),p=n(162),s=2,y="[object Arguments]",v="[object Array]",b="[object Object]",h=Object.prototype,d=h.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t,n,r){var c=n.length,l=c,f=!r;if(null==e)return!l;for(e=Object(e);c--;){var p=n[c];if(f&&p[2]?p[1]!==e[p[0]]:!(p[0]in e))return!1}for(;++ct&&(t=-t>o?0:o+t),n=n>o?o:n,0>n&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(u="function"==typeof u?(i--,u):void 0,a&&o(n[0],n[1],a)&&(u=3>i?void 0:u,i=1),t=Object(t);++re?-1:1;return t*u}var n=e%1;return e===e?n?e-n:e:0}var o=n(169),i=1/0,u=1.7976931348623157e308;e.exports=r},function(e,t,n){function r(e){if(i(e)){var t=o(e.valueOf)?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=l.test(e);return n||f.test(e)?p(e.slice(2),n?2:8):c.test(e)?u:+e}var o=n(35),i=n(6),u=NaN,a=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,f=/^0o[0-7]+$/i,p=parseInt;e.exports=r},function(e,t,n){function r(e){return o(e,i(e))}var o=n(112),i=n(12);e.exports=r},function(e,t,n){function r(e){var t=++i;return o(e)+t}var o=n(60),i=0;e.exports=r},function(e,t){e.exports=n}])}); \ No newline at end of file diff --git a/lib/Map.js b/lib/Map.js index 0100814f..2255ba2a 100644 --- a/lib/Map.js +++ b/lib/Map.js @@ -143,6 +143,7 @@ var Map = function (_MapComponent) { }(_MapComponent3.default); Map.propTypes = { + animate: _react.PropTypes.bool, bounds: _bounds2.default, boundsOptions: _react.PropTypes.object, center: _latlng2.default, @@ -153,8 +154,7 @@ Map.propTypes = { maxZoom: _react.PropTypes.number, minZoom: _react.PropTypes.number, style: _react.PropTypes.object, - zoom: _react.PropTypes.number, - animate: _react.PropTypes.bool + zoom: _react.PropTypes.number }; Map.defaultProps = { animate: false diff --git a/package.json b/package.json index a1d3a786..e433cc0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-leaflet", - "version": "0.10.1", + "version": "0.10.2", "description": "React components for Leaflet maps", "main": "lib/index.js", "scripts": { @@ -40,41 +40,32 @@ }, "peerDependencies": { "leaflet": "^0.7.0", - "react": "^0.14.0", - "react-dom": "^0.14.0" + "react": "^0.14.0 || ^15.0.0-rc.1", + "react-dom": "^0.14.0 || ^15.0.0-rc.1" }, "devDependencies": { - "babel-cli": "^6.5.1", - "babel-core": "^6.5.2", + "babel-cli": "^6.6.5", + "babel-core": "^6.7.2", "babel-eslint": "^5.0.0", - "babel-jest": "^6.0.1", - "babel-loader": "^6.2.3", - "babel-plugin-react-transform": "^2.0.0", - "babel-plugin-syntax-class-properties": "^6.5.0", - "babel-plugin-syntax-export-extensions": "^6.5.0", - "babel-plugin-syntax-function-bind": "^6.5.0", - "babel-plugin-syntax-object-rest-spread": "^6.5.0", - "babel-plugin-transform-class-properties": "^6.5.2", - "babel-plugin-transform-export-extensions": "^6.5.0", - "babel-plugin-transform-function-bind": "^6.5.2", - "babel-plugin-transform-object-rest-spread": "^6.5.0", - "babel-preset-es2015": "^6.5.0", + "babel-jest": "^9.0.3", + "babel-loader": "^6.2.4", + "babel-plugin-react-transform": "^2.0.2", + "babel-preset-es2015": "^6.6.0", "babel-preset-react": "^6.5.0", - "eslint": "^2.2.0", - "eslint-plugin-react": "^4.0.0", - "estraverse-fb": "^1.3.1", - "jest-cli": "^0.8.2", + "babel-preset-stage-0": "^6.5.0", + "eslint": "~2.2.0", + "eslint-plugin-react": "^4.2.1", + "jest-cli": "^0.9.2", "leaflet": "^0.7.7", - "onchange": "^2.0.0", + "onchange": "^2.1.2", "react": "^0.14.7", "react-dom": "^0.14.7", - "react-transform-hmr": "^1.0.2", + "react-transform-hmr": "^1.0.4", "webpack": "^1.12.14", "webpack-dev-server": "^1.14.1" }, "jest": { "scriptPreprocessor": "/node_modules/babel-jest", - "testRunner": "/node_modules/jest-cli/src/testRunners/jasmine/jasmine2.js", "unmockedModulePathPatterns": [ "/node_modules/fbjs", "/node_modules/jest-cli", diff --git a/src/Map.js b/src/Map.js index 1006ce3a..56ea66e6 100644 --- a/src/Map.js +++ b/src/Map.js @@ -15,6 +15,7 @@ const normalizeCenter = pos => isArray(pos) ? pos : [pos.lat, pos.lng || pos.lon export default class Map extends MapComponent { static propTypes = { + animate: PropTypes.bool, bounds: boundsType, boundsOptions: PropTypes.object, center: latlngType, @@ -29,11 +30,10 @@ export default class Map extends MapComponent { minZoom: PropTypes.number, style: PropTypes.object, zoom: PropTypes.number, - animate: PropTypes.bool, }; static defaultProps = { - animate: false + animate: false, }; constructor(props) { @@ -55,7 +55,7 @@ export default class Map extends MapComponent { componentDidUpdate(prevProps) { const { bounds, center, maxBounds, zoom, animate } = this.props; if (center && this.shouldUpdateCenter(center, prevProps.center)) { - this.leafletElement.setView(center, zoom, {animate: animate}); + this.leafletElement.setView(center, zoom, {animate}); } else if (zoom && zoom !== prevProps.zoom) { this.leafletElement.setZoom(zoom);