@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.
Files changed (95) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/coverage/clover.xml +89 -83
  3. package/coverage/coverage-final.json +3 -3
  4. package/coverage/lcov-report/index.html +22 -22
  5. package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +1 -1
  6. package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
  7. package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +1 -1
  8. package/coverage/lcov-report/src/components/MlCenterPosition/index.html +1 -1
  9. package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
  10. package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
  11. package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +1 -1
  12. package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
  13. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
  14. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
  15. package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +123 -36
  16. package/coverage/lcov-report/src/components/MlFollowGps/index.html +15 -15
  17. package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.tsx.html +1 -1
  18. package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
  19. package/coverage/lcov-report/src/components/MlGPXViewer/index.html +1 -1
  20. package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +1 -1
  21. package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
  22. package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
  23. package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
  24. package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +2 -2
  25. package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
  26. package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +1 -1
  27. package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
  28. package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +1 -1
  29. package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
  30. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
  31. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
  32. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
  33. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
  34. package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
  35. package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
  36. package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
  37. package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
  38. package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
  39. package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
  40. package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +42 -12
  41. package/coverage/lcov-report/src/components/MlNavigationTools/index.html +3 -3
  42. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
  43. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +1 -1
  44. package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
  45. package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +7 -7
  46. package/coverage/lcov-report/src/components/MlScaleReference/index.html +11 -11
  47. package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
  48. package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
  49. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +1 -1
  50. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
  51. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
  52. package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
  53. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +1 -1
  54. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
  55. package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
  56. package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
  57. package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +1 -1
  58. package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +1 -1
  59. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
  60. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
  61. package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +1 -1
  62. package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
  63. package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +1 -1
  64. package/coverage/lcov-report/src/components/MlWmsLoader/index.html +1 -1
  65. package/coverage/lcov-report/src/contexts/MapContext.tsx.html +1 -1
  66. package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
  67. package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
  68. package/coverage/lcov-report/src/contexts/index.html +1 -1
  69. package/coverage/lcov-report/src/hooks/index.html +1 -1
  70. package/coverage/lcov-report/src/hooks/useLayer.ts.html +1 -1
  71. package/coverage/lcov-report/src/hooks/useMap.ts.html +1 -1
  72. package/coverage/lcov-report/src/hooks/useMapState.ts.html +1 -1
  73. package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
  74. package/coverage/lcov-report/src/index.html +1 -1
  75. package/coverage/lcov-report/src/index.ts.html +5 -2
  76. package/coverage/lcov.info +172 -161
  77. package/dist/components/MlFollowGps/MlFollowGps.d.ts +26 -6
  78. package/dist/components/MlLayer/MlLayer.d.ts +1 -1
  79. package/dist/components/MlNavigationTools/MlNavigationTools.d.ts +9 -0
  80. package/dist/components/MlNavigationTools/MlNavigationTools.stories.d.ts +1 -0
  81. package/dist/decorators/ThemeWrapper.d.ts +1 -0
  82. package/dist/index.d.ts +1 -0
  83. package/dist/index.esm.js +348 -173
  84. package/dist/index.esm.js.map +1 -1
  85. package/package.json +1 -1
  86. package/src/components/MlFollowGps/MlFollowGps.stories.js +4 -2
  87. package/src/components/MlFollowGps/MlFollowGps.tsx +53 -24
  88. package/src/components/MlLayer/MlLayer.tsx +1 -1
  89. package/src/components/MlNavigationTools/MlNavigationTools.stories.js +6 -0
  90. package/src/components/MlNavigationTools/MlNavigationTools.tsx +19 -9
  91. package/src/components/MlScaleReference/MlScaleReference.stories.js +22 -24
  92. package/src/decorators/MapContextDecorator.js +9 -10
  93. package/src/decorators/MultiMapContextDecorator.js +54 -55
  94. package/src/decorators/ThemeWrapper.jsx +9 -0
  95. 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
- * position circle paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy circle.
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
- circlePaint?: any;
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 circle.
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?: any;
62
+ accuracyPaint?: FillLayerSpecification["paint"];
45
63
  /**
46
64
  * CSS style object that is applied to the button component
47
65
  */
48
- style?: any;
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
- style: {
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: Feature | FeatureCollection | undefined;
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";