@mapcomponents/react-maplibre 0.1.67 → 0.1.68

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 (258) hide show
  1. package/coverage/clover.xml +172 -174
  2. package/coverage/coverage-final.json +7 -7
  3. package/coverage/lcov-report/index.html +38 -38
  4. package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +43 -25
  5. package/coverage/lcov-report/src/components/MapLibreMap/index.html +10 -10
  6. package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +30 -51
  7. package/coverage/lcov-report/src/components/MlCenterPosition/index.html +3 -3
  8. package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
  9. package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
  10. package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx.html +1 -1
  11. package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx.html +1 -1
  12. package/coverage/lcov-report/src/components/MlCreatePdfForm/index.html +1 -1
  13. package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +1 -1
  14. package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
  15. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
  16. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
  17. package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +41 -98
  18. package/coverage/lcov-report/src/components/MlFollowGps/index.html +15 -15
  19. package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +2 -2
  20. package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
  21. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js.html +1 -1
  22. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js.html +1 -1
  23. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx.html +1 -1
  24. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx.html +1 -1
  25. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/index.html +1 -1
  26. package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.tsx.html +1 -1
  27. package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/index.html +1 -1
  28. package/coverage/lcov-report/src/components/MlGpxViewer/MlGpxViewer.tsx.html +1 -1
  29. package/coverage/lcov-report/src/components/MlGpxViewer/index.html +1 -1
  30. package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
  31. package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
  32. package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
  33. package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
  34. package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +1 -1
  35. package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
  36. package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +1 -1
  37. package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
  38. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
  39. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
  40. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
  41. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
  42. package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
  43. package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
  44. package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
  45. package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
  46. package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
  47. package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
  48. package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +41 -113
  49. package/coverage/lcov-report/src/components/MlNavigationTools/index.html +15 -15
  50. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
  51. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +1 -1
  52. package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
  53. package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.tsx.html +1 -1
  54. package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
  55. package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.tsx.html +1 -1
  56. package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
  57. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/ColorPicker.tsx.html +1 -1
  58. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerList.tsx.html +1 -1
  59. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerListItem.tsx.html +1 -1
  60. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx.html +2 -2
  61. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/index.html +1 -1
  62. package/coverage/lcov-report/src/components/MlSketchTool/MlSketchTool.tsx.html +2 -2
  63. package/coverage/lcov-report/src/components/MlSketchTool/index.html +1 -1
  64. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx.html +1 -1
  65. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
  66. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
  67. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreejsLayer.tsx.html +1 -1
  68. package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
  69. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +1 -1
  70. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
  71. package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
  72. package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
  73. package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +22 -10
  74. package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +13 -13
  75. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
  76. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
  77. package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +1 -1
  78. package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
  79. package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +1 -1
  80. package/coverage/lcov-report/src/components/MlWmsLoader/index.html +1 -1
  81. package/coverage/lcov-report/src/contexts/MapContext.tsx.html +24 -3
  82. package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
  83. package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
  84. package/coverage/lcov-report/src/contexts/index.html +1 -1
  85. package/coverage/lcov-report/src/hooks/index.html +1 -1
  86. package/coverage/lcov-report/src/hooks/useCameraFollowPath/index.html +1 -1
  87. package/coverage/lcov-report/src/hooks/useCameraFollowPath/useCameraFollowPath.tsx.html +1 -1
  88. package/coverage/lcov-report/src/hooks/useExportMap/index.html +1 -1
  89. package/coverage/lcov-report/src/hooks/useExportMap/index.ts.html +1 -1
  90. package/coverage/lcov-report/src/hooks/useExportMap/lib.ts.html +2 -2
  91. package/coverage/lcov-report/src/hooks/useGpx/index.html +1 -1
  92. package/coverage/lcov-report/src/hooks/useGpx/useGpx.tsx.html +1 -1
  93. package/coverage/lcov-report/src/hooks/useLayer.ts.html +1 -1
  94. package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +1 -1
  95. package/coverage/lcov-report/src/hooks/useLayerFilter/index.html +1 -1
  96. package/coverage/lcov-report/src/hooks/useLayerFilter/useLayerFilter.ts.html +1 -1
  97. package/coverage/lcov-report/src/hooks/useLayerHoverPopup/index.html +1 -1
  98. package/coverage/lcov-report/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx.html +1 -1
  99. package/coverage/lcov-report/src/hooks/useMap.ts.html +1 -1
  100. package/coverage/lcov-report/src/hooks/useMapState.ts.html +1 -1
  101. package/coverage/lcov-report/src/hooks/useSource.ts.html +1 -1
  102. package/coverage/lcov-report/src/hooks/useWms.ts.html +1 -1
  103. package/coverage/lcov-report/src/index.html +1 -1
  104. package/coverage/lcov-report/src/index.ts.html +27 -3
  105. package/coverage/lcov.info +326 -342
  106. package/dist/components/MapLibreMap/MapLibreMap.d.ts +3 -3
  107. package/dist/components/MapLibreMap/MapLibreMap.stories.d.ts +2 -0
  108. package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +1 -1
  109. package/dist/components/MlCenterPosition/MlCenterPosition.d.ts +2 -15
  110. package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +1 -14
  111. package/dist/components/MlComponentTemplate/MlComponentTemplate.d.ts +1 -0
  112. package/dist/components/MlComponentTemplate/MlComponentTemplate.stories.d.ts +1 -0
  113. package/dist/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +1 -0
  114. package/dist/components/MlCreatePdfButton/MlCreatePdfButton.stories.d.ts +1 -0
  115. package/dist/components/MlCreatePdfForm/MlCreatePdfForm.d.ts +1 -0
  116. package/dist/components/MlCreatePdfForm/MlCreatePdfForm.stories.d.ts +1 -0
  117. package/dist/components/MlCreatePdfForm/lib/PdfForm.d.ts +1 -0
  118. package/dist/components/MlCreatePdfForm/lib/_PdfPreview.d.ts +1 -0
  119. package/dist/components/MlFeatureEditor/MlFeatureEditor.d.ts +1 -0
  120. package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.d.ts +1 -0
  121. package/dist/components/MlFollowGps/MlFollowGps.d.ts +5 -23
  122. package/dist/components/MlFollowGps/MlFollowGps.stories.d.ts +2 -2
  123. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +1 -0
  124. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +1 -0
  125. package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.d.ts +1 -0
  126. package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.d.ts +1 -0
  127. package/dist/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.d.ts +4 -1
  128. package/dist/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.d.ts +1 -0
  129. package/dist/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.stories.d.ts +1 -0
  130. package/dist/components/MlGpxViewer/MlGpxViewer.d.ts +1 -0
  131. package/dist/components/MlGpxViewer/MlGpxViewer.stories.d.ts +1 -0
  132. package/dist/components/MlGpxViewer/util/GeoJsonProvider.d.ts +1 -0
  133. package/dist/components/MlGpxViewer/util/MetadataDrawer.d.ts +1 -0
  134. package/dist/components/MlGpxViewer/util/MlGpxDemoLoader.d.ts +1 -0
  135. package/dist/components/MlGpxViewer/util/MlGpxViewerInstructions.d.ts +1 -0
  136. package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +1 -0
  137. package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.d.ts +1 -0
  138. package/dist/components/MlLayer/MlLayer.d.ts +1 -0
  139. package/dist/components/MlLayerMagnify/MlLayerMagnify.stories.d.ts +1 -0
  140. package/dist/components/MlLayerSwipe/MlLayerSwipe.stories.d.ts +1 -0
  141. package/dist/components/MlMarker/MlMarker.d.ts +1 -0
  142. package/dist/components/MlMeasureTool/MlMeasureTool.d.ts +1 -0
  143. package/dist/components/MlNavigationCompass/MlNavigationCompass.d.ts +1 -0
  144. package/dist/components/MlNavigationTools/MlNavigationTools.d.ts +5 -0
  145. package/dist/components/MlScaleReference/MlScaleReference.d.ts +1 -0
  146. package/dist/components/MlShareMapState/MlShareMapState.d.ts +1 -0
  147. package/dist/components/MlShareMapState/MlShareMapState.stories.d.ts +1 -0
  148. package/dist/components/MlSketchTool/LayerList/ColorPicker.d.ts +1 -0
  149. package/dist/components/MlSketchTool/LayerList/LayerList.d.ts +1 -0
  150. package/dist/components/MlSketchTool/LayerList/LayerListItem.d.ts +1 -0
  151. package/dist/components/MlSketchTool/LayerList/LayerPropertyForm.d.ts +1 -0
  152. package/dist/components/MlSketchTool/MlSketchTool.d.ts +1 -0
  153. package/dist/components/MlSketchTool/MlSketchTool.stories.d.ts +1 -0
  154. package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +1 -0
  155. package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.d.ts +1 -0
  156. package/dist/components/MlThreeJsLayer/MlThreeJsLayer.stories.d.ts +1 -0
  157. package/dist/components/MlThreeJsLayer/MlThreejsLayer.d.ts +1 -0
  158. package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +1 -0
  159. package/dist/components/MlVectorTileLayer/MlVectorTileLayer.d.ts +3 -2
  160. package/dist/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.stories.d.ts +1 -0
  161. package/dist/components/MlWmsLayer/MlWmsLayer.d.ts +1 -0
  162. package/dist/components/MlWmsLoader/MlWmsLoader.d.ts +1 -0
  163. package/dist/components/MlWmsLoader/MlWmsLoader.stories.d.ts +1 -0
  164. package/dist/components/MlWmsLoader/utils/MlWmsLoaderInstructions.d.ts +1 -0
  165. package/dist/components/MlWmsLoader/utils/WMSLinks.d.ts +1 -0
  166. package/dist/decorators/EmptyMapDecorator.d.ts +2 -0
  167. package/dist/decorators/ThemeDecorator.d.ts +2 -0
  168. package/dist/hooks/useCameraFollowPath/useCameraFollowPath.stories.d.ts +1 -0
  169. package/dist/hooks/useExportMap/lib.d.ts +1 -1
  170. package/dist/hooks/useLayerFilter/useLayerFilter.stories.d.ts +1 -0
  171. package/dist/hooks/useLayerHoverPopup/useLayerHoverPopup.d.ts +1 -0
  172. package/dist/index.d.ts +7 -0
  173. package/dist/index.esm.css +0 -97
  174. package/dist/index.esm.js +5495 -14503
  175. package/dist/index.esm.js.map +1 -1
  176. package/dist/ui_components/Dropzone.d.ts +1 -0
  177. package/dist/ui_components/ImageLoader.d.ts +1 -0
  178. package/dist/ui_components/LayerList/LayerList.d.ts +6 -0
  179. package/dist/ui_components/LayerList/LayerList.stories.d.ts +12 -0
  180. package/dist/ui_components/LayerList/LayerListFolder.d.ts +9 -0
  181. package/dist/ui_components/LayerList/LayerListItem.d.ts +18 -0
  182. package/dist/ui_components/LayerList/util/LayerListItemVectorLayer.d.ts +15 -0
  183. package/dist/ui_components/LayerList/util/LayerPropertyForm.d.ts +10 -0
  184. package/dist/ui_components/LayerList/util/input/ColorPicker.d.ts +10 -0
  185. package/dist/ui_components/LoadingOverlayContext.d.ts +0 -1
  186. package/dist/ui_components/MapcomponentsTheme.d.ts +7 -0
  187. package/dist/ui_components/Tooltip.d.ts +1 -0
  188. package/dist/ui_components/TopToolbar.d.ts +1 -0
  189. package/dist/ui_components/UploadButton.d.ts +1 -0
  190. package/dist/util/Instructions.d.ts +1 -0
  191. package/package.json +24 -31
  192. package/rollup.config.js +61 -44
  193. package/src/@types/assets/index.d.ts +1 -1
  194. package/src/App.css +0 -55
  195. package/src/components/MapLibreMap/MapLibreMap.stories.js +36 -37
  196. package/src/components/MapLibreMap/MapLibreMap.tsx +23 -17
  197. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +1 -1
  198. package/src/components/MlCenterPosition/MlCenterPosition.tsx +22 -29
  199. package/src/components/MlCreatePdfForm/lib/PdfForm.tsx +6 -6
  200. package/src/components/MlFollowGps/MlFollowGps.stories.js +28 -10
  201. package/src/components/MlFollowGps/MlFollowGps.tsx +31 -50
  202. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +1 -1
  203. package/src/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.ts +16 -10
  204. package/src/components/MlGpxViewer/MlGpxViewer.stories.tsx +4 -13
  205. package/src/components/MlGpxViewer/util/MlGpxDemoLoader.tsx +3 -1
  206. package/src/components/MlNavigationTools/MlNavigationTools.stories.js +4 -5
  207. package/src/components/MlNavigationTools/MlNavigationTools.tsx +30 -54
  208. package/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx +1 -1
  209. package/src/components/MlSketchTool/MlSketchTool.tsx +1 -1
  210. package/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx +7 -3
  211. package/src/components/MlWmsLoader/MlWmsLoader.stories.tsx +3 -11
  212. package/src/components/MlWmsLoader/utils/MlWmsLoaderInstructions.tsx +2 -2
  213. package/src/components/MlWmsLoader/utils/WMSLinks.tsx +1 -1
  214. package/src/contexts/MapContext.tsx +8 -1
  215. package/src/custom.d.ts +4 -5
  216. package/src/decorators/EmptyMapDecorator.js +38 -0
  217. package/src/decorators/MapContextDecorator.js +10 -16
  218. package/src/decorators/MapContextDecoratorHooks.js +25 -30
  219. package/src/decorators/MultiMapContextDecorator.js +8 -18
  220. package/src/decorators/NoNavToolsDecorator.js +8 -15
  221. package/src/decorators/ThemeDecorator.js +24 -0
  222. package/src/decorators/style.css +0 -2
  223. package/src/hooks/useCameraFollowPath/useCameraFollowPath.stories.tsx +13 -19
  224. package/src/hooks/useExportMap/lib.ts +1 -1
  225. package/src/hooks/useGpx/useGpx.stories.js +1 -1
  226. package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.stories.js +1 -1
  227. package/src/hooks/useMapState.stories.js +1 -1
  228. package/src/hooks/useSources.stories.js +1 -1
  229. package/src/index.ts +9 -0
  230. package/src/ui_components/LayerList/LayerList.stories.tsx +136 -0
  231. package/src/ui_components/LayerList/LayerList.tsx +12 -0
  232. package/src/ui_components/LayerList/LayerListFolder.tsx +82 -0
  233. package/src/ui_components/LayerList/LayerListItem.tsx +180 -0
  234. package/src/ui_components/LayerList/assets/sample_1.json +26 -0
  235. package/src/ui_components/LayerList/assets/sample_2.json +22 -0
  236. package/src/ui_components/LayerList/assets/sample_polygon_1.json +33 -0
  237. package/src/ui_components/LayerList/assets/style.json +2599 -0
  238. package/src/ui_components/LayerList/util/LayerListItemVectorLayer.tsx +92 -0
  239. package/src/ui_components/LayerList/util/LayerPropertyForm.tsx +125 -0
  240. package/src/ui_components/LayerList/util/input/ColorPicker.tsx +44 -0
  241. package/src/ui_components/MapcomponentsTheme.tsx +133 -0
  242. package/src/ui_components/Sidebar.tsx +16 -11
  243. package/src/ui_components/TopToolbar.tsx +1 -3
  244. package/src/util/BubbleForInstructions.js +14 -12
  245. package/tsconfig.json +3 -10
  246. package/dist/components/MlGPXViewer/MlGPXViewer.d.ts +0 -29
  247. package/dist/components/MlGPXViewer/MlGPXViewer.stories.d.ts +0 -16
  248. package/dist/components/MlGPXViewer/MlGPXViewer.test.d.ts +0 -1
  249. package/dist/components/MlGPXViewer/gpxConverter.d.ts +0 -11
  250. package/dist/components/MlGPXViewer/util/GeoJsonContext.d.ts +0 -10
  251. package/dist/components/MlGPXViewer/util/GeoJsonProvider.d.ts +0 -4
  252. package/dist/components/MlLayer/MlLayer.stories.d.ts +0 -10
  253. package/dist/custom.d.d.ts +0 -22
  254. package/dist/decorators/ThemeWrapper.d.ts +0 -1
  255. package/dist/hooks/exportMap/index.d.ts +0 -11
  256. package/dist/hooks/exportMap/lib.d.ts +0 -36
  257. package/dist/ui_components/Legend.d.ts +0 -1
  258. package/dist/ui_components/LoadingOverlay.d.ts +0 -2
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useCallback } from "react";
2
2
  import useMap from "../../hooks/useMap";
