@mapcomponents/react-maplibre 1.1.0-1 → 1.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 +15 -0
- package/dist/index.cjs.js +81 -178
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +81 -178
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/MlLayerSwipe/assets/SwipeIcon.d.ts +10 -0
- package/dist/src/components/MlNavigationCompass/assets/CompassBackground.d.ts +9 -0
- package/dist/src/components/MlNavigationCompass/assets/CompassNeedle.d.ts +9 -0
- package/dist/src/components/MlShareMapState/MlShareMapState.d.ts +0 -7
- package/dist/src/components/MlThreeJsLayer/MlThreeJsLayer.d.ts +1 -18
- package/dist/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.d.ts +0 -7
- package/dist/src/components/MlWmsLayer/MlWmsLayer.d.ts +0 -46
- package/dist/src/contexts/SimpleDataProvider.d.ts +1 -7
- package/dist/src/protocol_handlers/osm.d.ts +0 -1
- package/dist/src/ui_components/LoadingOverlayContext.d.ts +1 -7
- package/package.json +35 -34
- package/rollup.config.mjs +15 -16
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface CompassBackgroundProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
declare const CompassBackground: React.FC<CompassBackgroundProps>;
|
|
9
|
+
export default CompassBackground;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
export interface MapState {
|
|
4
3
|
lat?: number;
|
|
5
4
|
lng?: number;
|
|
@@ -32,11 +31,5 @@ declare const MlShareMapState: {
|
|
|
32
31
|
defaultProps: {
|
|
33
32
|
mapId: undefined;
|
|
34
33
|
};
|
|
35
|
-
propTypes: {
|
|
36
|
-
/**
|
|
37
|
-
* Id of the target MapLibre instance in mapContext
|
|
38
|
-
*/
|
|
39
|
-
mapId: PropTypes.Requireable<string>;
|
|
40
|
-
};
|
|
41
34
|
};
|
|
42
35
|
export default MlShareMapState;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
/**
|
|
4
3
|
* Renders obj or gltf 3D Models on the MapLibreMap referenced by props.mapId
|
|
5
4
|
*
|
|
@@ -10,21 +9,5 @@ export interface MlThreeJsLayerProps {
|
|
|
10
9
|
init?: () => void;
|
|
11
10
|
onDone?: () => void;
|
|
12
11
|
}
|
|
13
|
-
declare const MlThreeJsLayer:
|
|
14
|
-
(props: MlThreeJsLayerProps): React.JSX.Element;
|
|
15
|
-
propTypes: {
|
|
16
|
-
/**
|
|
17
|
-
* Id of the target MapLibre instance in mapContext
|
|
18
|
-
*/
|
|
19
|
-
mapId: PropTypes.Requireable<string>;
|
|
20
|
-
/**
|
|
21
|
-
* function that gets called when initialized
|
|
22
|
-
*/
|
|
23
|
-
init: PropTypes.Requireable<(...args: any[]) => any>;
|
|
24
|
-
/**
|
|
25
|
-
* function that gets called when models are loaded
|
|
26
|
-
*/
|
|
27
|
-
onDone: PropTypes.Requireable<(...args: any[]) => any>;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
12
|
+
declare const MlThreeJsLayer: (props: MlThreeJsLayerProps) => React.JSX.Element;
|
|
30
13
|
export default MlThreeJsLayer;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
export interface MlWmsFeatureInfoPopupProps {
|
|
4
3
|
/**
|
|
5
4
|
* Id of the target MapLibre instance in mapContext
|
|
@@ -19,11 +18,5 @@ declare const MlWmsFeatureInfoPopup: {
|
|
|
19
18
|
defaultProps: {
|
|
20
19
|
mapId: undefined;
|
|
21
20
|
};
|
|
22
|
-
propTypes: {
|
|
23
|
-
/**
|
|
24
|
-
* Id of the target MapLibre instance in mapContext
|
|
25
|
-
*/
|
|
26
|
-
mapId: PropTypes.Requireable<string>;
|
|
27
|
-
};
|
|
28
21
|
};
|
|
29
22
|
export default MlWmsFeatureInfoPopup;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { RasterLayerSpecification, RasterSourceSpecification } from 'maplibre-gl';
|
|
4
3
|
export interface MlWmsLayerProps {
|
|
5
4
|
urlParameters?: {
|
|
@@ -55,50 +54,5 @@ declare const MlWmsLayer: {
|
|
|
55
54
|
maxZoom: number;
|
|
56
55
|
};
|
|
57
56
|
};
|
|
58
|
-
propTypes: {
|
|
59
|
-
/**
|
|
60
|
-
* WMS URL
|
|
61
|
-
*/
|
|
62
|
-
url: PropTypes.Validator<string>;
|
|
63
|
-
/**
|
|
64
|
-
* URL query parameters that will be added to the WMS URL. A layers property (string) is mandatory. Any value defined on this attribute will extend the default object.
|
|
65
|
-
*/
|
|
66
|
-
urlParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
67
|
-
layers: PropTypes.Validator<string>;
|
|
68
|
-
bbox: PropTypes.Requireable<string>;
|
|
69
|
-
format: PropTypes.Requireable<string>;
|
|
70
|
-
service: PropTypes.Requireable<string>;
|
|
71
|
-
version: PropTypes.Requireable<string>;
|
|
72
|
-
request: PropTypes.Requireable<string>;
|
|
73
|
-
srs: PropTypes.Requireable<string>;
|
|
74
|
-
width: PropTypes.Requireable<number>;
|
|
75
|
-
height: PropTypes.Requireable<number>;
|
|
76
|
-
}>>;
|
|
77
|
-
/**
|
|
78
|
-
* Id of the target MapLibre instance in mapContext
|
|
79
|
-
*/
|
|
80
|
-
mapId: PropTypes.Requireable<string>;
|
|
81
|
-
/**
|
|
82
|
-
* MapLibre attribution shown in the bottom right of the map, if this layer is visible
|
|
83
|
-
*/
|
|
84
|
-
attribution: PropTypes.Requireable<string>;
|
|
85
|
-
/**
|
|
86
|
-
* Object that is passed to the MapLibre.addLayer call as config option parameter
|
|
87
|
-
*/
|
|
88
|
-
layerOptions: PropTypes.Requireable<object>;
|
|
89
|
-
/**
|
|
90
|
-
* Object that is passed to the MapLibre.addSource call as config option parameter
|
|
91
|
-
*/
|
|
92
|
-
sourceOptions: PropTypes.Requireable<object>;
|
|
93
|
-
/**
|
|
94
|
-
* Id of an existing layer in the mapLibre instance to help specify the layer order
|
|
95
|
-
* This layer will be visually beneath the layer with the "insertBeforeLayer" id.
|
|
96
|
-
*/
|
|
97
|
-
insertBeforeLayer: PropTypes.Requireable<string>;
|
|
98
|
-
/**
|
|
99
|
-
* Sets layer "visibility" property to "visible" if true or "none" if false
|
|
100
|
-
*/
|
|
101
|
-
visible: PropTypes.Requireable<boolean>;
|
|
102
|
-
};
|
|
103
57
|
};
|
|
104
58
|
export default MlWmsLayer;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
export interface SimpleDataProviderProps {
|
|
4
3
|
url: string;
|
|
5
4
|
format: 'json' | 'csv' | 'xml';
|
|
@@ -9,10 +8,5 @@ export interface SimpleDataProviderProps {
|
|
|
9
8
|
onData: () => void;
|
|
10
9
|
children: React.ReactNode;
|
|
11
10
|
}
|
|
12
|
-
declare const SimpleDataProvider:
|
|
13
|
-
(props: SimpleDataProviderProps): React.JSX.Element;
|
|
14
|
-
propTypes: {
|
|
15
|
-
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
11
|
+
declare const SimpleDataProvider: (props: SimpleDataProviderProps) => React.JSX.Element;
|
|
18
12
|
export default SimpleDataProvider;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
declare const LoadingOverlayContext: React.Context<{}>;
|
|
4
|
-
declare const LoadingOverlayProvider:
|
|
5
|
-
(children: React.ReactNode): React.JSX.Element;
|
|
6
|
-
propTypes: {
|
|
7
|
-
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
3
|
+
declare const LoadingOverlayProvider: (children: React.ReactNode) => React.JSX.Element;
|
|
10
4
|
export { LoadingOverlayContext, LoadingOverlayProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapcomponents/react-maplibre",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -20,20 +20,22 @@
|
|
|
20
20
|
"create-component": "./scripts/create-map-component.sh"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
+
"@cypress/react": "^9.0.1",
|
|
23
24
|
"@dnd-kit/core": "^6.3.1",
|
|
24
25
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
25
26
|
"@dnd-kit/sortable": "^10.0.0",
|
|
26
27
|
"@emotion/css": "^11.13.5",
|
|
27
28
|
"@emotion/react": "^11.14.0",
|
|
28
29
|
"@emotion/styled": "^11.14.0",
|
|
29
|
-
"@eslint/eslintrc": "^3.3.
|
|
30
|
-
"@eslint/js": "^9.
|
|
30
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
31
|
+
"@eslint/js": "^9.23.0",
|
|
31
32
|
"@mapbox/mapbox-gl-draw": "1.4.3",
|
|
32
33
|
"@mapbox/mapbox-gl-sync-move": "^0.3.1",
|
|
33
|
-
"@mui/icons-material": "^
|
|
34
|
-
"@mui/material": "^
|
|
34
|
+
"@mui/icons-material": "^7.0.0",
|
|
35
|
+
"@mui/material": "^7.0.0",
|
|
35
36
|
"@reduxjs/toolkit": "^2.6.1",
|
|
36
37
|
"@rollup/plugin-json": "^6.1.0",
|
|
38
|
+
"@storybook/theming": "^8.6.11",
|
|
37
39
|
"@testing-library/dom": "^10.4.0",
|
|
38
40
|
"@tmcw/togeojson": "^7.0.0",
|
|
39
41
|
"@turf/turf": "^7.2.0",
|
|
@@ -45,9 +47,9 @@
|
|
|
45
47
|
"csv2geojson": "^5.1.2",
|
|
46
48
|
"d3": "^7.9.0",
|
|
47
49
|
"globals": "^16.0.0",
|
|
48
|
-
"jspdf": "^3.0.
|
|
49
|
-
"maplibre-gl": "5.
|
|
50
|
-
"osm2geojson-lite": "^1.0.
|
|
50
|
+
"jspdf": "^3.0.1",
|
|
51
|
+
"maplibre-gl": "5.3.0",
|
|
52
|
+
"osm2geojson-lite": "^1.0.3",
|
|
51
53
|
"pako": "^2.1.0",
|
|
52
54
|
"react-color": "^2.19.3",
|
|
53
55
|
"react-moveable": "^0.56.0",
|
|
@@ -62,26 +64,22 @@
|
|
|
62
64
|
"devDependencies": {
|
|
63
65
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
64
66
|
"@babel/preset-react": "^7.26.3",
|
|
65
|
-
"@babel/preset-typescript": "^7.26.0",
|
|
66
67
|
"@bahmutov/cy-rollup": "^2.0.0",
|
|
67
|
-
"@cfaester/enzyme-adapter-react-18": "^0.8.0",
|
|
68
|
-
"@cypress/react18": "^2.0.1",
|
|
69
68
|
"@rollup/plugin-babel": "^6.0.4",
|
|
70
69
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
71
70
|
"@rollup/plugin-url": "^8.0.2",
|
|
72
|
-
"@storybook/addon-actions": "^8.6.
|
|
73
|
-
"@storybook/addon-docs": "^8.6.
|
|
74
|
-
"@storybook/addon-essentials": "^8.6.
|
|
75
|
-
"@storybook/addon-links": "^8.6.
|
|
71
|
+
"@storybook/addon-actions": "^8.6.11",
|
|
72
|
+
"@storybook/addon-docs": "^8.6.11",
|
|
73
|
+
"@storybook/addon-essentials": "^8.6.11",
|
|
74
|
+
"@storybook/addon-links": "^8.6.11",
|
|
76
75
|
"@storybook/addons": "^7.6.17",
|
|
77
|
-
"@storybook/node-logger": "^8.6.
|
|
78
|
-
"@storybook/react": "^8.6.
|
|
79
|
-
"@storybook/react-webpack5": "^8.6.
|
|
80
|
-
"@storybook/test": "^8.6.
|
|
76
|
+
"@storybook/node-logger": "^8.6.11",
|
|
77
|
+
"@storybook/react": "^8.6.11",
|
|
78
|
+
"@storybook/react-webpack5": "^8.6.11",
|
|
79
|
+
"@storybook/test": "^8.6.11",
|
|
81
80
|
"@storybook/testing-react": "^2.0.1",
|
|
82
|
-
"@storybook/theming": "^8.6.4",
|
|
83
|
-
"@svgr/rollup": "^8.1.0",
|
|
84
81
|
"@testing-library/react": "^16.2.0",
|
|
82
|
+
"@types/chai": "^5.2.1",
|
|
85
83
|
"@types/elasticlunr": "^0.9.5",
|
|
86
84
|
"@types/enzyme": "^3.10.18",
|
|
87
85
|
"@types/expect": "^24.3.2",
|
|
@@ -89,27 +87,28 @@
|
|
|
89
87
|
"@types/mapbox__mapbox-gl-draw": "^1.4.8",
|
|
90
88
|
"@types/mapbox__point-geometry": "^0.1.4",
|
|
91
89
|
"@types/mapbox__vector-tile": "^2.0.0",
|
|
90
|
+
"@types/mocha": "^10.0.10",
|
|
92
91
|
"@types/pako": "^2.0.3",
|
|
93
|
-
"@types/react": "^19.0.
|
|
92
|
+
"@types/react": "^19.0.12",
|
|
94
93
|
"@types/react-dom": "^19.0.4",
|
|
95
94
|
"@types/sql.js": "^1.4.9",
|
|
96
95
|
"@types/three": "^0.174.0",
|
|
97
96
|
"@types/uuid": "^10.0.0",
|
|
98
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
99
|
-
"@typescript-eslint/parser": "^8.
|
|
97
|
+
"@typescript-eslint/eslint-plugin": "^8.28.0",
|
|
98
|
+
"@typescript-eslint/parser": "^8.28.0",
|
|
100
99
|
"avj": "^0.0.0",
|
|
101
100
|
"babel-jest": "^29.7.0",
|
|
102
101
|
"babel-loader": "^10.0.0",
|
|
103
102
|
"babel-plugin-inline-react-svg": "^2.0.2",
|
|
104
103
|
"babel-plugin-styled-components": "^2.1.4",
|
|
105
104
|
"babel-preset-react-app": "^10.1.0",
|
|
106
|
-
"
|
|
105
|
+
"chai": "^5.2.0",
|
|
106
|
+
"cypress": "^14.2.1",
|
|
107
107
|
"elasticlunr": "^0.9.5",
|
|
108
|
-
"
|
|
109
|
-
"eslint": "^9.22.0",
|
|
108
|
+
"eslint": "^9.23.0",
|
|
110
109
|
"eslint-config-prettier": "^10.1.1",
|
|
111
110
|
"eslint-plugin-react": "^7.37.4",
|
|
112
|
-
"eslint-plugin-storybook": "^0.
|
|
111
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
113
112
|
"glob": "^11.0.1",
|
|
114
113
|
"jest": "29.7.0",
|
|
115
114
|
"jest-circus": "29.7.0",
|
|
@@ -117,26 +116,28 @@
|
|
|
117
116
|
"jest-enzyme": "^7.1.2",
|
|
118
117
|
"jest-resolve": "29.7.0",
|
|
119
118
|
"jest-watch-typeahead": "2.2.2",
|
|
119
|
+
"mocha": "^11.1.0",
|
|
120
120
|
"node-fetch": "^3.3.2",
|
|
121
121
|
"postcss": "^8.5.3",
|
|
122
122
|
"prettier": "3.5.3",
|
|
123
|
-
"react": "^
|
|
123
|
+
"react": "^19.0.0",
|
|
124
124
|
"react-app-polyfill": "^3.0.0",
|
|
125
125
|
"react-dev-utils": "^12.0.1",
|
|
126
|
-
"react-dom": "^
|
|
126
|
+
"react-dom": "^19.0.0",
|
|
127
127
|
"react-draggable": "^4.4.6",
|
|
128
128
|
"react-i18next": "^15.4.1",
|
|
129
|
-
"rollup": "^4.
|
|
129
|
+
"rollup": "^4.37.0",
|
|
130
130
|
"rollup-plugin-delete": "^3.0.1",
|
|
131
131
|
"rollup-plugin-import-css": "^3.5.8",
|
|
132
132
|
"rollup-plugin-node-externals": "^8.0.0",
|
|
133
133
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
134
134
|
"showdown": "^2.1.0",
|
|
135
|
-
"sql.js": "^1.
|
|
136
|
-
"storybook": "^8.6.
|
|
135
|
+
"sql.js": "^1.13.0",
|
|
136
|
+
"storybook": "^8.6.11",
|
|
137
137
|
"storybook-source-link": "^4.0.1",
|
|
138
|
-
"ts-jest": "^29.
|
|
138
|
+
"ts-jest": "^29.3.0",
|
|
139
139
|
"ts-loader": "^9.5.2",
|
|
140
|
+
"ts-node": "^10.9.2",
|
|
140
141
|
"typescript": "^5.8.2"
|
|
141
142
|
},
|
|
142
143
|
"jest": {
|
package/rollup.config.mjs
CHANGED
|
@@ -8,7 +8,6 @@ import externals from 'rollup-plugin-node-externals';
|
|
|
8
8
|
|
|
9
9
|
import css from 'rollup-plugin-import-css';
|
|
10
10
|
import del from 'rollup-plugin-delete';
|
|
11
|
-
import svgr from '@svgr/rollup';
|
|
12
11
|
import * as fs from 'node:fs';
|
|
13
12
|
|
|
14
13
|
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
@@ -16,7 +15,7 @@ const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
|
16
15
|
const externalsConfig = {
|
|
17
16
|
deps: true,
|
|
18
17
|
devDeps: true,
|
|
19
|
-
exclude:['react', 'react-dom']
|
|
18
|
+
exclude: ['react', 'react-dom'],
|
|
20
19
|
};
|
|
21
20
|
|
|
22
21
|
const config = defineConfig([
|
|
@@ -24,29 +23,29 @@ const config = defineConfig([
|
|
|
24
23
|
input: ['src/index.ts'],
|
|
25
24
|
output: [
|
|
26
25
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
file: 'dist/index.cjs.js',
|
|
27
|
+
format: 'cjs',
|
|
28
|
+
sourcemap: true,
|
|
30
29
|
},
|
|
31
30
|
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
file: 'dist/index.esm.js',
|
|
32
|
+
format: 'es',
|
|
33
|
+
sourcemap: true,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
37
36
|
plugins: [
|
|
38
|
-
svgr({
|
|
39
|
-
svgo: false,
|
|
40
|
-
}),
|
|
41
37
|
url(),
|
|
42
38
|
babel({
|
|
43
39
|
presets: ['@babel/preset-react'],
|
|
44
|
-
babelHelpers: 'bundled'
|
|
40
|
+
babelHelpers: 'bundled',
|
|
45
41
|
}),
|
|
46
42
|
externals(externalsConfig),
|
|
47
43
|
commonjs(),
|
|
48
|
-
typescript({
|
|
49
|
-
|
|
44
|
+
typescript({
|
|
45
|
+
declarationDir: 'dist/types',
|
|
46
|
+
sourceMap: true,
|
|
47
|
+
exclude: ['**/*.cy.tsx', '**/*.stories.tsx', '**/*.test.tsx'],
|
|
48
|
+
}),
|
|
50
49
|
css(),
|
|
51
50
|
del({ targets: ['dist/*'] }),
|
|
52
51
|
],
|