@mapcomponents/react-maplibre 0.1.55 → 0.1.56

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 (88) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/coverage/clover.xml +86 -80
  3. package/coverage/coverage-final.json +2 -2
  4. package/coverage/lcov-report/index.html +16 -16
  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 +1 -1
  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 +1 -1
  46. package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
  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 +1 -1
  76. package/coverage/lcov.info +170 -159
  77. package/dist/components/MlFollowGps/MlFollowGps.d.ts +26 -6
  78. package/dist/components/MlNavigationTools/MlNavigationTools.d.ts +9 -0
  79. package/dist/components/MlNavigationTools/MlNavigationTools.stories.d.ts +1 -0
  80. package/dist/index.esm.js +118 -46
  81. package/dist/index.esm.js.map +1 -1
  82. package/package.json +1 -1
  83. package/src/components/MlFollowGps/MlFollowGps.stories.js +4 -2
  84. package/src/components/MlFollowGps/MlFollowGps.tsx +53 -24
  85. package/src/components/MlNavigationTools/MlNavigationTools.stories.js +6 -0
  86. package/src/components/MlNavigationTools/MlNavigationTools.tsx +19 -9
  87. package/src/decorators/MapContextDecorator.js +5 -4
  88. package/src/decorators/MultiMapContextDecorator.js +54 -55
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapcomponents/react-maplibre",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.esm.js",
@@ -13,8 +13,10 @@ const storyoptions = {
13
13
  };
14
14
  export default storyoptions;
15
15
 
16
- const Template = (args) => <MlFollowGps />;
16
+ const Template = (props) => <MlFollowGps {...props}/>;
17
17
 
18
18
  export const ExampleConfig = Template.bind({});
19
19
  ExampleConfig.parameters = {};
20
- ExampleConfig.args = {};
20
+ ExampleConfig.args = {
21
+ followUserPosition: false
22
+ };
@@ -1,11 +1,12 @@
1
- import React, { useEffect, useState, useCallback, useMemo } from "react";
1
+ import React, { useRef, useEffect, useState, useCallback, useMemo } from "react";
2
2
  import useMap from "../../hooks/useMap";
3
3
  import MlGeoJsonLayer from "../MlGeoJsonLayer/MlGeoJsonLayer";
4
4
 
5
- import { Button } from "@mui/material";
6
- import GpsFixedIcon from "@mui/icons-material/GpsFixed";
5
+ import { Button, SxProps } from "@mui/material";
6
+ import GpsFixedIcon from "@mui/icons-material/GpsFixed";
7
7
 
8
8
  import { point, circle, lineArc, Feature, Point } from "@turf/turf";
9
+ import { CircleLayerSpecification, FillLayerSpecification } from "maplibre-gl";
9
10
 