3
- import { Button, SxProps, Theme } from "@mui/material";
4
- import GpsFixedIcon from "@mui/icons-material/GpsFixed";
3
+ import { Button, SxProps, Theme } from '@mui/material';
4
+ import GpsFixedIcon from '@mui/icons-material/GpsFixed';
5
5
 
6
6
  export interface MlCenterPositionProps {
7
7
  /**
@@ -36,51 +36,44 @@ const MlCenterPosition = (props: MlCenterPositionProps) => {
36
36
  mapId: props.mapId,
37
37
  waitForLayer: props.insertBeforeLayer,
38
38
  });
39
+
39
40
  const [locationAccessDenied, setLocationAccessDenied] = useState(false);
40
41
 
41
42
  const centerCurrentLocation = () => {
42
43
  navigator.geolocation.getCurrentPosition(getLocationSuccess, getLocationError);
43
44
  };
44
45
 
45
- const getLocationSuccess = useCallback((location:GeolocationPosition) => {
46
- mapHook.map?.map.setCenter?.([location.coords.longitude, location.coords.latitude]);
47
- }, [mapHook.map]);
46
+ const getLocationSuccess = useCallback(
47
+ (location: GeolocationPosition) => {
48
+ mapHook.map?.map.setCenter?.([location.coords.longitude, location.coords.latitude]);
49
+ },
50
+ [mapHook.map]
51
+ );
48
52
 
49
53
  const getLocationError = () => {
50
- console.log("Access of user location denied");
54
+ console.log('Access of user location denied');
51
55
  setLocationAccessDenied(true);
52
56
  };
53
- return <>
54
- <Button
57
+ return (
58
+ <>
59
+ <Button
60
+ variant="navtools"
55
61
  sx={{
56
62
  zIndex: 1002,
57
63
  color: !locationAccessDenied ? props.onColor : props.offColor,
58
- ...props.style,
59
64
  }}
60
- onClick={centerCurrentLocation} disabled={locationAccessDenied}>
61
- <GpsFixedIcon sx={{ ...(props.style?.['fontSize']?{fontSize: props.style?.['fontSize']}:{}) }} />{" "}
65
+ onClick={centerCurrentLocation}
66
+ disabled={locationAccessDenied}
67
+ >
68
+ <GpsFixedIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />
62
69
  </Button>
63
- </>;
64
-
70
+ </>
71
+ );
65
72
  };
66
73
 
67
74
  MlCenterPosition.defaultProps = {
68
75
  mapId: undefined,
69
- style: {
70
- minWidth: "30px",
71
- minHeight: "30px",
72
- width: "30px",
73
- height: "30px",
74
- backgroundColor: "#414141",
75
- borderRadius: "23%",
76
- margin: 0.15,
77
- fontSize: "1.3em",
78
- ":hover": {
79
- backgroundColor: "#515151",
80
- color: "#ececec",
81
- },
82
- },
83
- onColor: "#ececec",
84
- offColor: "#666",
76
+ onColor: '#ececec',
77
+ offColor: '#666',
85
78
  };
86
79
  export default MlCenterPosition;
@@ -188,7 +188,7 @@ export default function PdfForm(props: PdfFormProps) {
188
188
  <Select
189
189
  labelId="quality-select-label"
190
190
  id="quality-select"
191
- label="Qualität"
191
+ label="Quality"
192
192
  value={pdfContext.quality}
193
193
  onChange={(event) => {
194
194
  pdfContext.setQuality?.(event.target.value);
@@ -202,11 +202,11 @@ export default function PdfForm(props: PdfFormProps) {
202
202
  </Select>
203
203
  </FormControl>
204
204
  <FormControl fullWidth sx={formControlStyles}>
205
- <InputLabel id="quality-select-label">Scale</InputLabel>
205
+ <InputLabel id="scale-select-label">Scale</InputLabel>
206
206
  <Select
207
- labelId="quality-select-label"
208
- id="quality-select"
209
- label="Qualität"
207
+ labelId="scale-select-label"
208
+ id="scale-select"
209
+ label="Scale"
210
210
  value={pdfContext?.options?.fixedScale}
211
211
  onChange={(event) => {
212
212
  pdfContext.setOptions?.((val) => ({
@@ -229,7 +229,7 @@ export default function PdfForm(props: PdfFormProps) {
229
229
  onClick={createPdfHandler}
230
230
  disabled={loading}
231
231
  >
232
- PDF erstellen
232
+ create PDF
233
233
  </Button>
234
234
  {loading && (
235
235
  <CircularProgress
@@ -1,22 +1,40 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
 
3
- import MlFollowGps from "./MlFollowGps";
3
+ import MlFollowGps from './MlFollowGps';
4
4
 
5
- import mapContextDecorator from "../../decorators/MapContextDecorator";
5
+ import noNavToolsDecorator from '../../decorators/NoNavToolsDecorator';
6
+ import useMediaQuery from '@mui/material/useMediaQuery';
6
7
 
7
8
  const storyoptions = {
8
- title: "MapComponents/MlFollowGps",
9
+ title: 'MapComponents/MlFollowGps',
9
10
  component: MlFollowGps,
10
- argTypes: {
11
- },
12
- decorators: mapContextDecorator,
11
+ argTypes: {},
12
+ decorators: noNavToolsDecorator,
13
13
  };
14
14
  export default storyoptions;
15
15
 
16
- const Template = (props) => <MlFollowGps {...props}/>;
17
-
16
+ const Template = (props) => {
17
+ const mediaIsMobile = useMediaQuery('(max-width:900px)');
18
+ return (
19
+ <>
20
+ <div
21
+ style={{
22
+ position: 'fixed',
23
+ right: '11px',
24
+ bottom: mediaIsMobile ? '130px' : '45px',
25
+ display: 'flex',
26
+ flexDirection: 'column',
27
+ gap: '5px',
28
+ zIndex: 1000,
29
+ }}
30
+ >
31
+ <MlFollowGps {...props} />
32
+ </div>
33
+ </>
34
+ );
35
+ };
18
36
  export const ExampleConfig = Template.bind({});
19
37
  ExampleConfig.parameters = {};
20
38
  ExampleConfig.args = {
21
- followUserPosition: false
39
+ followUserPosition: false,
22
40
  };
@@ -2,11 +2,11 @@ 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, SxProps } from "@mui/material";
6
- import GpsFixedIcon from "@mui/icons-material/GpsFixed";
5
+ import { Button } from '@mui/material';
6
+ import GpsFixedIcon from '@mui/icons-material/GpsFixed';
7
7
 
8
- import { point, circle, lineArc, Feature, Point } from "@turf/turf";
9
- import { CircleLayerSpecification, FillLayerSpecification } from "maplibre-gl";
8
+ import { point, circle, lineArc, Feature, Point } from '@turf/turf';
9
+ import { CircleLayerSpecification, FillLayerSpecification } from 'maplibre-gl';
10
10
 
11
11
  interface MlFollowGpsProps {
12
12
  /**
@@ -47,13 +47,13 @@ interface MlFollowGpsProps {
47
47
  * Use any available paint prop from layer type "fill".
48
48
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
49
49
  */
50
- orientationConePaint?: FillLayerSpecification["paint"];
50
+ orientationConePaint?: FillLayerSpecification['paint'];
51
51
  /**
52
52
  * Position circle paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the position circle.
53
53
  * Use any available paint prop from layer type "circle".
54
54
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
55
55
  */
56
- circlePaint?: CircleLayerSpecification["paint"];
56
+ circlePaint?: CircleLayerSpecification['paint'];
57
57
  /**
58
58
  * Active button font color
59
59
  */
@@ -67,11 +67,7 @@ interface MlFollowGpsProps {
67
67
  * Use any available paint prop from layer type "fill".
68
68
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
69
69
  */
70
- accuracyPaint?: FillLayerSpecification["paint"];
71
- /**
72
- * CSS style object that is applied to the button component
73
- */
74
- buttonSx?: SxProps | any;
70
+ accuracyPaint?: FillLayerSpecification['paint'];
75
71
  }
76
72
 
77
73
  /**
@@ -93,7 +89,7 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
93
89
  const initiallyCentered = useRef(false);
94
90
 
95
91
  const getLocationSuccess = useCallback(
96
- (pos:GeolocationPosition) => {
92
+ (pos: GeolocationPosition) => {
97
93
  if (!mapHook.map) return;
98
94
 
99
95
  if ((!props.centerUserPosition && !initiallyCentered.current) || props.centerUserPosition) {
@@ -119,7 +115,7 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
119
115
  );
120
116
 
121
117
  const getLocationError = () => {
122
- console.log("Access of user location denied");
118
+ console.log('Access of user location denied');
123
119
  setLocationAccessDenied(true);
124
120
  };
125
121
 
@@ -138,16 +134,18 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
138
134
  return copy;
139
135
  }, [deviceOrientation, userLocationGeoJson]);
140
136
 
141
- const handleOrientation = (event: any) => {
142
- setDeviceOrientation(-event.alpha);
137
+ const handleOrientation = (event: DeviceOrientationEvent) => {
138
+ if (event?.alpha) {
139
+ setDeviceOrientation(-event.alpha);
140
+ }
143
141
  };
144
142
 
145
143
  useEffect(() => {
146
144
  if (isFollowed) {
147
145
  const _handleOrientation = handleOrientation;
148
- window.addEventListener("deviceorientation", _handleOrientation);
146
+ window.addEventListener('deviceorientation', _handleOrientation);
149
147
  return () => {
150
- window.removeEventListener("deviceorientation", _handleOrientation);
148
+ window.removeEventListener('deviceorientation', _handleOrientation);
151
149
  };
152
150
  } else {
153
151
  initiallyCentered.current = false;
@@ -173,10 +171,10 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
173
171
  {isFollowed && userLocationGeoJson && (
174
172
  <MlGeoJsonLayer
175
173
  geojson={accuracyGeoJson}
176
- type={"fill"}
174
+ type={'fill'}
177
175
  paint={{
178
- "fill-color": "#cbd300",
179
- "fill-opacity": 0.3,
176
+ 'fill-color': '#cbd300',
177
+ 'fill-opacity': 0.3,
180
178
  ...props.accuracyPaint,
181
179
  }}
182
180
  insertBeforeLayer={props.insertBeforeLayer}
@@ -186,11 +184,11 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
186
184
  {isFollowed && orientationCone && (
187
185
  <MlGeoJsonLayer
188
186
  geojson={orientationCone}
189
- type={"fill"}
187
+ type={'fill'}
190
188
  paint={{
191
- "fill-color": "#0000ff",
192
- "fill-antialias": false,
193
- "fill-opacity": 0.3,
189
+ 'fill-color': '#0000ff',
190
+ 'fill-antialias': false,
191
+ 'fill-opacity': 0.3,
194
192
  ...props.orientationConePaint,
195
193
  }}
196
194
  insertBeforeLayer={props.insertBeforeLayer}
@@ -200,12 +198,12 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
200
198
  {isFollowed && userLocationGeoJson && (
201
199
  <MlGeoJsonLayer
202
200
  geojson={userLocationGeoJson}
203
- type={"circle"}
201
+ type={'circle'}
204
202
  paint={{
205
- "circle-color": "#009ee0",
206
- "circle-radius": 5,
207
- "circle-stroke-color": "#fafaff",
208
- "circle-stroke-width": 1,
203
+ 'circle-color': '#009ee0',
204
+ 'circle-radius': 5,
205
+ 'circle-stroke-color': '#fafaff',
206
+ 'circle-stroke-width': 1,
209
207
  ...props.circlePaint,
210
208
  }}
211
209
  insertBeforeLayer={props.insertBeforeLayer}
@@ -213,20 +211,17 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
213
211
  )}
214
212
 
215
213
  <Button
214
+ variant="navtools"
216
215
  sx={{
217
216
  zIndex: 1002,
218
217
  color: isFollowed ? props.onColor : props.offColor,
219
- ...props.buttonSx,
220
218
  }}
221
219
  disabled={locationAccessDenied}
222
220
  onClick={() => {
223
221
  setIsFollowed(!isFollowed);
224
222
  }}
225
223
  >
226
- {" "}
227
- <GpsFixedIcon
228
- sx={{ ...(props.buttonSx?.fontSize ? { fontSize: props.buttonSx?.fontSize } : {}) }}
229
- />{" "}
224
+ <GpsFixedIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />
230
225
  </Button>
231
226
  </>
232
227
  );
@@ -234,22 +229,8 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
234
229
 
235
230
  MlFollowGps.defaultProps = {
236
231
  mapId: undefined,
237
- buttonSx: {
238
- minWidth: "30px",
239
- minHeight: "30px",
240
- width: "30px",
241
- height: "30px",
242
- backgroundColor: "#414141",
243
- borderRadius: "23%",
244
- margin: 0.15,
245
- fontSize: "1.3em",
246
- ":hover": {
247
- backgroundColor: "#515151",
248
- color: "#ececec",
249
- },
250
- },
251
- onColor: "#ececec",
252
- offColor: "#666",
232
+ onColor: '#ececec',
233
+ offColor: '#666',
253
234
  showAccuracyCircle: true,
254
235
  showUserLocation: true,
255
236
  showOrientation: true,
@@ -115,7 +115,7 @@ const MlGeoJsonLayer = (props: MlGeoJsonLayerProps) => {
115
115
  layout: props.layout || {},
116
116
  ...props.options,
117
117
  type: layerType as LayerSpecification['type'],
118
- },
118
+ } as Partial<LayerSpecification>,
119
119
  insertBeforeLayer: props.insertBeforeLayer,
120
120
  onHover: props.onHover,
121
121
  onClick: props.onClick,
@@ -1,29 +1,35 @@
1
- const getDefaultPaintPropsByType:Function = (type:string, defaultPaintOverrides:any):any => {
1
+ import { LayerSpecification, RasterLayerSpecification } from 'maplibre-gl';
2
+
3
+ const getDefaultPaintPropsByType = (
4
+ type: string,
5
+ defaultPaintOverrides?: { [key: string]: unknown }
6
+ ): Exclude<LayerSpecification['paint'], RasterLayerSpecification['paint']> => {
2
7
  switch (type) {
3
- case "fill":
8
+ case 'fill':
4
9
  if (defaultPaintOverrides?.fill) {
5
10
  return defaultPaintOverrides.fill;
6
11
  }
7
12
  return {
8
- "fill-color": "rgba(10,240,256,0.6)",
13
+ 'fill-color': 'rgba(10,240,256,0.6)',
9
14
  };
10
- case "line":
15
+ case 'line':
11
16
  if (defaultPaintOverrides?.line) {
12
17
  return defaultPaintOverrides.line;
13
18
  }
14
19
  return {
15
- "line-color": "rgb(203,211,2)",
16
- "line-width": 5,
20
+ 'line-color': 'rgb(203,211,2)',
21
+ 'line-width': 5,
22
+ 'line-blur': 0,
17
23
  };
18
- case "circle":
24
+ case 'circle':
19
25
  default:
20
26
  if (defaultPaintOverrides?.circle) {
21
27
  return defaultPaintOverrides.circle;
22
28
  }
23
29
  return {
24
- "circle-color": "rgba(10,240,256,0.8)",
25
- "circle-stroke-color": "#fff",
26
- "circle-stroke-width": 2,
30
+ 'circle-color': 'rgba(10,240,256,0.8)',
31
+ 'circle-stroke-color': '#fff',
32
+ 'circle-stroke-width': 2,
27
33
  };
28
34
  }
29
35
  };
@@ -47,8 +47,8 @@ const Template = () => {
47
47
 
48
48
  return (
49
49
  <>
50
- <MlGpxViewerInstructions open={guide} />
51
- <MlGpxDemoLoader open={demoLoaderOpen} setOpen={setDemoLoaderOpen} setGpx={setGpxData} />
50
+ <MlGpxViewerInstructions open={guide} />
51
+ <MlGpxDemoLoader open={demoLoaderOpen} setOpen={setDemoLoaderOpen} setGpx={setGpxData} />
52
52
  <TopToolbar appBarStyle={{ zIndex: 500 }}>
53
53
  <Button variant="contained" onClick={handleClick2} sx={{ marginRight: '10px' }}>
54
54
  Guide me through
@@ -57,8 +57,7 @@ const Template = () => {
57
57
  Demo Mode
58
58
  </Button>
59
59
  </TopToolbar>
60
-
61
-
60
+
62
61
  <div
63
62
  style={{
64
63
  position: 'fixed',
@@ -73,12 +72,7 @@ const Template = () => {
73
72
  <UploadButton
74
73
  setData={setGpxData}
75
74
  buttonComponent={
76
- <IconButton
77
- style={{
78
- backgroundColor: 'rgba(255,255,255,1)',
79
- }}
80
- size="large"
81
- >
75
+ <IconButton size="large">
82
76
  <FileCopy />
83
77
  </IconButton>
84
78
  }
@@ -87,9 +81,6 @@ const Template = () => {
87
81
  onClick={() => {
88
82
  setMetadataDrawerOpen((prevState) => !prevState);
89
83
  }}
90
- style={{
91
- backgroundColor: 'rgba(255,255,255,1)',
92
- }}
93
84
  size="large"
94
85
  >
95
86
  <InfoIcon />
@@ -19,6 +19,7 @@ const modalStyle = {
19
19
  width: 350,
20
20
  height: 280,
21
21
  bgcolor: 'background.paper',
22
+ color: 'text.primary',
22
23
  boxShadow: 24,
23
24
  p: 4,
24
25
  };
@@ -30,6 +31,7 @@ const mobileStyle = {
30
31
  width: 200,
31
32
  height: 300,
32
33
  bgcolor: 'background.paper',
34
+ color: 'text.primary',
33
35
  boxShadow: 24,
34
36
  p: 4,
35
37
  };
@@ -101,7 +103,7 @@ const MlGpxDemoLoader = (props: MlGpxDemoLoaderProps) => {
101
103
  </Grid>
102
104
  <Grid item xs={2}>
103
105
  <Button onClick={handleClose}>
104
- <CloseIcon sx={{ color: 'black' }} />
106
+ <CloseIcon sx={{ color: 'text.primary' }} />
105
107
  </Button>
106
108
  </Grid>
107
109
  </Grid>
@@ -7,7 +7,7 @@ import BuildIcon from "@mui/icons-material/Build";
7
7
  import Button from "@mui/material/Button";
8
8
 
9
9
  const storyoptions = {
10
- title: "MapComponents/MlNavigationTools",
10
+ title: 'MapComponents/MlNavigationTools',
11
11
  component: MlNavigationTools,
12
12
  argTypes: {
13
13
  url: {},
@@ -18,7 +18,6 @@ const storyoptions = {
18
18
  export default storyoptions;
19
19
 
20
20
  const Template = (args) => <MlNavigationTools {...args} />;
21
-
22
21
  export const DefaultConfig = Template.bind({});
23
22
  DefaultConfig.parameters = {};
24
23
  DefaultConfig.args = {};
@@ -39,7 +38,7 @@ ShowCenterLocationButton.args = {
39
38
  export const AlterToolPosition = Template.bind({});
40
39
  AlterToolPosition.parameters = {};
41
40
  AlterToolPosition.args = {
42
- sx: { top: "10px", right: "5px" },
41
+ sx: { top: '10px', right: '5px' },
43
42
  };
44
43
 
45
44
  export const NoZoomButtons = Template.bind({});
@@ -58,8 +57,8 @@ export const CustomButton = Template.bind({});
58
57
  CustomButton.parameters = {};
59
58
  CustomButton.args = {
60
59
  children: (
61
- <Button onClick={() => {}}>
62
- <BuildIcon sx={{ fontSize: "1em" }} />
60
+ <Button variant="navtools" onClick={() => {}}>
61
+ <BuildIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />
63
62
  </Button>
64
63
  ),
65
64
  };
@@ -46,11 +46,16 @@ interface MlNavigationToolsProps {
46
46
  * Style attribute for NavigationTools container
47
47
  */
48
48
  sx?: SxProps;
49
+ /**
50
+ * Style attribute for NavigationTools container
51
+ */
52
+ mediaIsMobile?: boolean;
49
53
  }
