@mapcomponents/react-maplibre 0.1.58 → 0.1.60
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/coverage/clover.xml +59 -55
- package/coverage/coverage-final.json +6 -6
- package/coverage/lcov-report/index.html +34 -34
- package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCenterPosition/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx.html +11 -11
- package/coverage/lcov-report/src/components/MlCreatePdfForm/index.html +13 -13
- package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.tsx.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.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/index.html +1 -1
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.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.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.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/MlOsmLayer.stories_.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/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/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.tsx.html +92 -146
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +21 -21
- 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.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +1 -1
- package/coverage/lcov-report/src/contexts/MapContext.tsx.html +1 -1
- package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
- package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
- package/coverage/lcov-report/src/contexts/index.html +1 -1
- package/coverage/lcov-report/src/hooks/index.html +11 -11
- package/coverage/lcov-report/src/hooks/{exportMap → useExportMap}/index.html +3 -3
- package/coverage/lcov-report/src/hooks/{exportMap → useExportMap}/index.ts.html +4 -4
- package/coverage/lcov-report/src/hooks/{exportMap → useExportMap}/lib.ts.html +4 -4
- package/coverage/lcov-report/src/hooks/useLayer.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +9 -9
- package/coverage/lcov-report/src/hooks/useMap.ts.html +4 -4
- package/coverage/lcov-report/src/hooks/useMapState.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useSource.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +3 -3
- package/coverage/lcov.info +104 -82
- package/dist/components/MlCreatePdfForm/MlCreatePdfForm.d.ts +1 -1
- package/dist/components/MlCreatePdfForm/lib/PdfForm.d.ts +1 -1
- package/dist/components/MlVectorTileLayer/MlVectorTileLayer.d.ts +5 -24
- package/dist/hooks/useExportMap/index.d.ts +11 -0
- package/dist/hooks/useExportMap/lib.d.ts +36 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +994 -445
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx +1 -1
- package/src/components/MlCreatePdfForm/lib/PdfForm.tsx +3 -3
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.stories.js +15 -9
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.test.js +7 -6
- package/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx +59 -77
- package/src/hooks/{exportMap → useExportMap}/index.ts +1 -1
- package/src/hooks/{exportMap → useExportMap}/lib.ts +1 -1
- package/src/index.ts +2 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PdfPreview from './lib/PdfPreview';
|
|
3
3
|
import PdfForm from './lib/PdfForm';
|
|
4
4
|
import { PdfContextProvider } from './lib/PdfContext';
|
|
5
|
-
import { createPdfResolverParams } from '../../hooks/
|
|
5
|
+
import { createPdfResolverParams } from '../../hooks/useExportMap/lib';
|
|
6
6
|
import { SxProps } from '@mui/material';
|
|
7
7
|
|
|
8
8
|
interface MlCreatePdfFormProps {
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
} from '@mui/material';
|
|
14
14
|
|
|
15
15
|
import useMap from '../../../hooks/useMap';
|
|
16
|
-
import
|
|
17
|
-
import { createPdfResolverParams } from '../../../hooks/
|
|
16
|
+
import useExportMap from '../../../hooks/useExportMap';
|
|
17
|
+
import { createPdfResolverParams } from '../../../hooks/useExportMap/lib';
|
|
18
18
|
|
|
19
19
|
import * as turf from '@turf/turf';
|
|
20
20
|
|
|
@@ -49,7 +49,7 @@ export default function PdfForm(props:PdfFormProps) {
|
|
|
49
49
|
// eslint-disable-next-line react/prop-types
|
|
50
50
|
mapId: props.mapId,
|
|
51
51
|
});
|
|
52
|
-
const mapExporter =
|
|
52
|
+
const mapExporter = useExportMap({ mapId: props.mapId });
|
|
53
53
|
|
|
54
54
|
const createPdfHandler = useCallback(() => {
|
|
55
55
|
if (
|
|
@@ -28,16 +28,22 @@ ExampleConfig.args = {
|
|
|
28
28
|
mapId: "map_1",
|
|
29
29
|
url:
|
|
30
30
|
"https://wms.wheregroup.com/tileserver/tile/tileserver.php?/europe-0-14/index.json?/europe-0-14/{z}/{x}/{y}.pbf",
|
|
31
|
-
layers:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
paint: { "line-width": 2, "line-color": "#ff0000" },
|
|
31
|
+
layers: [
|
|
32
|
+
{
|
|
33
|
+
id: "water",
|
|
34
|
+
type: "fill",
|
|
35
|
+
"source-layer": "water",
|
|
36
|
+
layout: {},
|
|
37
|
+
paint: { "fill-color": "#0905f5", "fill-opacity": 0.5 },
|
|
39
38
|
},
|
|
40
|
-
|
|
39
|
+
{
|
|
40
|
+
id: "buildings",
|
|
41
|
+
type: "fill",
|
|
42
|
+
"source-layer": "building",
|
|
43
|
+
layout: {},
|
|
44
|
+
paint: { "fill-color": "#717875" },
|
|
45
|
+
},
|
|
46
|
+
],
|
|
41
47
|
sourceOptions: {
|
|
42
48
|
minzoom: 0,
|
|
43
49
|
maxzoom: 20,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { layerRemovalTest, sourceRemovalTest } from "../../util";
|
|
2
|
-
|
|
2
|
+
import React from 'react'
|
|
3
3
|
import MlVectorTileLayer from "./MlVectorTileLayer";
|
|
4
4
|
import { uuid_regex } from "../../setupTests";
|
|
5
5
|
|
|
@@ -7,8 +7,9 @@ const testComponent = (
|
|
|
7
7
|
<MlVectorTileLayer
|
|
8
8
|
{...{
|
|
9
9
|
url: "https://wms.wheregroup.com/tileserver/tile/tileserver.php?/europe-0-14/index.json?/europe-0-14/{z}/{x}/{y}.pbf",
|
|
10
|
-
layers:
|
|
11
|
-
|
|
10
|
+
layers: [
|
|
11
|
+
{
|
|
12
|
+
id: "landuseLine",
|
|
12
13
|
"source-layer": "landuse",
|
|
13
14
|
layout: {
|
|
14
15
|
"line-cap": "round",
|
|
@@ -16,7 +17,7 @@ const testComponent = (
|
|
|
16
17
|
},
|
|
17
18
|
paint: { "line-width": 1, "line-color": "#ff0000" },
|
|
18
19
|
},
|
|
19
|
-
|
|
20
|
+
],
|
|
20
21
|
sourceOptions: {
|
|
21
22
|
minzoom: 0,
|
|
22
23
|
maxzoom: 20,
|
|
@@ -28,8 +29,8 @@ const testComponent = (
|
|
|
28
29
|
layerRemovalTest(
|
|
29
30
|
"<MlVectorTileLayer />",
|
|
30
31
|
testComponent,
|
|
31
|
-
new RegExp('^.*"
|
|
32
|
-
|
|
32
|
+
new RegExp('^.*"landuseLine".*$'),
|
|
33
|
+
'landuseLine'
|
|
33
34
|
);
|
|
34
35
|
sourceRemovalTest(
|
|
35
36
|
"<MlVectorTileLayer />",
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useCallback } from "react";
|
|
2
|
-
import useMap from
|
|
3
|
-
import
|
|
2
|
+
import useMap from '../../hooks/useMap';
|
|
3
|
+
import { LayerSpecification } from 'maplibre-gl';
|
|
4
|
+
import { VectorSourceSpecification } from 'maplibre-gl';
|
|
4
5
|
|
|
5
6
|
interface MlVectorTileLayerProps {
|
|
6
7
|
mapId?: string;
|
|
7
8
|
insertBeforeLayer?: string;
|
|
8
9
|
layerId?: string;
|
|
9
|
-
sourceOptions?:
|
|
10
|
+
sourceOptions?: VectorSourceSpecification;
|
|
10
11
|
url?: string;
|
|
11
|
-
layers
|
|
12
|
+
layers: LayerSpecification[];
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -23,135 +24,116 @@ const MlVectorTileLayer = (props: MlVectorTileLayerProps) => {
|
|
|
23
24
|
waitForLayer: props.insertBeforeLayer,
|
|
24
25
|
});
|
|
25
26
|
|
|
26
|
-
const
|
|
27
|
-
const layerId = useRef(props.layerId || "MlVectorTileLayer-" + mapHook.componentId);
|
|
27
|
+
const layerId = useRef(props.layerId || 'MlVectorTileLayer-' + mapHook.componentId);
|
|
28
28
|
const layerPaintConfsRef = useRef({});
|
|
29
29
|
const layerLayoutConfsRef = useRef({});
|
|
30
30
|
const initializedRef = useRef(false);
|
|
31
31
|
|
|
32
|
-
const
|
|
32
|
+
const createLayers = useCallback(() => {
|
|
33
33
|
if (!mapHook.map) return;
|
|
34
34
|
|
|
35
35
|
initializedRef.current = true;
|
|
36
36
|
|
|
37
|
-
if (mapHook.map.map.
|
|
37
|
+
if (mapHook.map.map.getSource(layerId.current)) {
|
|
38
38
|
mapHook.cleanup();
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
// Add the new layer to the
|
|
41
|
+
// Add the new layer to the maplibre instance once it is available
|
|
42
42
|
mapHook.map.addSource(
|
|
43
43
|
layerId.current,
|
|
44
44
|
{
|
|
45
|
-
type:
|
|
45
|
+
type: 'vector',
|
|
46
46
|
tiles: [props.url],
|
|
47
47
|
tileSize: 512,
|
|
48
|
-
attribution:
|
|
48
|
+
attribution: '',
|
|
49
49
|
...props.sourceOptions,
|
|
50
50
|
},
|
|
51
51
|
mapHook.componentId
|
|
52
52
|
);
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
layerIdsRef.current[key] = _layerId;
|
|
57
|
-
|
|
54
|
+
props.layers.forEach((layer) => {
|
|
55
|
+
if (!mapHook.map) return;
|
|
58
56
|
mapHook.map.addLayer(
|
|
59
57
|
{
|
|
60
|
-
id: _layerId,
|
|
61
58
|
source: layerId.current,
|
|
62
|
-
type: "line",
|
|
63
59
|
minzoom: 0,
|
|
64
60
|
maxzoom: 22,
|
|
65
61
|
layout: {},
|
|
66
62
|
paint: {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
'line-opacity': 0.5,
|
|
64
|
+
'line-color': 'rgb(80, 80, 80)',
|
|
65
|
+
'line-width': 2,
|
|
70
66
|
},
|
|
71
|
-
...
|
|
67
|
+
...layer,
|
|
72
68
|
},
|
|
73
69
|
props.insertBeforeLayer,
|
|
74
70
|
mapHook.componentId
|
|
75
71
|
);
|
|
76
|
-
layerPaintConfsRef.current[
|
|
77
|
-
layerLayoutConfsRef.current[
|
|
72
|
+
layerPaintConfsRef.current[layer.id] = JSON.stringify(layer.paint);
|
|
73
|
+
layerLayoutConfsRef.current[layer.id] = JSON.stringify(layer.layout);
|
|
78
74
|
|
|
79
75
|
// recreate layer if style has changed
|
|
80
76
|
mapHook.map.on(
|
|
81
|
-
|
|
77
|
+
'styledata',
|
|
82
78
|
() => {
|
|
83
79
|
if (initializedRef.current && !mapHook.map?.map.getSource(layerId.current)) {
|
|
84
|
-
console.log(
|
|
85
|
-
|
|
80
|
+
console.log('Recreate Layer ' + layerId.current);
|
|
81
|
+
createLayers();
|
|
86
82
|
}
|
|
87
83
|
},
|
|
88
84
|
mapHook.componentId
|
|
89
85
|
);
|
|
90
|
-
}
|
|
86
|
+
});
|
|
91
87
|
}, [mapHook.map, props]);
|
|
92
88
|
|
|
93
|
-
|
|
94
|
-
if (initializedRef.current) return;
|
|
95
|
-
|
|
96
|
-
createLayer();
|
|
97
|
-
}, [createLayer]);
|
|
89
|
+
const updateLayers = useCallback(() => {
|
|
90
|
+
if (!initializedRef.current) return;
|
|
98
91
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
for (var key in props.layers) {
|
|
103
|
-
if (mapHook.map.map.getLayer(layerIdsRef.current[key])) {
|
|
92
|
+
props.layers.forEach((layer) => {
|
|
93
|
+
if (!mapHook.map) return;
|
|
94
|
+
if (mapHook.map.map.getLayer(layer.id)) {
|
|
104
95
|
// update changed paint property
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (layerPaintConfString !== layerPaintConfsRef.current[
|
|
108
|
-
for (
|
|
109
|
-
mapHook.map.map.setPaintProperty(
|
|
110
|
-
layerIdsRef.current[key],
|
|
111
|
-
paintKey,
|
|
112
|
-
props.layers[key].paint[paintKey]
|
|
113
|
-
);
|
|
96
|
+
const layerPaintConfString = JSON.stringify(layer.paint);
|
|
97
|
+
|
|
98
|
+
if (layerPaintConfString !== layerPaintConfsRef.current[layer.id]) {
|
|
99
|
+
for (const paintKey in layer.paint) {
|
|
100
|
+
mapHook.map.map.setPaintProperty(layer.id, paintKey, layer.paint[paintKey]);
|
|
114
101
|
}
|
|
115
102
|
}
|
|
116
|
-
layerPaintConfsRef.current[
|
|
103
|
+
layerPaintConfsRef.current[layer.id] = layerPaintConfString;
|
|
117
104
|
|
|
118
105
|
// update changed layout property
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (layerLayoutConfString !== layerLayoutConfsRef.current[
|
|
122
|
-
for (
|
|
123
|
-
mapHook.map.map.setLayoutProperty(
|
|
124
|
-
layerIdsRef.current[key],
|
|
125
|
-
layoutKey,
|
|
126
|
-
props.layers[key].layout[layoutKey]
|
|
127
|
-
);
|
|
106
|
+
const layerLayoutConfString = JSON.stringify(layer.layout);
|
|
107
|
+
|
|
108
|
+
if (layerLayoutConfString !== layerLayoutConfsRef.current[layer.id]) {
|
|
109
|
+
for (const layoutKey in layer.layout) {
|
|
110
|
+
mapHook.map.map.setLayoutProperty(layer.id, layoutKey, layer.layout[layoutKey]);
|
|
128
111
|
}
|
|
129
112
|
}
|
|
130
|
-
layerLayoutConfsRef.current[
|
|
113
|
+
layerLayoutConfsRef.current[layer.id] = layerLayoutConfString;
|
|
131
114
|
}
|
|
132
|
-
}
|
|
115
|
+
});
|
|
116
|
+
}, [mapHook.map, props.layers]);
|
|
117
|
+
|
|
118
|
+
// initial layer creation
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
if (initializedRef.current) return;
|
|
121
|
+
createLayers();
|
|
122
|
+
}, [createLayers]);
|
|
123
|
+
|
|
124
|
+
// if layers get removed or added
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
if (!mapHook.map || !initializedRef.current) return;
|
|
127
|
+
createLayers();
|
|
128
|
+
}, [props.layers.length, mapHook.map]);
|
|
129
|
+
|
|
130
|
+
// on layout/paint update
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!mapHook.map || !initializedRef.current) return;
|
|
133
|
+
updateLayers();
|
|
133
134
|
}, [props.layers, mapHook.map]);
|
|
134
135
|
|
|
135
136
|
return <></>;
|
|
136
137
|
};
|
|
137
138
|
|
|
138
|
-
MlVectorTileLayer.propTypes = {
|
|
139
|
-
/**
|
|
140
|
-
* Id of the target MapLibre instance in mapContext
|
|
141
|
-
*/
|
|
142
|
-
mapId: PropTypes.string,
|
|
143
|
-
/**
|
|
144
|
-
* Options object that will be used as first parameter on the MapLibreGl.addSource call see MapLibre source options documentation.
|
|
145
|
-
*/
|
|
146
|
-
sourceOptions: PropTypes.object,
|
|
147
|
-
/**
|
|
148
|
-
* Object that hold layers
|
|
149
|
-
*/
|
|
150
|
-
layers: PropTypes.object,
|
|
151
|
-
/**
|
|
152
|
-
* String of the URL of a wms layer
|
|
153
|
-
*/
|
|
154
|
-
url: PropTypes.string,
|
|
155
|
-
};
|
|
156
|
-
|
|
157
139
|
export default MlVectorTileLayer;
|
|
@@ -10,7 +10,7 @@ interface exportMapProps {
|
|
|
10
10
|
mapId?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export default function
|
|
13
|
+
export default function useExportMap(props: exportMapProps) {
|
|
14
14
|
const mapHook = useMap({ mapId: props.mapId });
|
|
15
15
|
|
|
16
16
|
const _createExport = useMemo(() => {
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as MapLibreMap } from "./components/MapLibreMap/MapLibreMap";
|
|
2
2
|
export { default as MlComponentTemplate } from "./components/MlComponentTemplate/MlComponentTemplate";
|
|
3
3
|
export { default as MlCreatePdfButton } from "./components/MlCreatePdfButton/MlCreatePdfButton";
|
|
4
|
-
export { default as MlCreatePdfForm } from "./components/
|
|
4
|
+
export { default as MlCreatePdfForm } from "./components/MlCreatePdfForm/MlCreatePdfForm";
|
|
5
5
|
export { default as MlFeatureEditor } from "./components/MlFeatureEditor/MlFeatureEditor";
|
|
6
6
|
export { default as MlFillExtrusionLayer } from "./components/MlFillExtrusionLayer/MlFillExtrusionLayer";
|
|
7
7
|
export { default as MlFollowGps } from "./components/MlFollowGps/MlFollowGps";
|
|
@@ -35,7 +35,7 @@ export { default as useMapState } from "./hooks/useMapState";
|
|
|
35
35
|
export { default as useMap } from "./hooks/useMap";
|
|
36
36
|
export { default as useWms } from "./hooks/useWms.js";
|
|
37
37
|
export { default as useSource } from "./hooks/useSource";
|
|
38
|
-
export { default as useExportMap } from "./hooks/
|
|
38
|
+
export { default as useExportMap } from "./hooks/useExportMap";
|
|
39
39
|
|
|
40
40
|
export { MapComponentsProvider } from "./contexts/MapContext";
|
|
41
41
|
export { default as MapContext } from "./contexts/MapContext";
|