@mapcomponents/react-maplibre 0.1.22 → 0.1.26
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 +48 -8
- package/coverage/clover.xml +109 -134
- package/coverage/coverage-final.json +6 -6
- package/coverage/lcov-report/index.html +27 -27
- package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.js.html +1 -1
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.js.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.js.html +1 -1
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.js.html +43 -94
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +18 -18
- package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js.html +2 -2
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/MlMarker.js.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.js.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.js.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
- package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
- package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
- package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +1 -1
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
- package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
- package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.js.html +72 -195
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +17 -17
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.js.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +1 -1
- package/coverage/lcov-report/src/hooks/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useMap.js.html +22 -22
- package/coverage/lcov-report/src/hooks/useMapState.js.html +34 -34
- package/coverage/lcov-report/src/hooks/useWms.js.html +2 -2
- package/coverage/lcov-report/src/i18n.js.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/translations/english.js.html +1 -1
- package/coverage/lcov-report/src/translations/german.js.html +1 -1
- package/coverage/lcov-report/src/translations/index.html +1 -1
- package/coverage/lcov.info +178 -225
- package/dist/index.esm.js +108 -160
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/MlFollowGps/MlFollowGps.js +29 -46
- package/src/components/MlFollowGps/MlFollowGps.test.js +1 -1
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.js +50 -91
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.test.js +6 -6
- package/src/hooks/useWms.js +1 -1
- package/dist/b556faa3bc6829d2.png +0 -0
- package/src/components/MlFollowGps/assets/marker.png +0 -0
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useEffect, useState, useCallback } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import useMap from "../../hooks/useMap";
|
|
4
4
|
|
|
@@ -6,9 +6,6 @@ import Button from "@mui/material/Button";
|
|
|
6
6
|
import RoomIcon from "@mui/icons-material/Room";
|
|
7
7
|
import { point, circle } from "@turf/turf";
|
|
8
8
|
import MlGeoJsonLayer from "../MlGeoJsonLayer/MlGeoJsonLayer";
|
|
9
|
-
import MlImageMarkerLayer from "../MlImageMarkerLayer/MlImageMarkerLayer";
|
|
10
|
-
|
|
11
|
-
import marker from "./assets/marker.png";
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* Adds a button that makes the map follow the users GPS position using
|
|
@@ -24,25 +21,20 @@ const MlFollowGps = (props) => {
|
|
|
24
21
|
|
|
25
22
|
const [isFollowed, setIsFollowed] = useState(false);
|
|
26
23
|
const [geoJson, setGeoJson] = useState(undefined);
|
|
27
|
-
const watchIdRef = useRef(undefined);
|
|
28
24
|
const [locationAccessDenied, setLocationAccessDenied] = useState(false);
|
|
29
25
|
|
|
30
26
|
const [accuracyGeoJson, setAccuracyGeoJson] = useState();
|
|
31
27
|
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
return () => {
|
|
34
|
-
if (watchIdRef.current) {
|
|
35
|
-
navigator.geolocation.clearWatch(watchIdRef.current);
|
|
36
|
-
watchIdRef.current = undefined;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}, []);
|
|
40
|
-
|
|
41
28
|
const getLocationSuccess = useCallback(
|
|
42
29
|
(pos) => {
|
|
43
30
|
if (!mapHook.map) return;
|
|
44
31
|
|
|
45
|
-
mapHook.map.
|
|
32
|
+
mapHook.map.flyTo({
|
|
33
|
+
center: [pos.coords.longitude, pos.coords.latitude],
|
|
34
|
+
zoom: 18,
|
|
35
|
+
speed: 1,
|
|
36
|
+
curve: 1,
|
|
37
|
+
});
|
|
46
38
|
const geoJsonPoint = point([pos.coords.longitude, pos.coords.latitude]);
|
|
47
39
|
setGeoJson(geoJsonPoint);
|
|
48
40
|
setAccuracyGeoJson(circle(geoJsonPoint, pos.coords.accuracy / 1000));
|
|
@@ -59,12 +51,11 @@ const MlFollowGps = (props) => {
|
|
|
59
51
|
if (!mapHook.map) return;
|
|
60
52
|
|
|
61
53
|
if (isFollowed) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
navigator.geolocation.clearWatch(watchIdRef.current);
|
|
54
|
+
let _watchId = navigator.geolocation.watchPosition(getLocationSuccess, getLocationError);
|
|
55
|
+
|
|
56
|
+
return () => {
|
|
57
|
+
navigator.geolocation.clearWatch(_watchId);
|
|
58
|
+
};
|
|
68
59
|
}
|
|
69
60
|
}, [isFollowed, getLocationSuccess]);
|
|
70
61
|
|
|
@@ -75,30 +66,26 @@ const MlFollowGps = (props) => {
|
|
|
75
66
|
geojson={accuracyGeoJson}
|
|
76
67
|
type={"fill"}
|
|
77
68
|
paint={{
|
|
78
|
-
"fill-color": "#
|
|
79
|
-
"fill-opacity": 0.
|
|
69
|
+
"fill-color": "#cbd300",
|
|
70
|
+
"fill-opacity": 0.3,
|
|
80
71
|
...props.accuracyPaint,
|
|
81
72
|
}}
|
|
82
|
-
insertBeforeLayer={
|
|
73
|
+
insertBeforeLayer={props.insertBeforeLayer}
|
|
83
74
|
/>
|
|
84
75
|
)}
|
|
85
76
|
|
|
86
77
|
{isFollowed && geoJson && (
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"icon-size": 0.1,
|
|
97
|
-
"icon-offset": [0, -340],
|
|
98
|
-
...props.markerLayout,
|
|
99
|
-
},
|
|
78
|
+
<MlGeoJsonLayer
|
|
79
|
+
geojson={geoJson}
|
|
80
|
+
type={"circle"}
|
|
81
|
+
paint={{
|
|
82
|
+
"circle-color": "#009ee0",
|
|
83
|
+
"circle-radius": 5,
|
|
84
|
+
"circle-stroke-color": "#fafaff",
|
|
85
|
+
"circle-stroke-width": 1,
|
|
86
|
+
...props.circlePaint,
|
|
100
87
|
}}
|
|
101
|
-
|
|
88
|
+
insertBeforeLayer={props.insertBeforeLayer}
|
|
102
89
|
/>
|
|
103
90
|
)}
|
|
104
91
|
|
|
@@ -160,14 +147,10 @@ MlFollowGps.propTypes = {
|
|
|
160
147
|
*/
|
|
161
148
|
accuracyPaint: PropTypes.object,
|
|
162
149
|
/**
|
|
163
|
-
*
|
|
164
|
-
* Use any available
|
|
165
|
-
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#
|
|
166
|
-
*/
|
|
167
|
-
markerLayout: PropTypes.object,
|
|
168
|
-
/**
|
|
169
|
-
* Replace the default marker image with a custom one.
|
|
150
|
+
* position circle paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy circle.
|
|
151
|
+
* Use any available paint prop from layer type "fill".
|
|
152
|
+
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
170
153
|
*/
|
|
171
|
-
|
|
154
|
+
circlePaint: PropTypes.object,
|
|
172
155
|
};
|
|
173
156
|
export default MlFollowGps;
|
|
@@ -58,6 +58,6 @@ describe("<MlFollowGps>", () => {
|
|
|
58
58
|
wrapper.find("MlFollowGps button").simulate("click");
|
|
59
59
|
//wrapper.find(".toggle_layer_visible").simulate("click");
|
|
60
60
|
|
|
61
|
-
await waitFor(() => expect(mockGeolocation.clearWatch).toHaveBeenCalledTimes(
|
|
61
|
+
await waitFor(() => expect(mockGeolocation.clearWatch).toHaveBeenCalledTimes(1));
|
|
62
62
|
});
|
|
63
63
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import
|
|
1
|
+
import React, { useRef, useEffect } from "react";
|
|
2
|
+
import useMap from "../../hooks/useMap";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -9,90 +9,74 @@ import PropTypes from "prop-types";
|
|
|
9
9
|
* @component
|
|
10
10
|
*/
|
|
11
11
|
const MlVectorTileLayer = (props) => {
|
|
12
|
-
const
|
|
12
|
+
const mapHook = useMap({ mapId: props.mapId, waitForLayer: props.insertBeforeLayer });
|
|
13
13
|
|
|
14
|
-
const layerName = "vector-tile-layer-";
|
|
15
|
-
const sourceName = "vector-tile-source-";
|
|
16
|
-
const idSuffixRef = useRef(new Date().getTime());
|
|
17
14
|
const layerIdsRef = useRef({});
|
|
15
|
+
const layerId = useRef(props.layerId || "MlVectorTileLayer-" + mapHook.componentId);
|
|
18
16
|
const layerPaintConfsRef = useRef({});
|
|
19
17
|
const layerLayoutConfsRef = useRef({});
|
|
20
18
|
const initializedRef = useRef(false);
|
|
21
|
-
const mapRef = useRef(null);
|
|
22
|
-
|
|
23
|
-
const cleanup = () => {
|
|
24
|
-
if (mapRef.current && mapRef.current.style) {
|
|
25
|
-
for (let key in layerIdsRef.current) {
|
|
26
|
-
if (mapRef.current.getLayer(layerIdsRef.current[key])) {
|
|
27
|
-
mapRef.current.removeLayer(layerIdsRef.current[key]);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (mapRef.current.getSource(sourceName + idSuffixRef.current)) {
|
|
31
|
-
mapRef.current.removeSource(sourceName + idSuffixRef.current);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
19
|
|
|
36
20
|
useEffect(() => {
|
|
37
|
-
return
|
|
38
|
-
}, []);
|
|
39
|
-
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
if (!mapContext.mapExists(props.mapId) || initializedRef.current) return;
|
|
21
|
+
if (!mapHook.map || initializedRef.current) return;
|
|
42
22
|
|
|
43
23
|
initializedRef.current = true;
|
|
44
|
-
mapRef.current = mapContext.getMap(props.mapId);
|
|
45
24
|
|
|
46
25
|
// Add the new layer to the openlayers instance once it is available
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
26
|
+
mapHook.map.addSource(
|
|
27
|
+
layerId.current,
|
|
28
|
+
{
|
|
29
|
+
type: "vector",
|
|
30
|
+
tiles: [props.url],
|
|
31
|
+
tileSize: 512,
|
|
32
|
+
attribution: "",
|
|
33
|
+
...props.sourceOptions,
|
|
34
|
+
},
|
|
35
|
+
mapHook.componentId
|
|
36
|
+
);
|
|
54
37
|
|
|
55
38
|
for (let key in props.layers) {
|
|
56
|
-
let
|
|
57
|
-
layerIdsRef.current[key] =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
39
|
+
let _layerId = layerId.current + "_" + key;
|
|
40
|
+
layerIdsRef.current[key] = _layerId;
|
|
41
|
+
|
|
42
|
+
mapHook.map.addLayer(
|
|
43
|
+
{
|
|
44
|
+
id: _layerId,
|
|
45
|
+
source: layerId.current,
|
|
46
|
+
type: "line",
|
|
47
|
+
minzoom: 0,
|
|
48
|
+
maxzoom: 22,
|
|
49
|
+
layout: {},
|
|
50
|
+
paint: {
|
|
51
|
+
"line-opacity": 0.5,
|
|
52
|
+
"line-color": "rgb(80, 80, 80)",
|
|
53
|
+
"line-width": 2,
|
|
54
|
+
},
|
|
55
|
+
...props.layers[key],
|
|
70
56
|
},
|
|
71
|
-
|
|
72
|
-
|
|
57
|
+
props.insertBeforeLayer,
|
|
58
|
+
mapHook.componentId
|
|
59
|
+
);
|
|
73
60
|
layerPaintConfsRef.current[key] = JSON.stringify(props.layers[key].paint);
|
|
74
61
|
layerLayoutConfsRef.current[key] = JSON.stringify(props.layers[key].layout);
|
|
75
62
|
}
|
|
76
|
-
}, [
|
|
63
|
+
}, [mapHook.map, props]);
|
|
77
64
|
|
|
78
65
|
useEffect(() => {
|
|
79
|
-
if (!
|
|
80
|
-
// the MapLibre-gl instance (mapContext.map) is accessible here
|
|
66
|
+
if (!mapHook.map || !initializedRef.current) return;
|
|
81
67
|
// initialize the layer and add it to the MapLibre-gl instance or do something else with it
|
|
82
68
|
for (var key in props.layers) {
|
|
83
|
-
if (
|
|
69
|
+
if (mapHook.map.getLayer(layerIdsRef.current[key])) {
|
|
84
70
|
// update changed paint property
|
|
85
71
|
let layerPaintConfString = JSON.stringify(props.layers[key].paint);
|
|
86
72
|
|
|
87
73
|
if (layerPaintConfString !== layerPaintConfsRef.current[key]) {
|
|
88
74
|
for (let paintKey in props.layers[key].paint) {
|
|
89
|
-
|
|
90
|
-
.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
props.layers[key].paint[paintKey]
|
|
95
|
-
);
|
|
75
|
+
mapHook.map.setPaintProperty(
|
|
76
|
+
layerIdsRef.current[key],
|
|
77
|
+
paintKey,
|
|
78
|
+
props.layers[key].paint[paintKey]
|
|
79
|
+
);
|
|
96
80
|
}
|
|
97
81
|
}
|
|
98
82
|
layerPaintConfsRef.current[key] = layerPaintConfString;
|
|
@@ -102,38 +86,17 @@ const MlVectorTileLayer = (props) => {
|
|
|
102
86
|
|
|
103
87
|
if (layerLayoutConfString !== layerLayoutConfsRef.current[key]) {
|
|
104
88
|
for (let layoutKey in props.layers[key].layout) {
|
|
105
|
-
|
|
106
|
-
.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
props.layers[key].layout[layoutKey]
|
|
111
|
-
);
|
|
89
|
+
mapHook.map.setLayoutProperty(
|
|
90
|
+
layerIdsRef.current[key],
|
|
91
|
+
layoutKey,
|
|
92
|
+
props.layers[key].layout[layoutKey]
|
|
93
|
+
);
|
|
112
94
|
}
|
|
113
95
|
}
|
|
114
96
|
layerLayoutConfsRef.current[key] = layerLayoutConfString;
|
|
115
97
|
}
|
|
116
98
|
}
|
|
117
|
-
}, [props.layers,
|
|
118
|
-
|
|
119
|
-
useEffect(() => {
|
|
120
|
-
if (!mapRef.current) return;
|
|
121
|
-
|
|
122
|
-
for (var key in props.layers) {
|
|
123
|
-
if (mapRef.current.getLayer(layerIdsRef.current[key])) {
|
|
124
|
-
// toggle layer visibility by changing the layout object's visibility property
|
|
125
|
-
if (props.visible) {
|
|
126
|
-
mapContext
|
|
127
|
-
.getMap(props.mapId)
|
|
128
|
-
.setLayoutProperty(layerIdsRef.current[key], "visibility", "visible");
|
|
129
|
-
} else {
|
|
130
|
-
mapContext
|
|
131
|
-
.getMap(props.mapId)
|
|
132
|
-
.setLayoutProperty(layerIdsRef.current[key], "visibility", "none");
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}, [props.visible]);
|
|
99
|
+
}, [props.layers, mapHook.map]);
|
|
137
100
|
|
|
138
101
|
return <></>;
|
|
139
102
|
};
|
|
@@ -151,10 +114,6 @@ MlVectorTileLayer.propTypes = {
|
|
|
151
114
|
* Object that hold layers
|
|
152
115
|
*/
|
|
153
116
|
layers: PropTypes.object,
|
|
154
|
-
/**
|
|
155
|
-
* Boolean value to control the visibility of this layer
|
|
156
|
-
*/
|
|
157
|
-
visible: PropTypes.bool,
|
|
158
117
|
/**
|
|
159
118
|
* String of the URL of a wms layer
|
|
160
119
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { layerRemovalTest, sourceRemovalTest } from "../../util";
|
|
2
2
|
|
|
3
3
|
import MlVectorTileLayer from "./MlVectorTileLayer";
|
|
4
|
+
import { uuid_regex } from "../../setupTests";
|
|
4
5
|
|
|
5
6
|
const testComponent = (
|
|
6
7
|
<MlVectorTileLayer
|
|
7
8
|
{...{
|
|
8
|
-
url:
|
|
9
|
-
"https://wms.wheregroup.com/tileserver/tile/tileserver.php?/europe-0-14/index.json?/europe-0-14/{z}/{x}/{y}.pbf",
|
|
9
|
+
url: "https://wms.wheregroup.com/tileserver/tile/tileserver.php?/europe-0-14/index.json?/europe-0-14/{z}/{x}/{y}.pbf",
|
|
10
10
|
layers: {
|
|
11
11
|
landuseLine: {
|
|
12
12
|
"source-layer": "landuse",
|
|
@@ -28,12 +28,12 @@ const testComponent = (
|
|
|
28
28
|
layerRemovalTest(
|
|
29
29
|
"<MlVectorTileLayer />",
|
|
30
30
|
testComponent,
|
|
31
|
-
|
|
32
|
-
"
|
|
31
|
+
new RegExp('^.*"MlVectorTileLayer-' + uuid_regex + '_landuseLine".*$'),
|
|
32
|
+
"MlVectorTileLayer-{uuid}_landuseLine"
|
|
33
33
|
);
|
|
34
34
|
sourceRemovalTest(
|
|
35
35
|
"<MlVectorTileLayer />",
|
|
36
36
|
testComponent,
|
|
37
|
-
|
|
38
|
-
"
|
|
37
|
+
new RegExp('^.*"MlVectorTileLayer-' + uuid_regex + '".*$'),
|
|
38
|
+
"MlVectorTileLayer-{uuid}"
|
|
39
39
|
);
|
package/src/hooks/useWms.js
CHANGED
|
@@ -63,7 +63,7 @@ function useWms(props) {
|
|
|
63
63
|
useEffect(() => {
|
|
64
64
|
if (!capabilities?.Service) return;
|
|
65
65
|
|
|
66
|
-
setWmsUrl(capabilities.
|
|
66
|
+
setWmsUrl(capabilities.Capability?.Request?.GetMap?.DCPType?.[0]?.HTTP?.Get?.OnlineResource);
|
|
67
67
|
// set getFeatureInfo url
|
|
68
68
|
setGetFeatureInfoUrl(
|
|
69
69
|
capabilities.Capability?.Request?.GetFeatureInfo?.DCPType?.[0]?.HTTP?.Get?.OnlineResource
|
|
Binary file
|
|
Binary file
|