50
54
 
51
55
  /**
52
56
  * @component
53
57
  */
58
+
54
59
  const MlNavigationTools = (props: MlNavigationToolsProps) => {
55
60
  const mapHook = useMap({
56
61
  mapId: props.mapId,
@@ -58,32 +63,13 @@ const MlNavigationTools = (props: MlNavigationToolsProps) => {
58
63
  });
59
64
 
60
65
  const [pitch, setPitch] = useState(0);
61
- const mediaIsMobile = useMediaQuery("(max-width:900px)");
62
- const buttonStyle = {
63
- minWidth: "20px",
64
- minHeight: "20px",
65
- width: mediaIsMobile ? "50px" : "30px",
66
- height: mediaIsMobile ? "50px" : "30px",
67
- backgroundColor: "#414141",
68
- borderRadius: "23%",
69
- //border: "1px solid #bbb",
70
- //boxShadow: "0px 0px 4px rgba(0,0,0,.5)",
71
- margin: 0.15,
72
- fontSize: mediaIsMobile ? "1.4em" : "1.2em",
73
- ":hover": {
74
- backgroundColor: "#515151",
75
- },
76
- color: "#ececec",
77
- };
78
- const iconStyle = {
79
- fontSize: buttonStyle.fontSize,
80
- };
66
+ const mediaIsMobile = useMediaQuery('(max-width:900px)');
81
67
 
82
68
  useEffect(() => {
83
69
  if (!mapHook.map) return;
84
70
 
85
71
  mapHook.map.on(
86
- "pitchend",
72
+ 'pitchend',
87
73
  () => {
88
74
  if (!mapHook.map) return;
89
75
 
@@ -124,63 +110,53 @@ const MlNavigationTools = (props: MlNavigationToolsProps) => {
124
110
  <Box
125
111
  sx={{
126
112
  zIndex: 501,
127
- position: "absolute",
128
- display: "flex",
129
- flexDirection: "column",
130
- ...(mediaIsMobile ? { margin: "20px 10px 20px 10px" } : {}),
113
+ position: 'absolute',
114
+ display: 'flex',
115
+ flexDirection: 'column',
116
+ ...(mediaIsMobile ? { margin: '20px 10px 20px 10px' } : {}),
131
117
  ...props.sx,
132
118
  }}
133
119
  >
134
120
  <MlNavigationCompass
135
121
  style={{
136
- width: "31px",
137
- position: "relative",
138
- height: mediaIsMobile ? "55px" : "45px",
139
- marginLeft: mediaIsMobile ? "3px" : "-5px",
140
- transform: mediaIsMobile ? "scale(1.6)" : "scale(1)",
122
+ width: '31px',
123
+ position: 'relative',
124
+ height: mediaIsMobile ? '55px' : '45px',
125
+ marginLeft: mediaIsMobile ? '3px' : '-5px',
126
+ transform: mediaIsMobile ? 'scale(1.6)' : 'scale(1)',
141
127
  }}
142
128
  backgroundStyle={{
143
- boxShadow: "0px 0px 18px rgba(0,0,0,.5)",
129
+ boxShadow: '0px 0px 18px rgba(0,0,0,.5)',
144
130
  }}
145
131
  />
146
132
  {props.show3DButton && (
147
- <Button
148
- sx={{ ...buttonStyle, fontSize: mediaIsMobile ? "1.4em" : "1em", fontWeight: 600 }}
149
- onClick={adjustPitch}
150
- >
151
- {pitch ? "2D" : "3D"}
133
+ <Button variant="navtools" onClick={adjustPitch}>
134
+ {pitch ? '2D' : '3D'}
152
135
  </Button>
153
136
  )}
154
- {props.showFollowGpsButton && (
155
- <MlFollowGps buttonSx={{ ...(({ color, ...rest }) => rest)(buttonStyle) }} />
156
- )}
157
- {props.showCenterLocationButton && (
158
- <MlCenterPosition style={{ ...(({ color, ...rest }) => rest)(buttonStyle) }} />
159
- )}
137
+ {props.showFollowGpsButton && <MlFollowGps />}
138
+ {props.showCenterLocationButton && <MlCenterPosition />}
160
139
  <ButtonGroup
161
140
  orientation="vertical"
162
141
  sx={{
163
- width: "50px",
164
- border: "none",
165
- Button: { minWidth: "20px !important", border: "none", padding: 0 },
166
- "Button:hover": { border: "none" },
142
+ width: '50px',
143
+ border: 'none',
144
+ Button: { minWidth: '20px !important', border: 'none', padding: 0 },
145
+ 'Button:hover': { border: 'none' },
167
146
  }}
168
147
  >
169
148
  {props.showZoomButtons && (
170
149
  <>
171
- <Button sx={{ ...buttonStyle }} onClick={zoomIn}>
172
- <ControlPointIcon sx={{ ...iconStyle }} />
150
+ <Button variant="navtools" onClick={zoomIn}>
151
+ <ControlPointIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />
173
152
  </Button>
174
- <Button sx={{ ...buttonStyle }} onClick={zoomOut}>
175
- <RemoveCircleOutlineIcon sx={{ ...iconStyle }} />
153
+ <Button variant="navtools" onClick={zoomOut}>
154
+ <RemoveCircleOutlineIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />
176
155
  </Button>
177
156
  </>
178
157
  )}
179
158
  </ButtonGroup>
180
- {props.children &&
181
- React.cloneElement(props.children, {
182
- sx: { ...buttonStyle },
183
- })}
159
+ {props.children && React.cloneElement(props.children, {})}
184
160
  </Box>
185
161
  );
186
162
  };
@@ -84,7 +84,7 @@ export default function LayerPropertyForm({ paintProps = {}, setPaintProps }: Pr
84
84
  <TextField
85
85
  inputProps={{ inputMode: 'decimal', pattern: '[0-9]*' }}
86
86
  value={paintProps[key]}
87
- onChange={(ev: React.ChangeEvent) => {
87
+ onChange={(ev: React.ChangeEvent<HTMLInputElement>) => {
88
88
  if (ev?.target?.value) {
89
89
  setPaintProps((current) => ({ ...current, [key]: parseInt(ev.target.value) }));
90
90
  }
@@ -18,7 +18,7 @@ import Tooltip from '@mui/material/Tooltip';
18
18
  import LayerListItem from './LayerList/LayerListItem';
19
19
  import GpsFixedIcon from '@mui/icons-material/GpsFixed';
20
20
  import { Feature } from '@turf/turf';
21
- import { LngLatLike } from '!maplibre-gl';
21
+ import { LngLatLike } from 'maplibre-gl';
22
22
  import { SxProps } from '@mui/system/styleFunctionSx/styleFunctionSx';
23
23
 
24
24
  export interface MlSketchToolProps {