@mapcomponents/react-maplibre 0.1.54 → 0.1.57
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 +31 -1
- package/coverage/clover.xml +89 -83
- package/coverage/coverage-final.json +3 -3
- package/coverage/lcov-report/index.html +22 -22
- 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/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 +123 -36
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +15 -15
- 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/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 +2 -2
- 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 +42 -12
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +3 -3
- 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 +7 -7
- package/coverage/lcov-report/src/components/MlScaleReference/index.html +11 -11
- 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 +1 -1
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/src/hooks/useLayer.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useMap.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useMapState.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 +5 -2
- package/coverage/lcov.info +172 -161
- package/dist/components/MlFollowGps/MlFollowGps.d.ts +26 -6
- package/dist/components/MlLayer/MlLayer.d.ts +1 -1
- package/dist/components/MlNavigationTools/MlNavigationTools.d.ts +9 -0
- package/dist/components/MlNavigationTools/MlNavigationTools.stories.d.ts +1 -0
- package/dist/decorators/ThemeWrapper.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +348 -173
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/MlFollowGps/MlFollowGps.stories.js +4 -2
- package/src/components/MlFollowGps/MlFollowGps.tsx +53 -24
- package/src/components/MlLayer/MlLayer.tsx +1 -1
- package/src/components/MlNavigationTools/MlNavigationTools.stories.js +6 -0
- package/src/components/MlNavigationTools/MlNavigationTools.tsx +19 -9
- package/src/components/MlScaleReference/MlScaleReference.stories.js +22 -24
- package/src/decorators/MapContextDecorator.js +9 -10
- package/src/decorators/MultiMapContextDecorator.js +54 -55
- package/src/decorators/ThemeWrapper.jsx +9 -0
- package/src/index.ts +1 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { SxProps } from "@mui/material";
|
|
2
|
+
import { CircleLayerSpecification, FillLayerSpecification } from "maplibre-gl";
|
|
1
3
|
interface MlFollowGpsProps {
|
|
2
4
|
/**
|
|
3
5
|
* Id of the target MapLibre instance in mapContext
|
|
@@ -23,11 +25,27 @@ interface MlFollowGpsProps {
|
|
|
23
25
|
*/
|
|
24
26
|
showAccuracyCircle?: boolean;
|
|
25
27
|
/**
|
|
26
|
-
*
|
|
28
|
+
* Use the MapLibre.flyTo function to center the map to the current users position if true.
|
|
29
|
+
* Otherwise the MapLibre.setCenter function is used.
|
|
30
|
+
*/
|
|
31
|
+
useFlyTo?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Center map to current position once updated location data is recieved.
|
|
34
|
+
* "false" will center the map once on component activation and then display the updated user location on the map.
|
|
35
|
+
*/
|
|
36
|
+
centerUserPosition?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Orientation cone paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the orientation cone polygon.
|
|
27
39
|
* Use any available paint prop from layer type "fill".
|
|
28
40
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
29
41
|
*/
|
|
30
|
-
|
|
42
|
+
orientationConePaint?: FillLayerSpecification["paint"];
|
|
43
|
+
/**
|
|
44
|
+
* Position circle paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the position circle.
|
|
45
|
+
* Use any available paint prop from layer type "circle".
|
|
46
|
+
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
|
|
47
|
+
*/
|
|
48
|
+
circlePaint?: CircleLayerSpecification["paint"];
|
|
31
49
|
/**
|
|
32
50
|
* Active button font color
|
|
33
51
|
*/
|
|
@@ -37,15 +55,15 @@ interface MlFollowGpsProps {
|
|
|
37
55
|
*/
|
|
38
56
|
offColor?: string;
|
|
39
57
|
/**
|
|
40
|
-
* Accuracy paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy
|
|
58
|
+
* Accuracy paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy polygon.
|
|
41
59
|
* Use any available paint prop from layer type "fill".
|
|
42
60
|
* https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
|
|
43
61
|
*/
|
|
44
|
-
accuracyPaint?:
|
|
62
|
+
accuracyPaint?: FillLayerSpecification["paint"];
|
|
45
63
|
/**
|
|
46
64
|
* CSS style object that is applied to the button component
|
|
47
65
|
*/
|
|
48
|
-
|
|
66
|
+
buttonSx?: SxProps | any;
|
|
49
67
|
}
|
|
50
68
|
/**
|
|
51
69
|
* Adds a button that makes the map follow the users GPS position using
|
|
@@ -56,7 +74,7 @@ declare const MlFollowGps: {
|
|
|
56
74
|
(props: MlFollowGpsProps): JSX.Element;
|
|
57
75
|
defaultProps: {
|
|
58
76
|
mapId: undefined;
|
|
59
|
-
|
|
77
|
+
buttonSx: {
|
|
60
78
|
minWidth: string;
|
|
61
79
|
minHeight: string;
|
|
62
80
|
width: string;
|
|
@@ -75,6 +93,8 @@ declare const MlFollowGps: {
|
|
|
75
93
|
showAccuracyCircle: boolean;
|
|
76
94
|
showUserLocation: boolean;
|
|
77
95
|
showOrientation: boolean;
|
|
96
|
+
centerUserPosition: boolean;
|
|
97
|
+
useFlyTo: boolean;
|
|
78
98
|
};
|
|
79
99
|
};
|
|
80
100
|
export default MlFollowGps;
|
|
@@ -20,7 +20,7 @@ interface MlLayerProps {
|
|
|
20
20
|
/**
|
|
21
21
|
* GeoJSON data that is supposed to be rendered by this component.
|
|
22
22
|
*/
|
|
23
|
-
geojson
|
|
23
|
+
geojson?: Feature | FeatureCollection | undefined;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Basic layer component that create a layer in a MapLibre-gl instance and keeps it updated according to it attribute configuration.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SxProps } from "@mui/material";
|
|
1
2
|
interface MlNavigationToolsProps {
|
|
2
3
|
/**
|
|
3
4
|
* Id of the target MapLibre instance in mapContext
|
|
@@ -28,6 +29,10 @@ interface MlNavigationToolsProps {
|
|
|
28
29
|
* Additional JSX Elements to be rendered below MlNavigationTools buttons
|
|
29
30
|
*/
|
|
30
31
|
children?: JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Style attribute for NavigationTools container
|
|
34
|
+
*/
|
|
35
|
+
sx?: SxProps;
|
|
31
36
|
}
|
|
32
37
|
/**
|
|
33
38
|
* @component
|
|
@@ -40,6 +45,10 @@ declare const MlNavigationTools: {
|
|
|
40
45
|
showFollowGpsButton: boolean;
|
|
41
46
|
showCenterLocationButton: boolean;
|
|
42
47
|
showZoomButtons: boolean;
|
|
48
|
+
sx: {
|
|
49
|
+
right: string;
|
|
50
|
+
bottom: string;
|
|
51
|
+
};
|
|
43
52
|
};
|
|
44
53
|
};
|
|
45
54
|
export default MlNavigationTools;
|
|
@@ -2,6 +2,7 @@ export default storyoptions;
|
|
|
2
2
|
export const DefaultConfig: any;
|
|
3
3
|
export const No3DButton: any;
|
|
4
4
|
export const ShowCenterLocationButton: any;
|
|
5
|
+
export const AlterToolPosition: any;
|
|
5
6
|
export const NoZoomButtons: any;
|
|
6
7
|
export const NoFollowGpsButton: any;
|
|
7
8
|
export const CustomButton: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ThemeWrapper(props: any): JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { default as MlNavigationCompass } from "./components/MlNavigationCompass
|
|
|
12
12
|
export { default as MlLayer } from "./components/MlLayer/MlLayer";
|
|
13
13
|
export { default as MlVectorTileLayer } from "./components/MlVectorTileLayer/MlVectorTileLayer";
|
|
14
14
|
export { default as MlWmsLayer } from "./components/MlWmsLayer/MlWmsLayer";
|
|
15
|
+
export { default as MlScaleReference } from "./components/MlScaleReference/MlScaleReference";
|
|
15
16
|
export { default as MlLayerMagnify } from "./components/MlLayerMagnify/MlLayerMagnify";
|
|
16
17
|
export { default as MlLayerSwipe } from "./components/MlLayerSwipe/MlLayerSwipe";
|
|
17
18
|
export { default as MlTransitionGeoJsonLayer } from "./components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer";
|