10
11
  interface MlFollowGpsProps {
11
12
  /**
@@ -30,13 +31,29 @@ interface MlFollowGpsProps {
30
31
  * By default, if showUserLocation is true, a transparent circle will be drawn around the user location
31
32
  * indicating the accuracy (95% confidence level) of the user's location. Set to false to disable.
32
33
  */
33
- showAccuracyCircle?: boolean,
34
+ showAccuracyCircle?: boolean;
34
35
  /**
35
- * position circle paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy circle.
36
+ * Use the MapLibre.flyTo function to center the map to the current users position if true.
37
+ * Otherwise the MapLibre.setCenter function is used.
38
+ */
39
+ useFlyTo?: boolean;
40
+ /**
41
+ * Center map to current position once updated location data is recieved.
42
+ * "false" will center the map once on component activation and then display the updated user location on the map.
43
+ */
44
+ centerUserPosition?: boolean;
45
+ /**
46
+ * Orientation cone paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the orientation cone polygon.
36
47
  * Use any available paint prop from layer type "fill".
37
48
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
38
49
  */
39
- circlePaint?: any;
50
+ orientationConePaint?: FillLayerSpecification["paint"];
51
+ /**
52
+ * Position circle paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the position circle.
53
+ * Use any available paint prop from layer type "circle".
54
+ * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
55
+ */
56
+ circlePaint?: CircleLayerSpecification["paint"];
40
57
  /**
41
58
  * Active button font color
42
59
  */
@@ -46,15 +63,15 @@ interface MlFollowGpsProps {
46
63
  */
47
64
  offColor?: string;
48
65
  /**
49
- * Accuracy paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy circle.
66
+ * Accuracy paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy polygon.
50
67
  * Use any available paint prop from layer type "fill".
51
68
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
52
69
  */
53
- accuracyPaint?: any;
70
+ accuracyPaint?: FillLayerSpecification["paint"];
54
71
  /**
55
72
  * CSS style object that is applied to the button component
56
73
  */
57
- style?: any;
74
+ buttonSx?: SxProps | any;
58
75
  }
59
76
 
60
77
  /**
@@ -69,22 +86,30 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
69
86
  });
70
87
 
71
88
  const [isFollowed, setIsFollowed] = useState(false);
72
- const [userLocationGeoJson, setUserLocationGeoJson] =
73
- useState<Feature<Point>>();
89
+ const [userLocationGeoJson, setUserLocationGeoJson] = useState<Feature<Point>>();
74
90
  const [locationAccessDenied, setLocationAccessDenied] = useState(false);
75
91
  const [accuracyGeoJson, setAccuracyGeoJson] = useState<Feature>();
76
92
  const [deviceOrientation, setDeviceOrientation] = useState(0);
93
+ const initiallyCentered = useRef(false);
77
94
 
78
95
  const getLocationSuccess = useCallback(
79
96
  (pos) => {
80
97
  if (!mapHook.map) return;
81
98
 
82
- mapHook.map.map.flyTo({
83
- center: [pos.coords.longitude, pos.coords.latitude],
84
- zoom: 18,
85
- speed: 1,
86
- curve: 1,
87
- });
99
+ if ((!props.centerUserPosition && !initiallyCentered.current) || props.centerUserPosition) {
100
+ if (props.useFlyTo) {
101
+ mapHook.map.map.flyTo({
102
+ center: [pos.coords.longitude, pos.coords.latitude],
103
+ zoom: 18,
104
+ speed: 1,
105
+ curve: 1,
106
+ });
107
+ } else {
108
+ mapHook.map.map.setCenter([pos.coords.longitude, pos.coords.latitude]);
109
+ }
110
+
111
+ initiallyCentered.current = true;
112
+ }
88
113
  if (!props.showUserLocation) return;
89
114
  const geoJsonPoint = point([pos.coords.longitude, pos.coords.latitude]);
90
115
  setUserLocationGeoJson(geoJsonPoint);
@@ -124,6 +149,8 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
124
149
  return () => {
125
150
  window.removeEventListener("deviceorientation", _handleOrientation);
126
151
  };
152
+ } else {
153
+ initiallyCentered.current = false;
127
154
  }
128
155
  return;
129
156
  }, [isFollowed]);
@@ -132,10 +159,7 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
132
159
  if (!mapHook.map) return;
133
160
 
134
161
  if (isFollowed) {
135
- let _watchId = navigator.geolocation.watchPosition(
136
- getLocationSuccess,
137
- getLocationError
138
- );
162
+ let _watchId = navigator.geolocation.watchPosition(getLocationSuccess, getLocationError);
139
163
 
140
164
  return () => {
141
165
  navigator.geolocation.clearWatch(_watchId);
@@ -167,6 +191,7 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
167
191
  "fill-color": "#0000ff",
168
192
  "fill-antialias": false,
169
193
  "fill-opacity": 0.3,
194
+ ...props.orientationConePaint,
170
195
  }}
171
196
  insertBeforeLayer={props.insertBeforeLayer}
172
197
  />
@@ -191,7 +216,7 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
191
216
  sx={{
192
217
  zIndex: 1002,
193
218
  color: isFollowed ? props.onColor : props.offColor,
194
- ...props.style,
219
+ ...props.buttonSx,
195
220
  }}
196
221
  disabled={locationAccessDenied}
197
222
  onClick={() => {
@@ -199,7 +224,9 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
199
224
  }}
200
225
  >
201
226
  {" "}
202
- <GpsFixedIcon sx={{ ...(props.style?.fontSize?{fontSize: props.style?.fontSize}:{}) }} />{" "}
227
+ <GpsFixedIcon
228
+ sx={{ ...(props.buttonSx?.fontSize ? { fontSize: props.buttonSx?.fontSize } : {}) }}
229
+ />{" "}
203
230
  </Button>
204
231
  </>
205
232
  );
@@ -207,7 +234,7 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
207
234
 
208
235
  MlFollowGps.defaultProps = {
209
236
  mapId: undefined,
210
- style: {
237
+ buttonSx: {
211
238
  minWidth: "30px",
212
239
  minHeight: "30px",
213
240
  width: "30px",
@@ -226,6 +253,8 @@ MlFollowGps.defaultProps = {
226
253
  showAccuracyCircle: true,
227
254
  showUserLocation: true,
228
255
  showOrientation: true,
256
+ centerUserPosition: true,
257
+ useFlyTo: false,
229
258
  };
230
259
 
231
260
  export default MlFollowGps;
@@ -36,6 +36,12 @@ ShowCenterLocationButton.args = {
36
36
  showCenterLocationButton: true,
37
37
  };
38
38
 
39
+ export const AlterToolPosition = Template.bind({});
40
+ AlterToolPosition.parameters = {};
41
+ AlterToolPosition.args = {
42
+ sx: { top: "10px", right: "5px" },
43
+ };
44
+
39
45
  export const NoZoomButtons = Template.bind({});
40
46
  NoZoomButtons.parameters = {};
41
47
  NoZoomButtons.args = {
@@ -3,6 +3,8 @@ import Button from "@mui/material/Button";
3
3
  import ButtonGroup from "@mui/material/ButtonGroup";
4
4
  import ControlPointIcon from "@mui/icons-material/ControlPoint";
5
5
  import RemoveCircleOutlineIcon from "@mui/icons-material/RemoveCircleOutline";
6
+ import Box from "@mui/material/Box";
7
+ import { SxProps } from "@mui/material";
6
8
 
7
9
  import MlNavigationCompass from "../MlNavigationCompass/MlNavigationCompass";
8
10
  import MlFollowGps from "../MlFollowGps/MlFollowGps";
@@ -40,6 +42,10 @@ interface MlNavigationToolsProps {
40
42
  * Additional JSX Elements to be rendered below MlNavigationTools buttons
41
43
  */
42
44
  children?: JSX.Element;
45
+ /**
46
+ * Style attribute for NavigationTools container
47
+ */
48
+ sx?: SxProps;
43
49
  }
