Skip to content

Commit

Permalink
v2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulLeCam committed Nov 10, 2018
1 parent 6c929d5 commit ab9ec00
Show file tree
Hide file tree
Showing 26 changed files with 993 additions and 1,022 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2016,
"ecmaVersion": 2018,
"jsx": true,
"sourceType": "module"
},
Expand All @@ -35,7 +35,7 @@
"settings": {
"react": {
"version": "16.3",
"flowVersion": "0.78"
"flowVersion": "0.86"
}
}
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v2.1.2 (2018-11-10)

- Fixed support for multiple classes in the `Pane` component.
- [internal] Replaced some lodash functions ([PR #533](https://github.com/PaulLeCam/react-leaflet/pull/533) by *radeno*).
- [website] Added `react-leaflet-geojson-patterns` plugin ([PR #536](https://github.com/PaulLeCam/react-leaflet/pull/536) by *lkazberova*).

## v2.1.1 (2018-10-22)

- Fixed regression when updating the `className` prop of the `Map` component.
Expand Down
32 changes: 9 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,28 @@
# Contributing

You want to contribute? Great! Please read below the instructions for the
different types of contributions.
You want to contribute? Great! Please read below the instructions for the different types of contributions.

## Support

Please **do not** use issues for support, but instead post your questions on
[StackOverflow](https://stackoverflow.com/) using the
[`react-leaflet` tag](https://stackoverflow.com/questions/tagged/react-leaflet).
Please **do not** use issues for support, but instead post your questions on [StackOverflow](https://stackoverflow.com/) using the [`react-leaflet` tag](https://stackoverflow.com/questions/tagged/react-leaflet).

## Bug reports

Please fill the issue template with steps to reproduce.

## Pull requests

Pull requests are more than welcome to fix issues and improve documentation,
test coverage and features parity with Leaflet.\
However, please **do not** send pull requests to add features that are not supported
by Leaflet. If you want to add support for plugins, please create separate repositories
for this.
Pull requests are more than welcome to fix issues and improve documentation, test coverage and features parity with Leaflet.\
However, please **do not** send pull requests to add features that are not supported by Leaflet. If you want to add support for plugins, please create separate repositories for this.

## Features requests

This library aims only to support the features provided by Leaflet. If any of
these features is not implemented yet, please submit a feature request to add
it.\
If you are looking for implementations of features provided by plugins, they
will not be provided by this library, but a [list of third-party plugins is available in the documentation](https://react-leaflet.js.org/docs/en/plugins.html).\
This library aims only to support the features provided by Leaflet. If any of these features is not implemented yet, please submit a feature request to add it.\
If you are looking for implementations of features provided by plugins, they will not be provided by this library, but a [list of third-party plugins is available in the documentation](https://react-leaflet.js.org/docs/en/plugins.html).\
You can also read the [documentation on custom components](https://react-leaflet.js.org/docs/en/custom-components.html) to see how to implement plugins in your own code.

## Other issues

Please check among existing issues (open **and** closed) if the problem you
encounter has not been solved before.\
If you have questions about React or Leaflet not directly related to this library,
please ask them using their respective support platforms.\
For any other issue, please provide a simple description, if relevant with codes
examples. You can use
[this CodePen](https://codepen.io/PaulLeCam/pen/XVPmmj) as a
starting example.
Please check among existing issues (open **and** closed) if the problem you encounter has not been solved before.\
If you have questions about React or Leaflet not directly related to this library, please ask them using their respective support platforms.\
For any other issue, please provide a simple description, if relevant with codes examples. You can use [this CodePen](https://codepen.io/PaulLeCam/pen/XVPmmj) as a starting example.
2 changes: 1 addition & 1 deletion example/components/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class AnimateExample extends Component<{}, State> {
onClick={this.handleClick}
zoom={13}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
</Map>
Expand Down
1 change: 0 additions & 1 deletion example/components/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @flow

import Leaflet from 'leaflet'
// $FlowFixMe: missing definition
import React, { StrictMode } from 'react'

import SimpleExample from './simple'
Expand Down
2 changes: 1 addition & 1 deletion example/components/bounds.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class BoundsExample extends Component<{}, State> {
return (
<Map bounds={this.state.bounds}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Rectangle
Expand Down
2 changes: 1 addition & 1 deletion example/components/custom-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class CustomComponent extends Component<{}, State> {
return (
<Map center={[51.505, -0.09]} zoom={13}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<MyMarkersList markers={this.state.markers} />
Expand Down
7 changes: 4 additions & 3 deletions example/components/draggable-marker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow

import React, { Component } from 'react'
import React, { Component, createRef } from 'react'
import { Map, TileLayer, Marker, Popup } from '../../src'

type Position = { lat: number, lng: number }
Expand All @@ -25,7 +25,7 @@ export default class DraggableExample extends Component<{}, State> {
zoom: 13,
draggable: true,
}
refmarker = React.createRef()
refmarker = createRef()

toggleDraggable = () => {
this.setState({ draggable: !this.state.draggable })
Expand All @@ -47,13 +47,14 @@ export default class DraggableExample extends Component<{}, State> {
return (
<Map center={position} zoom={this.state.zoom}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Marker
draggable={this.state.draggable}
onDragend={this.updatePosition}
position={markerPosition}
// $FlowFixMe: no idea why it's complaining about this
ref={this.refmarker}>
<Popup minWidth={90}>
<span onClick={this.toggleDraggable}>
Expand Down
2 changes: 1 addition & 1 deletion example/components/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class EventsExample extends Component<{}, State> {
ref={this.mapRef}
zoom={13}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
{marker}
Expand Down
4 changes: 2 additions & 2 deletions example/components/layers-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export default class LayersControlExample extends Component<{}> {
<LayersControl position="topright">
<BaseLayer checked name="OpenStreetMap.Mapnik">
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
</BaseLayer>
<BaseLayer name="OpenStreetMap.BlackAndWhite">
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png"
/>
</BaseLayer>
Expand Down
2 changes: 1 addition & 1 deletion example/components/other-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class OtherLayersExample extends Component<{}> {
return (
<Map center={center} zoom={13}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<LayerGroup>
Expand Down
2 changes: 1 addition & 1 deletion example/components/pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class PaneExample extends Component<{}, { render: boolean }> {
return (
<Map bounds={outer}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
{this.state.render ? (
Expand Down
2 changes: 1 addition & 1 deletion example/components/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class SimpleExample extends Component<{}, State> {
return (
<Map center={position} zoom={this.state.zoom}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Marker position={position}>
Expand Down
2 changes: 1 addition & 1 deletion example/components/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class TooltipExample extends Component<{}, { clicked: number }> {
return (
<Map center={center} zoom={13}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Circle
Expand Down
2 changes: 1 addition & 1 deletion example/components/vector-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class VectorLayersExample extends Component<{}> {
return (
<Map center={center} zoom={13}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Circle center={center} fillColor="blue" radius={200} />
Expand Down
2 changes: 1 addition & 1 deletion example/components/video-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class VideoOverlayExample extends Component<
return (
<Map center={[25, -100]} onClick={this.onTogglePlay} zoom={4}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<VideoOverlay
Expand Down
2 changes: 1 addition & 1 deletion example/components/viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class ViewportExample extends Component<
onViewportChanged={this.onViewportChanged}
viewport={this.state.viewport}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
</Map>
Expand Down
2 changes: 1 addition & 1 deletion example/components/wms-tile-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class WMSTileLayerExample extends Component<{}, State> {
zoom={this.state.zoom}
onClick={this.onClick}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<WMSTileLayer
Expand Down
2 changes: 1 addition & 1 deletion example/components/zoom-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Map, TileLayer, ZoomControl } from '../../src'
const ZoomControlExample = () => (
<Map center={[51.505, -0.09]} zoom={13} zoomControl={false}>
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<ZoomControl position="topright" />
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-leaflet",
"version": "2.1.1",
"version": "2.1.2",
"description": "React components for Leaflet maps",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -50,7 +50,7 @@
],
"dependencies": {
"@babel/runtime": "^7.0.0",
"hoist-non-react-statics": "^3.0.1",
"hoist-non-react-statics": "^3.1.0",
"lodash": "^4.0.0",
"lodash-es": "^4.0.0",
"warning": "^4.0.0"
Expand All @@ -61,14 +61,14 @@
"react-dom": "^16.3.0"
},
"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.5",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-export-default-from": "^7.0.0",
"@babel/plugin-transform-proto-to-assign": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/plugin-transform-strict-mode": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-env": "^7.1.5",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-core": "^7.0.0-bridge.0",
Expand All @@ -78,31 +78,31 @@
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-lodash": "^3.3.4",
"cross-env": "^5.2.0",
"eslint": "^5.7.0",
"eslint": "^5.9.0",
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-flowtype": "^3.0.0",
"eslint-plugin-flowtype": "^3.2.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-prettier": "^3.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.11.1",
"flow-bin": "^0.83.0",
"flow-bin": "^0.86.0",
"flow-copy-source": "^2.0.2",
"flow-typed": "^2.5.1",
"jest": "^23.6.0",
"leaflet": "^1.3.4",
"prettier": "^1.14.3",
"prettier": "^1.15.1",
"prettier-eslint": "^8.8.2",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react": "^16.6.1",
"react-dom": "^16.6.1",
"rimraf": "^2.6.2",
"rollup": "^0.66.6",
"rollup": "^0.67.0",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-replace": "^2.1.0",
"rollup-plugin-uglify": "^6.0.0",
"webpack": "^4.22.0",
"webpack": "^4.25.1",
"webpack-serve": "^2.0.2"
},
"jest": {
Expand Down
7 changes: 4 additions & 3 deletions src/Pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import warning from 'warning'

import { LeafletProvider, withLeaflet } from './context'
import type { LeafletContext } from './types'
import { addClassName, removeClassName } from './utils/updateClassName'

const LEAFLET_PANES = [
'tile',
Expand Down Expand Up @@ -72,9 +73,9 @@ class Pane extends Component<Props, State> {
// Remove the previous css class name from the pane if it has changed.
// setStyle() will take care of adding in the updated className
if (prevProps.className && this.props.className !== prevProps.className) {
const pane = this.getPane()
const pane = this.getPane(this.state.name)
if (pane != null && prevProps.className != null) {
pane.classList.remove(prevProps.className)
removeClassName(pane, prevProps.className)
}
}

Expand Down Expand Up @@ -130,7 +131,7 @@ class Pane extends Component<Props, State> {
const pane = this.getPane(this.state.name)
if (pane) {
if (className) {
pane.classList.add(className)
addClassName(pane, className)
}
if (style) {
forEach(style, (value, key) => {
Expand Down
2 changes: 1 addition & 1 deletion src/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, {

import type { LeafletContext } from './types'

const { Consumer, Provider } = createContext({})
const { Consumer, Provider } = createContext<LeafletContext>({})

export const LeafletConsumer = Consumer
export const LeafletProvider = Provider
Expand Down
Loading

0 comments on commit ab9ec00

Please sign in to comment.