react-leaflet
Advanced tools
Comparing version 0.10.1 to 0.10.2
@@ -0,1 +1,6 @@ | ||
## 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) | ||
@@ -2,0 +7,0 @@ |
@@ -87,5 +87,6 @@ 'use strict'; | ||
var zoom = _props.zoom; | ||
var animate = _props.animate; | ||
if (center && this.shouldUpdateCenter(center, prevProps.center)) { | ||
this.leafletElement.setView(center, zoom, { animate: false }); | ||
this.leafletElement.setView(center, zoom, { animate: animate }); | ||
} else if (zoom && zoom !== prevProps.zoom) { | ||
@@ -146,2 +147,3 @@ this.leafletElement.setZoom(zoom); | ||
Map.propTypes = { | ||
animate: _react.PropTypes.bool, | ||
bounds: _bounds2.default, | ||
@@ -159,2 +161,5 @@ boundsOptions: _react.PropTypes.object, | ||
}; | ||
Map.defaultProps = { | ||
animate: false | ||
}; | ||
exports.default = Map; |
{ | ||
"name": "react-leaflet", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "React components for Leaflet maps", | ||
@@ -43,30 +43,23 @@ "main": "lib/index.js", | ||
"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", | ||
"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", | ||
@@ -77,3 +70,2 @@ "webpack-dev-server": "^1.14.1" | ||
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest", | ||
"testRunner": "<rootDir>/node_modules/jest-cli/src/testRunners/jasmine/jasmine2.js", | ||
"unmockedModulePathPatterns": [ | ||
@@ -80,0 +72,0 @@ "<rootDir>/node_modules/fbjs", |
@@ -144,2 +144,3 @@ # React-Leaflet | ||
**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. | ||
@@ -146,0 +147,0 @@ - `boundsOptions: object` (optional): Options passed to the `fitBounds()` method. |
@@ -18,2 +18,3 @@ /* eslint-disable react/no-did-mount-set-state */ | ||
static propTypes = { | ||
animate: PropTypes.bool, | ||
bounds: boundsType, | ||
@@ -35,2 +36,6 @@ boundsOptions: PropTypes.object, | ||
static defaultProps = { | ||
animate: false, | ||
}; | ||
constructor(props) { | ||
@@ -53,5 +58,5 @@ super(props); | ||
componentDidUpdate(prevProps) { | ||
const { bounds, center, maxBounds, zoom } = this.props; | ||
const { bounds, center, maxBounds, zoom, animate } = this.props; | ||
if (center && this.shouldUpdateCenter(center, prevProps.center)) { | ||
this.leafletElement.setView(center, zoom, {animate: false}); | ||
this.leafletElement.setView(center, zoom, {animate}); | ||
} | ||
@@ -58,0 +63,0 @@ else if (zoom && zoom !== prevProps.zoom) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
457033
19
73
8365
320