Skip to content

Commit

Permalink
Showing 10 changed files with 38 additions and 64 deletions.
12 changes: 1 addition & 11 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -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"]
}
26 changes: 7 additions & 19 deletions .eslintrc → .eslintrc.json
Original file line number Diff line number Diff line change
@@ -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,
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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*).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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 `<div>` 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

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -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 <paul@ulem.net>"
4 changes: 2 additions & 2 deletions dist/react-leaflet.js
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion dist/react-leaflet.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/Map.js
Original file line number Diff line number Diff line change
@@ -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
39 changes: 15 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": "<rootDir>/node_modules/babel-jest",
"testRunner": "<rootDir>/node_modules/jest-cli/src/testRunners/jasmine/jasmine2.js",
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/fbjs",
"<rootDir>/node_modules/jest-cli",
6 changes: 3 additions & 3 deletions src/Map.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 2abbcd1

Please sign in to comment.