react-leaflet-deflate 3.1.1 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,35 +1,44 @@
1
- react-leaflet-deflate Changelog
2
- =========================
3
-
4
-
5
- ## 3.1.0 (2025-12-05)
6
-
7
- * Add gh-pages docs
8
- * Update dependencies
9
-
10
-
11
- ## 3.0.1 (2025-11-28)
12
-
13
- * NPM Audit Fix
14
-
15
- ## 3.0.0 (2025-11-07)
16
-
17
- * Update Leaflet.Deflate dependency to 2.1.0.
18
- * Update Leaflet dependency to 1.9.4
19
- * Update react-leaflet dependency to 5.0.0
20
- * Update react dependency to 19.2.0
21
-
22
- ## 2.2.1 (2019-02-11)
23
-
24
- * Update Leaflet.Deflate dependency to 1.1.0 ([PR #5](https://github.com/mhasbie/react-leaflet-deflate/pull/5) by _oliverroick_).
25
- * Remove unused dependencies
26
-
27
-
28
- ## 2.2.0 (2019-01-20)
29
-
30
- * Make compatible with `react-leaflet@2.x`
31
- * Update dependencies
32
- * Update README
33
- * Add example
34
- * Add unit test
35
- * Bugs fixes
1
+ react-leaflet-deflate Changelog
2
+ =========================
3
+
4
+ ## 3.1.3 (2026-11-14)
5
+
6
+ * Fix UMD build runtime error when `markerCluster` is enabled: use Leaflet's `DomUtil.addClass` instead of the mis-externalized `@react-leaflet/core` helper.
7
+ * Remove unused dependencies.
8
+ * Add `react` to `peerDependencies`.
9
+ * Align `jest-environment-jsdom` with Jest 29.
10
+
11
+ ## 3.1.2 (2026-01-11)
12
+
13
+ * NPM Audit Fix
14
+
15
+ ## 3.1.0 (2025-12-05)
16
+
17
+ * Add gh-pages docs
18
+ * Update dependencies
19
+
20
+ ## 3.0.1 (2025-11-28)
21
+
22
+ * NPM Audit Fix
23
+
24
+ ## 3.0.0 (2025-11-07)
25
+
26
+ * Update Leaflet.Deflate dependency to 2.1.0.
27
+ * Update Leaflet dependency to 1.9.4
28
+ * Update react-leaflet dependency to 5.0.0
29
+ * Update react dependency to 19.2.0
30
+
31
+ ## 2.2.1 (2019-02-11)
32
+
33
+ * Update Leaflet.Deflate dependency to 1.1.0 ([PR #5](https://github.com/mhasbie/react-leaflet-deflate/pull/5) by _oliverroick_).
34
+ * Remove unused dependencies
35
+
36
+
37
+ ## 2.2.0 (2019-01-20)
38
+
39
+ * Make compatible with `react-leaflet@2.x`
40
+ * Update dependencies
41
+ * Update README
42
+ * Add example
43
+ * Add unit test
44
+ * Bugs fixes
package/LICENSE CHANGED
@@ -1,19 +1,19 @@
1
- The MIT License (MIT)
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,89 +1,116 @@
1
- # react-leaflet-deflate
2
-
3
-
4
- [![version](https://img.shields.io/npm/v/react-leaflet-deflate.svg?style=plastic)](http://npm.im/react-leaflet-deflate)
5
- [![react-leaflet compatibility](https://img.shields.io/npm/dependency-version/react-leaflet-deflate/peer/react-leaflet.svg?style=plastic)](https://github.com/mhasbie/react-leaflet-deflate)
6
- [![issues](https://img.shields.io/github/issues/mhasbie/react-leaflet-deflate.svg?style=plastic)](https://github.com/mhasbie/react-leaflet-deflate/issues)
7
- [![downloads](https://img.shields.io/npm/dt/react-leaflet-deflate.svg?style=plastic)](http://npm-stat.com/charts.html?package=react-leaflet-deflate&from=2018-01-01)
8
- [![MIT License](https://img.shields.io/npm/l/react-leaflet-deflate.svg?style=plastic)](http://opensource.org/licenses/MIT)
9
-
10
- React wrapper of [Leaflet.Deflate](
11
- https://github.com/oliverroick/Leaflet.Deflate)
12
- for [react-leaflet](https://github.com/PaulLeCam/react-leaflet).
13
-
14
- Substitutes polygons and lines with markers when their screen size falls below a defined threshold.
15
-
16
- *Tested with React 19.2.0, Leaflet 1.9.4, React-Leaflet 5.0.0, React-Leaflet 4.0.0, Leaflet.Deflate 2.1.0*
17
-
18
- ![Example](https://cloud.githubusercontent.com/assets/159510/7164588/090c06fe-e399-11e4-956d-0283ef7e69cf.gif)
19
-
20
- ## Demos
21
-
22
- | Version | Demo |
23
- | --- | --- |
24
- | `react-leaflet@1.9.1` | [`CodePen`](https://codepen.io/m_hasbie/full/jvgeVR/) |
25
- | `react-leaflet@2.x` | [`CodePen`](https://codepen.io/m_hasbie/full/MqNPRy/) |
26
- | `react-leaflet@5.x` | [`CodePen`](https://codepen.io/m_hasbie/full/wBGampr) |
27
-
28
-
29
- ## Installation
30
-
31
- ### Install via NPM
32
-
33
- ```bash
34
- npm install --save react-leaflet-deflate
35
- ```
36
-
37
- `react-leaflet-deflate` requires `leaflet.markercluster` as [`peerDependency`](https://docs.npmjs.com/files/package.json#peerdependencies)
38
-
39
- (React, Leaflet, react-leaflet also should be installed)
40
- ```bash
41
- npm install --save leaflet.markercluster
42
- ```
43
-
44
- ## Usage example
45
-
46
- ### react-leaflet v5
47
-
48
- ```javascript
49
- import { MapContainer, TileLayer } from 'react-leaflet';
50
- import Deflate from 'react-leaflet-deflate';
51
-
52
- const geojson = {...};
53
-
54
- <MapContainer center={[2.935403, 101.448205]} zoom={10}>
55
- <TileLayer
56
- url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
57
- attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
58
- />
59
-
60
- <Deflate
61
- data={geojson}
62
- minSize={10}
63
- markerCluster={true}
64
- />
65
- </MapContainer>
66
- ```
67
-
68
- ### Options
69
-
70
- Option | Type | Default | Description
71
- --------------- | --------- | ------- | -------------
72
- `data` | `object` | `{}` | Required. A valid [GeoJSON object](http://geojson.org/geojson-spec.html).
73
- `minSize` | `int` | `20` | Defines the minimum width and height in pixels for a path to be displayed in its actual shape.
74
- `markerOptions` | `object` or `function` | `{}` | Optional. Customize the markers of deflated features using [Leaflet marker options](http://leafletjs.com/reference-1.3.0.html#marker).
75
- `markerCluster` | `boolean` | `false` | Indicates whether markers should be clustered. Requires `Leaflet.markercluster`.
76
- `markerClusterOptions` | `object` | `{}` | Optional. Customize the appearance and behaviour of clustered markers using [`Leaflet.markercluster` options](https://github.com/Leaflet/Leaflet.markercluster#options).
77
- `pointToLayer` | `function` | `{}` | [Leaflet geojson pointToLayer options](http://leafletjs.com/reference-1.3.0.html#geojson-pointtolayer).
78
- `style` | `function` | `{}` | Style to apply to polygons or lines. [Leaflet geojson style options](https://leafletjs.com/reference.html#geojson-style).
79
- `onEachFeature` | `function` | `{}` | Function to execute on each geojson feature. [Leaflet geojson onEachFeature options](https://leafletjs.com/reference.html#geojson-oneachfeature).
80
- `filter` | `function` | `{}` | Filter function to apply to geojson features. [Leaflet geojson filter options](https://leafletjs.com/reference.html#geojson-filter).
81
-
82
-
83
- # Credits
84
- - [oliverroick](https://github.com/oliverroick) and the other [contributors](https://github.com/oliverroick/Leaflet.Deflate/graphs/contributors) to for the original work on `Leaflet.Deflate`.
85
- - [clintharris](https://github.com/clintharris) for updating `react-leaflet-deflate` to reference `Leaflet.Deflate` as an external dependency, support property changes, and work with `react-leaflet` v2.
86
-
87
- # License
88
-
89
- MIT License
1
+ # react-leaflet-deflate
2
+
3
+
4
+ [![version](https://img.shields.io/npm/v/react-leaflet-deflate.svg?style=plastic)](http://npm.im/react-leaflet-deflate)
5
+ [![react-leaflet compatibility](https://img.shields.io/npm/dependency-version/react-leaflet-deflate/peer/react-leaflet.svg?style=plastic)](https://github.com/mhasbie/react-leaflet-deflate)
6
+ [![issues](https://img.shields.io/github/issues/mhasbie/react-leaflet-deflate.svg?style=plastic)](https://github.com/mhasbie/react-leaflet-deflate/issues)
7
+ [![downloads](https://img.shields.io/npm/dt/react-leaflet-deflate.svg?style=plastic)](http://npm-stat.com/charts.html?package=react-leaflet-deflate&from=2018-01-01)
8
+ [![MIT License](https://img.shields.io/npm/l/react-leaflet-deflate.svg?style=plastic)](http://opensource.org/licenses/MIT)
9
+
10
+ React wrapper of [Leaflet.Deflate](
11
+ https://github.com/oliverroick/Leaflet.Deflate)
12
+ for [react-leaflet](https://github.com/PaulLeCam/react-leaflet).
13
+
14
+ Substitutes polygons and lines with markers when their screen size falls below a defined threshold.
15
+
16
+ *Tested with React 19.2.0, Leaflet 1.9.4, React-Leaflet 5.0.0, React-Leaflet 4.0.0, Leaflet.Deflate 2.1.0*
17
+
18
+ ![Example](https://cloud.githubusercontent.com/assets/159510/7164588/090c06fe-e399-11e4-956d-0283ef7e69cf.gif)
19
+
20
+ ## Demos
21
+
22
+ | Version | Demo |
23
+ | --- | --- |
24
+ | `react-leaflet@1.9.1` | [`CodePen`](https://codepen.io/m_hasbie/full/jvgeVR/) |
25
+ | `react-leaflet@2.x` | [`CodePen`](https://codepen.io/m_hasbie/full/MqNPRy/) |
26
+ | `react-leaflet@5.x` | [`CodePen`](https://codepen.io/m_hasbie/full/wBGampr) |
27
+
28
+
29
+ ## Installation
30
+
31
+ ### Install via NPM
32
+
33
+ ```bash
34
+ npm install --save react-leaflet-deflate
35
+ ```
36
+
37
+ `react-leaflet-deflate` requires `leaflet.markercluster` as [`peerDependency`](https://docs.npmjs.com/files/package.json#peerdependencies)
38
+
39
+ (React, Leaflet, react-leaflet also should be installed)
40
+ ```bash
41
+ npm install --save leaflet.markercluster
42
+ ```
43
+
44
+ ## Releases
45
+
46
+ Merging a pull request into `master` runs the release workflow. Before merging a release PR, update the version in both `package.json` and `package-lock.json`. The workflow uses that version to stage the package on npm and create the GitHub Release tag (`v<version>`), and stops if the tag already exists. The GitHub Release is created when staging succeeds; the npm version is not publicly available until it is approved.
47
+
48
+ ## Usage example
49
+
50
+ ### react-leaflet v5
51
+
52
+ ```javascript
53
+ import { MapContainer, TileLayer } from 'react-leaflet';
54
+ import Deflate from 'react-leaflet-deflate';
55
+
56
+ const geojson = {...};
57
+
58
+ <MapContainer center={[2.935403, 101.448205]} zoom={10}>
59
+ <TileLayer
60
+ url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
61
+ attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
62
+ />
63
+
64
+ <Deflate
65
+ data={geojson}
66
+ minSize={10}
67
+ markerCluster={true}
68
+ />
69
+ </MapContainer>
70
+ ```
71
+
72
+ ### Options
73
+
74
+ Option | Type | Default | Description
75
+ --------------- | --------- | ------- | -------------
76
+ `data` | `object` | `{}` | Required. A valid [GeoJSON object](http://geojson.org/geojson-spec.html).
77
+ `minSize` | `int` | `20` | Defines the minimum width and height in pixels for a path to be displayed in its actual shape.
78
+ `markerOptions` | `object` or `function` | `{}` | Optional. Customize the markers of deflated features using [Leaflet marker options](http://leafletjs.com/reference-1.3.0.html#marker).
79
+ `markerCluster` | `boolean` | `false` | Indicates whether markers should be clustered. Requires `Leaflet.markercluster`.
80
+ `markerClusterOptions` | `object` | `{}` | Optional. Customize the appearance and behaviour of clustered markers using [`Leaflet.markercluster` options](https://github.com/Leaflet/Leaflet.markercluster#options).
81
+ `pointToLayer` | `function` | `{}` | [Leaflet geojson pointToLayer options](http://leafletjs.com/reference-1.3.0.html#geojson-pointtolayer).
82
+ `style` | `function` | `{}` | Style to apply to polygons or lines. [Leaflet geojson style options](https://leafletjs.com/reference.html#geojson-style).
83
+ `onEachFeature` | `function` | `{}` | Function to execute on each geojson feature. [Leaflet geojson onEachFeature options](https://leafletjs.com/reference.html#geojson-oneachfeature).
84
+ `filter` | `function` | `{}` | Filter function to apply to geojson features. [Leaflet geojson filter options](https://leafletjs.com/reference.html#geojson-filter).
85
+
86
+
87
+ # Credits
88
+ - [oliverroick](https://github.com/oliverroick) and the other [contributors](https://github.com/oliverroick/Leaflet.Deflate/graphs/contributors) to for the original work on `Leaflet.Deflate`.
89
+ - [clintharris](https://github.com/clintharris) for updating `react-leaflet-deflate` to reference `Leaflet.Deflate` as an external dependency, support property changes, and work with `react-leaflet` v2.
90
+
91
+ # Tests
92
+
93
+ For instructions on the browser debug example, see [example/README.md](example/README.md).
94
+
95
+ Run the Jest/React Testing Library unit suite with:
96
+
97
+ ```bash
98
+ npm test
99
+ ```
100
+
101
+ The Playwright tests run a local Leaflet fixture without external tiles or CDN dependencies. Install the Chromium browser once, then run:
102
+
103
+ ```bash
104
+ npx playwright install chromium
105
+ npm run test:e2e
106
+ ```
107
+
108
+ To run both suites:
109
+
110
+ ```bash
111
+ npm run test:all
112
+ ```
113
+
114
+ # License
115
+
116
+ MIT License