44
50
 
45
51
  /**
@@ -71,7 +77,7 @@ const MlNavigationTools = (props: MlNavigationToolsProps) => {
71
77
  };
72
78
  const iconStyle = {
73
79
  fontSize: buttonStyle.fontSize,
74
- }
80
+ };
75
81
 
76
82
  useEffect(() => {
77
83
  if (!mapHook.map) return;
@@ -115,14 +121,14 @@ const MlNavigationTools = (props: MlNavigationToolsProps) => {
115
121
  };
116
122
 
117
123
  return (
118
- <div
119
- style={{
124
+ <Box
125
+ sx={{
120
126
  zIndex: 501,
121
127
  position: "absolute",
122
- right: mediaIsMobile ? "15px" : "5px",
123
- bottom: mediaIsMobile ? "40px" : "20px",
124
128
  display: "flex",
125
129
  flexDirection: "column",
130
+ ...(mediaIsMobile ? { margin: "20px 10px 20px 10px" } : {}),
131
+ ...props.sx,
126
132
  }}
127
133
  >
128
134
  <MlNavigationCompass
@@ -146,7 +152,7 @@ const MlNavigationTools = (props: MlNavigationToolsProps) => {
146
152
  </Button>
147
153
  )}
148
154
  {props.showFollowGpsButton && (
149
- <MlFollowGps style={{ ...(({ color, ...rest }) => rest)(buttonStyle) }} />
155
+ <MlFollowGps buttonSx={{ ...(({ color, ...rest }) => rest)(buttonStyle) }} />
150
156
  )}
151
157
  {props.showCenterLocationButton && (
152
158
  <MlCenterPosition style={{ ...(({ color, ...rest }) => rest)(buttonStyle) }} />
@@ -163,10 +169,10 @@ const MlNavigationTools = (props: MlNavigationToolsProps) => {
163
169
  {props.showZoomButtons && (
164
170
  <>
165
171
  <Button sx={{ ...buttonStyle }} onClick={zoomIn}>
166
- <ControlPointIcon sx={{...iconStyle}} />
172
+ <ControlPointIcon sx={{ ...iconStyle }} />
167
173
  </Button>
168
174
  <Button sx={{ ...buttonStyle }} onClick={zoomOut}>
169
- <RemoveCircleOutlineIcon sx={{...iconStyle}} />
175
+ <RemoveCircleOutlineIcon sx={{ ...iconStyle }} />
170
176
  </Button>
171
177
  </>
172
178
  )}
@@ -175,7 +181,7 @@ const MlNavigationTools = (props: MlNavigationToolsProps) => {
175
181
  React.cloneElement(props.children, {
176
182
  sx: { ...buttonStyle },
177
183
  })}
178
- </div>
184
+ </Box>
179
185
  );
180
186
  };
181
187
 
@@ -185,6 +191,10 @@ MlNavigationTools.defaultProps = {
185
191
  showFollowGpsButton: true,
186
192
  showCenterLocationButton: false,
187
193
  showZoomButtons: true,
194
+ sx: {
195
+ right: "5px",
196
+ bottom: "20px",
197
+ },
188
198
  };
189
199
 
190
200
  export default MlNavigationTools;
@@ -22,10 +22,11 @@ const decorators = [
22
22
  }}
23
23
  mapId="map_1"
24
24
  />
25
- <MlNavgiationTools
26
- mapId="map_1">
27
-
28
- </MlNavgiationTools>
25
+ <MlNavgiationTools
26
+ sx={{ top: "10px", right: "5px" }}
27
+ showZoomButtons={false}
28
+ mapId="map_1"
29
+ />
29
30
  </MapComponentsProvider>
30
31
  </ThemeProvider>
31
32
  </div>
@@ -4,74 +4,73 @@ import { MapComponentsProvider } from "../index";
4
4
 
5
5
  import MapLibreMap from "../components/MapLibreMap/MapLibreMap";
6
6
 
7
-
8
7
  import "./style.css";
9
8
  import { createTheme, ThemeProvider } from "@mui/material/styles";
10
9
  import MlNavgiationTools from "../components/MlNavigationTools/MlNavigationTools";
11
10
 
12
11
  const theme = createTheme({});
13
12
 
14
-
15
13
  const decorators = [
16
14
  (Story) => (
17
15
  <div className="fullscreen_map">
18
16
  <ThemeProvider theme={theme}>
19
17
  <MapComponentsProvider>
20
- <div
21
- style={{
22
- overflow: "hidden",
23
- position: "absolute",
24
- top: "0",
25
- bottom: "0",
26
- left: "0",
27
- right: "0",
28
- }}
29
- >
30
- <Story />
31
- <div className="maps">
32
- <MapLibreMap
33
- mapId="map_1"
34
- options={{
35
- //style: "mapbox://styles/mapbox/light-v10",
36
- //center: [-87.62712, 41.89033],
37
- zoom: 14.5,
38
- //pitch: 45,
39
- //style: "https://wms.wheregroup.com/tileserver/style/osm-bright.json",
40
- style: "https://wms.wheregroup.com/tileserver/style/osm-liberty.json",
41
- //center: [8.607, 53.1409349],
42
- //zoom: 13,
43
- center: [7.0851268, 50.73884],
44
- //maxBounds: [
45
- // [1.40625, 43.452919],
46
- // [17.797852, 55.973798],
47
- //],
48
- }}
49
- />
50
- <MapLibreMap
51
- mapId="map_2"
52
- options={{
53
- //style: "mapbox://styles/mapbox/light-v10",
54
- //center: [-87.62712, 41.89033],
55
- zoom: 14.5,
56
- //pitch: 45,
57
- style: "https://wms.wheregroup.com/tileserver/style/osm-bright.json",
58
- //style: "https://wms.wheregroup.com/tileserver/style/osm-liberty.json",
59
- //center: [8.607, 53.1409349],
60
- //zoom: 13,
61
- center: [7.0851268, 50.73884],
62
- //maxBounds: [
63
- // [1.40625, 43.452919],
64
- // [17.797852, 55.973798],
65
- //],
66
- }}
67
- />
68
-
69
- <MlNavgiationTools
70
- mapId="map_1">
18
+ <div
19
+ style={{
20
+ overflow: "hidden",
21
+ position: "absolute",
22
+ top: "0",
23
+ bottom: "0",
24
+ left: "0",
25
+ right: "0",
26
+ }}
27
+ >
28
+ <Story />
29
+ <div className="maps">
30
+ <MapLibreMap
31
+ mapId="map_1"
32
+ options={{
33
+ //style: "mapbox://styles/mapbox/light-v10",
34
+ //center: [-87.62712, 41.89033],
35
+ zoom: 14.5,
36
+ //pitch: 45,
37
+ //style: "https://wms.wheregroup.com/tileserver/style/osm-bright.json",
38
+ style: "https://wms.wheregroup.com/tileserver/style/osm-liberty.json",
39
+ //center: [8.607, 53.1409349],
40
+ //zoom: 13,
41
+ center: [7.0851268, 50.73884],
42
+ //maxBounds: [
43
+ // [1.40625, 43.452919],
44
+ // [17.797852, 55.973798],
45
+ //],
46
+ }}
47
+ />
48
+ <MapLibreMap
49
+ mapId="map_2"
50
+ options={{
51
+ //style: "mapbox://styles/mapbox/light-v10",
52
+ //center: [-87.62712, 41.89033],
53
+ zoom: 14.5,
54
+ //pitch: 45,
55
+ style: "https://wms.wheregroup.com/tileserver/style/osm-bright.json",
56
+ //style: "https://wms.wheregroup.com/tileserver/style/osm-liberty.json",
57
+ //center: [8.607, 53.1409349],
58
+ //zoom: 13,
59
+ center: [7.0851268, 50.73884],
60
+ //maxBounds: [
61
+ // [1.40625, 43.452919],
62
+ // [17.797852, 55.973798],
63
+ //],
64
+ }}
65
+ />
71
66
 
72
- </MlNavgiationTools>
73
- </div>
67
+ <MlNavgiationTools
68
+ sx={{ top: "10px", right: "5px" }}
69
+ showZoomButtons={false}
70
+ mapId="map_1"
71
+ />
74
72
  </div>
73
+ </div>
75
74
  </MapComponentsProvider>
76
75
  </ThemeProvider>
77
76
  </div>