@mapcomponents/react-maplibre 0.1.63 → 0.1.64

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 (294) hide show
  1. package/.editorconfig +1 -1
  2. package/.eslintrc.js +9 -6
  3. package/.github/workflows/check-catalogue-metadata-schema.yml +19 -0
  4. package/CHANGELOG.md +27 -2
  5. package/coverage/clover.xml +671 -1032
  6. package/coverage/coverage-final.json +24 -21
  7. package/coverage/lcov-report/index.html +112 -82
  8. package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +24 -24
  9. package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
  10. package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +5 -5
  11. package/coverage/lcov-report/src/components/MlCenterPosition/index.html +1 -1
  12. package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +2 -2
  13. package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
  14. package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx.html +1 -1
  15. package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx.html +1 -1
  16. package/coverage/lcov-report/src/components/MlCreatePdfForm/index.html +1 -1
  17. package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +2 -5
  18. package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
  19. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
  20. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
  21. package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +1 -1
  22. package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
  23. package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +40 -19
  24. package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
  25. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js.html +1 -1
  26. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js.html +1 -1
  27. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx.html +112 -0
  28. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx.html +115 -0
  29. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/index.html +34 -4
  30. package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.tsx.html +1 -1
  31. package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/index.html +1 -1
  32. package/coverage/lcov-report/src/components/MlGpxViewer/MlGpxViewer.tsx.html +394 -0
  33. package/coverage/lcov-report/src/components/{MlGPXViewer → MlGpxViewer}/index.html +23 -38
  34. package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +63 -285
  35. package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +21 -21
  36. package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
  37. package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
  38. package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +58 -76
  39. package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
  40. package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +58 -61
  41. package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +11 -11
  42. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
  43. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +30 -21
  44. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
  45. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
  46. package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
  47. package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
  48. package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
  49. package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
  50. package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
  51. package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
  52. package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +1 -1
  53. package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
  54. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
  55. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +1 -1
  56. package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
  57. package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
  58. package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
  59. package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
  60. package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
  61. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/ColorPicker.tsx.html +1 -1
  62. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerList.tsx.html +1 -1
  63. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerListItem.tsx.html +1 -1
  64. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx.html +1 -1
  65. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/index.html +1 -1
  66. package/coverage/lcov-report/src/components/MlSketchTool/MlSketchTool.tsx.html +1 -1
  67. package/coverage/lcov-report/src/components/MlSketchTool/index.html +1 -1
  68. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx.html +514 -0
  69. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +21 -21
  70. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
  71. package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
  72. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +20 -206
  73. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
  74. package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
  75. package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
  76. package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +10 -7
  77. package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +5 -5
  78. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
  79. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
  80. package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +111 -57
  81. package/coverage/lcov-report/src/components/MlWmsLayer/index.html +19 -19
  82. package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +201 -144
  83. package/coverage/lcov-report/src/components/MlWmsLoader/index.html +9 -9
  84. package/coverage/lcov-report/src/contexts/MapContext.tsx.html +23 -23
  85. package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
  86. package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
  87. package/coverage/lcov-report/src/contexts/index.html +1 -1
  88. package/coverage/lcov-report/src/hooks/index.html +50 -50
  89. package/coverage/lcov-report/src/hooks/useCameraFollowPath/index.html +1 -1
  90. package/coverage/lcov-report/src/hooks/useCameraFollowPath/useCameraFollowPath.tsx.html +1 -1
  91. package/coverage/lcov-report/src/hooks/useExportMap/index.html +1 -1
  92. package/coverage/lcov-report/src/hooks/useExportMap/index.ts.html +1 -1
  93. package/coverage/lcov-report/src/hooks/useExportMap/lib.ts.html +1 -1
  94. package/coverage/lcov-report/src/hooks/useGpx/index.html +116 -0
  95. package/coverage/lcov-report/src/hooks/useGpx/useGpx.tsx.html +295 -0
  96. package/coverage/lcov-report/src/hooks/useLayer.ts.html +132 -66
  97. package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +1 -1
  98. package/coverage/lcov-report/src/hooks/useLayerHoverPopup/index.html +116 -0
  99. package/coverage/lcov-report/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx.html +331 -0
  100. package/coverage/lcov-report/src/hooks/useMap.ts.html +47 -47
  101. package/coverage/lcov-report/src/hooks/useMapState.ts.html +54 -54
  102. package/coverage/lcov-report/src/hooks/useSource.ts.html +57 -57
  103. package/coverage/lcov-report/src/hooks/{useWms.js.html → useWms.ts.html} +54 -15
  104. package/coverage/lcov-report/src/index.html +1 -1
  105. package/coverage/lcov-report/src/index.ts.html +6 -6
  106. package/coverage/lcov.info +1284 -1959
  107. package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +51 -25
  108. package/dist/components/MlCenterPosition/MlCenterPosition.d.ts +3 -2
  109. package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +35 -16
  110. package/dist/components/MlComponentTemplate/MlComponentTemplate.d.ts +1 -1
  111. package/dist/components/MlComponentTemplate/MlComponentTemplate.stories.d.ts +12 -9
  112. package/dist/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +1 -1
  113. package/dist/components/MlCreatePdfButton/MlCreatePdfButton.stories.d.ts +12 -9
  114. package/dist/components/MlGPXViewer/util/GeoJsonContext.d.ts +1 -1
  115. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +22 -11
  116. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +4 -95
  117. package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.d.ts +3 -0
  118. package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.d.ts +3 -0
  119. package/dist/components/MlGpxViewer/MlGpxViewer.d.ts +30 -0
  120. package/dist/components/MlGpxViewer/MlGpxViewer.stories.d.ts +17 -0
  121. package/dist/components/MlGpxViewer/MlGpxViewer.test.d.ts +1 -0
  122. package/dist/components/MlGpxViewer/util/GeoJsonContext.d.ts +10 -0
  123. package/dist/components/MlGpxViewer/util/GeoJsonProvider.d.ts +4 -0
  124. package/dist/components/MlGpxViewer/util/MetadataDrawer.d.ts +7 -0
  125. package/dist/components/MlGpxViewer/util/MlGpxDemoLoader.d.ts +10 -0
  126. package/dist/components/MlGpxViewer/util/MlGpxViewerInstructions.d.ts +3 -0
  127. package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +11 -2
  128. package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.d.ts +7 -9
  129. package/dist/components/MlLayerMagnify/MlLayerMagnify.d.ts +8 -2
  130. package/dist/components/MlLayerMagnify/MlLayerMagnify.stories.d.ts +13 -9
  131. package/dist/components/MlLayerSwipe/MlLayerSwipe.d.ts +13 -3
  132. package/dist/components/MlLayerSwipe/MlLayerSwipe.stories.d.ts +12 -10
  133. package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +33 -14
  134. package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.d.ts +18 -15
  135. package/dist/components/MlSpatialElevationProfile/util/getElevationData.d.ts +14 -0
  136. package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +3 -67
  137. package/dist/components/MlWmsLayer/MlWmsLayer.d.ts +7 -4
  138. package/dist/components/MlWmsLoader/MlWmsLoader.d.ts +17 -10
  139. package/dist/components/MlWmsLoader/MlWmsLoader.stories.d.ts +23 -12
  140. package/dist/components/MlWmsLoader/utils/MlWmsLoaderInstructions.d.ts +3 -0
  141. package/dist/components/MlWmsLoader/utils/WMSLinks.d.ts +6 -0
  142. package/dist/decorators/ThemeWrapper.d.ts +3 -1
  143. package/dist/hooks/useGpx/lib/gpxConverter.d.ts +11 -0
  144. package/dist/hooks/useGpx/useGpx.d.ts +26 -0
  145. package/dist/hooks/useGpx/useGpx.stories.d.ts +10 -0
  146. package/dist/hooks/useLayer.d.ts +13 -7
  147. package/dist/hooks/useLayerHoverPopup/useLayerHoverPopup.d.ts +23 -0
  148. package/dist/hooks/useLayerHoverPopup/useLayerHoverPopup.stories.d.ts +10 -0
  149. package/dist/hooks/useMap.d.ts +1 -1
  150. package/dist/hooks/useMap.test.d.ts +1 -0
  151. package/dist/hooks/useSource.d.ts +2 -2
  152. package/dist/hooks/useWms.d.ts +24 -16
  153. package/dist/index.d.ts +5 -5
  154. package/dist/index.esm.js +9310 -14006
  155. package/dist/index.esm.js.map +1 -1
  156. package/dist/setupTests.d.ts +6 -5
  157. package/dist/ui_components/Dropzone.d.ts +5 -0
  158. package/dist/ui_components/ImageLoader.d.ts +8 -1
  159. package/dist/ui_components/LoadingOverlayContext.d.ts +11 -11
  160. package/dist/ui_components/Sidebar.d.ts +7 -6
  161. package/dist/ui_components/Tooltip.d.ts +1 -1
  162. package/dist/ui_components/TopToolbar.d.ts +4 -3
  163. package/dist/ui_components/UploadButton.d.ts +6 -0
  164. package/dist/util/BubbleForInstructions.d.ts +2 -0
  165. package/dist/util/Instructions.d.ts +13 -0
  166. package/package.json +195 -191
  167. package/{src/components/MlImageMarkerLayer → public}/assets/wg-marker.png +0 -0
  168. package/scripts/build-catalogue-meta.js +35 -11
  169. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +230 -188
  170. package/src/components/MlCenterPosition/MlCenterPosition.meta_.json +1 -2
  171. package/src/components/MlCenterPosition/MlCenterPosition.stories.tsx +20 -0
  172. package/src/components/MlCenterPosition/MlCenterPosition.tsx +4 -4
  173. package/src/components/MlComponentTemplate/MlComponentTemplate.meta_.json +1 -2
  174. package/src/components/MlComponentTemplate/{MlComponentTemplate.stories.js → MlComponentTemplate.stories.tsx} +2 -2
  175. package/src/components/MlComponentTemplate/MlComponentTemplate.tsx +1 -1
  176. package/src/components/MlCreatePdfButton/MlCreatePdfButton.meta_.json +1 -2
  177. package/src/components/MlCreatePdfButton/{MlCreatePdfButton.stories.js → MlCreatePdfButton.stories.tsx} +1 -1
  178. package/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx +1 -1
  179. package/src/components/MlCreatePdfForm/MlCreatePdfForm.meta.json +1 -2
  180. package/src/components/MlCreatePdfForm/lib/PdfForm.tsx +25 -2
  181. package/src/components/MlFeatureEditor/MlFeatureEditor.meta.json +1 -2
  182. package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +0 -1
  183. package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.meta.json +1 -2
  184. package/src/components/MlFollowGps/MlFollowGps.meta.json +1 -2
  185. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.meta.json +1 -2
  186. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.tsx +89 -0
  187. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +24 -17
  188. package/src/components/MlGeoJsonLayer/assets/earthquake.json +109937 -0
  189. package/src/components/MlGeoJsonLayer/assets/wg_locations.json +65 -0
  190. package/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx +9 -0
  191. package/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx +10 -0
  192. package/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.meta_.json +1 -2
  193. package/src/components/{MlGPXViewer/MlGPXViewer.doc.de.md → MlGpxViewer/MlGpxViewer.doc.de.md} +0 -0
  194. package/src/components/{MlGPXViewer/MlGPXViewer.doc.en.md → MlGpxViewer/MlGpxViewer.doc.en.md} +0 -0
  195. package/src/components/{MlGPXViewer/MlGPXViewer.meta.json → MlGpxViewer/MlGpxViewer.meta.json} +2 -3
  196. package/src/components/MlGpxViewer/MlGpxViewer.stories.tsx +109 -0
  197. package/src/components/MlGpxViewer/MlGpxViewer.test.js +53 -0
  198. package/src/components/MlGpxViewer/MlGpxViewer.tsx +103 -0
  199. package/src/components/{MlGPXViewer → MlGpxViewer}/util/GeoJsonContext.ts +0 -0
  200. package/src/components/{MlGPXViewer → MlGpxViewer}/util/GeoJsonProvider.tsx +0 -0
  201. package/src/components/MlGpxViewer/util/MetadataDrawer.tsx +38 -0
  202. package/src/components/MlGpxViewer/util/MlGpxDemoLoader.tsx +128 -0
  203. package/src/components/MlGpxViewer/util/MlGpxViewerInstructions.tsx +68 -0
  204. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.meta_.json +1 -2
  205. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.tsx +41 -0
  206. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.test.js +27 -8
  207. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx +41 -115
  208. package/src/components/MlLayer/MlLayer.meta_.json +1 -2
  209. package/src/components/MlLayerMagnify/MlLayerMagnify.meta.json +1 -2
  210. package/src/components/MlLayerMagnify/MlLayerMagnify.stories.tsx +44 -0
  211. package/src/components/MlLayerMagnify/{MlLayerMagnify.test.js → MlLayerMagnify.test.tsx} +15 -18
  212. package/src/components/MlLayerMagnify/MlLayerMagnify.tsx +55 -61
  213. package/src/components/MlLayerSwipe/MlLayerSwipe.meta.json +1 -2
  214. package/src/components/MlLayerSwipe/{MlLayerSwipe.stories.js → MlLayerSwipe.stories.tsx} +9 -11
  215. package/src/components/MlLayerSwipe/MlLayerSwipe.tsx +47 -48
  216. package/src/components/MlLayerSwitcher/MlLayerSwitcher.meta_.json +1 -2
  217. package/src/components/MlLayerSwitcher/components/LayerBox.js +22 -19
  218. package/src/components/MlMarker/MlMarker.meta_.json +1 -2
  219. package/src/components/MlMeasureTool/MlMeasureTool.meta.json +1 -2
  220. package/src/components/MlNavigationCompass/MlNavigationCompass.meta.json +1 -2
  221. package/src/components/MlNavigationTools/MlNavigationTools.meta.json +1 -2
  222. package/src/components/MlScaleReference/MlScaleReference.meta.json +1 -2
  223. package/src/components/MlShareMapState/MlShareMapState.meta_.json +1 -2
  224. package/src/components/MlSketchTool/MlSketchTool.meta.json +1 -2
  225. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.meta.json +1 -2
  226. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.tsx +121 -0
  227. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.test.js +30 -1
  228. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx +143 -0
  229. package/src/components/MlSpatialElevationProfile/util/getElevationData.tsx +103 -0
  230. package/src/components/MlThreeJsLayer/MlThreeJsLayer.meta.json +1 -2
  231. package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.meta.json +1 -2
  232. package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.stories.js +2 -3
  233. package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx +17 -79
  234. package/src/components/MlUseMapDebugger/MlUseMapDebugger.meta_.json +1 -2
  235. package/src/components/MlVectorTileLayer/MlVectorTileLayer.meta.json +1 -2
  236. package/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx +3 -2
  237. package/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.meta_.json +1 -2
  238. package/src/components/MlWmsLayer/MlWmsLayer.tsx +59 -41
  239. package/src/components/MlWmsLoader/MlWmsLoader.meta.json +1 -2
  240. package/src/components/MlWmsLoader/MlWmsLoader.stories.tsx +89 -0
  241. package/src/components/MlWmsLoader/MlWmsLoader.tsx +141 -122
  242. package/src/components/MlWmsLoader/utils/MlWmsLoaderInstructions.tsx +50 -0
  243. package/src/components/MlWmsLoader/utils/WMSLinks.tsx +128 -0
  244. package/src/decorators/MapContextDecorator.js +1 -1
  245. package/src/decorators/MapContextDecoratorHooks.js +1 -1
  246. package/src/decorators/ThemeWrapper.tsx +9 -0
  247. package/src/hooks/useCameraFollowPath/useCameraFollowPath.meta.json +1 -2
  248. package/src/{components/MlGPXViewer → hooks/useGpx/lib}/gpxConverter.js +1 -0
  249. package/src/hooks/useGpx/useGpx.doc.de.md +3 -0
  250. package/src/hooks/useGpx/useGpx.meta_.json +15 -0
  251. package/src/{components/MlCenterPosition/MlCenterPosition.stories.js → hooks/useGpx/useGpx.stories.js} +4 -5
  252. package/src/hooks/useGpx/useGpx.tsx +70 -0
  253. package/src/hooks/useLayer.ts +32 -10
  254. package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.doc.de.md +3 -0
  255. package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.meta_.json +15 -0
  256. package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.stories.js +20 -0
  257. package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx +82 -0
  258. package/src/hooks/useMap.test.tsx +48 -0
  259. package/src/hooks/useMap.ts +8 -8
  260. package/src/hooks/useSource.ts +4 -4
  261. package/src/hooks/{useWms.js → useWms.ts} +24 -11
  262. package/src/index.ts +5 -5
  263. package/src/setupTests.js +18 -15
  264. package/src/ui_components/Dropzone.tsx +104 -0
  265. package/src/ui_components/{ImageLoader.js → ImageLoader.tsx} +30 -25
  266. package/src/ui_components/{LoadingOverlayContext.js → LoadingOverlayContext.tsx} +12 -15
  267. package/src/ui_components/Sidebar.tsx +12 -10
  268. package/src/ui_components/Tooltip.tsx +17 -0
  269. package/src/ui_components/TopToolbar.tsx +5 -3
  270. package/src/ui_components/UploadButton.tsx +57 -0
  271. package/src/util/BubbleForInstructions.js +46 -0
  272. package/src/util/Instructions.tsx +60 -0
  273. package/tsconfig.json +1 -1
  274. package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.tsx.html +0 -1222
  275. package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +0 -1645
  276. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +0 -757
  277. package/dist/components/MlGPXViewer/util/MlGPXViewerInstructions.d.ts +0 -1
  278. package/dist/components/MlGPXViewer/util/SampleLayer.d.ts +0 -0
  279. package/dist/components/MlGPXViewer/util/demoViewer.d.ts +0 -5
  280. package/src/components/MlGPXViewer/MlGPXViewer.stories.js +0 -91
  281. package/src/components/MlGPXViewer/MlGPXViewer.test.js +0 -28
  282. package/src/components/MlGPXViewer/MlGPXViewer.tsx +0 -379
  283. package/src/components/MlGPXViewer/util/MlGPXViewerInstructions.js +0 -145
  284. package/src/components/MlGPXViewer/util/SampleLayer.js +0 -2
  285. package/src/components/MlGPXViewer/util/demoViewer.js +0 -254
  286. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.js +0 -45
  287. package/src/components/MlLayerMagnify/MlLayerMagnify.stories.js +0 -41
  288. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js +0 -224
  289. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.js +0 -57
  290. package/src/components/MlWmsLoader/MlWmsLoader.stories.js +0 -47
  291. package/src/decorators/ThemeWrapper.jsx +0 -9
  292. package/src/ui_components/Legend.js +0 -44
  293. package/src/ui_components/LoadingOverlay.js +0 -41
  294. package/src/ui_components/Tooltip.js +0 -21
@@ -10,6 +10,5 @@
10
10
  },
11
11
  "tags": [],
12
12
  "category": "",
13
- "type": "component",
14
- "price": 0
13
+ "type": "component"
15
14
  }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ import MlCenterPosition from './MlCenterPosition';
4
+
5
+ import mapContextDecorator from '../../decorators/MapContextDecorator';
6
+
7
+ const storyoptions = {
8
+ title: 'MapComponents/MlCenterPosition',
9
+ component: MlCenterPosition,
10
+ argTypes: {},
11
+ decorators: mapContextDecorator,
12
+ parameters: { docs: { source: { type: 'code' } } },
13
+ };
14
+ export default storyoptions;
15
+
16
+ const Template = () => <MlCenterPosition />;
17
+
18
+ export const ExampleConfig = Template.bind({});
19
+ ExampleConfig.parameters = {};
20
+ ExampleConfig.args = {};
@@ -1,9 +1,9 @@
1
1
  import React, { useState, useCallback } from "react";
2
2
  import useMap from "../../hooks/useMap";
3
- import { Button } from "@mui/material";
3
+ import { Button, SxProps, Theme } from "@mui/material";
4
4
  import GpsFixedIcon from "@mui/icons-material/GpsFixed";
5
5
 
6
- interface MlCenterPositionProps {
6
+ export interface MlCenterPositionProps {
7
7
  /**
8
8
  * Id of the target MapLibre instance in mapContext
9
9
  */
@@ -24,7 +24,7 @@ interface MlCenterPositionProps {
24
24
  /**
25
25
  * CSS style object that is applied to the button component
26
26
  */
27
- style?: any;
27
+ style?: SxProps<Theme> | undefined;
28
28
  }
29
29
 
30
30
  /**
@@ -58,7 +58,7 @@ const MlCenterPosition = (props: MlCenterPositionProps) => {
58
58
  ...props.style,
59
59
  }}
60
60
  onClick={centerCurrentLocation} disabled={locationAccessDenied}>
61
- <GpsFixedIcon sx={{ ...(props.style?.fontSize?{fontSize: props.style?.fontSize}:{}) }} />{" "}
61
+ <GpsFixedIcon sx={{ ...(props.style?.['fontSize']?{fontSize: props.style?.['fontSize']}:{}) }} />{" "}
62
62
  </Button>
63
63
  </>;
64
64
 
@@ -10,6 +10,5 @@
10
10
  },
11
11
  "tags": [],
12
12
  "category": "",
13
- "type": "component",
14
- "price": 0
13
+ "type": "component"
15
14
  }
@@ -13,8 +13,8 @@ const storyoptions = {
13
13
  };
14
14
  export default storyoptions;
15
15
 
16
- const Template = (args) => <MlComponentTemplate />;
16
+ const Template = () => <MlComponentTemplate />;
17
17
 
18
18
  export const ExampleConfig = Template.bind({});
19
19
  ExampleConfig.parameters = {};
20
- ExampleConfig.args = {};
20
+ ExampleConfig.args = {};
@@ -1,7 +1,7 @@
1
1
  import React, { useRef, useEffect } from "react";
2
2
  import useMap from "../../hooks/useMap";
3
3
 
4
- interface MlComponentTemplateProps {
4
+ export interface MlComponentTemplateProps {
5
5
  /**
6
6
  * Id of the target MapLibre instance in mapContext
7
7
  */
@@ -10,6 +10,5 @@
10
10
  },
11
11
  "tags": ["Map add-on"],
12
12
  "category": "add-ons",
13
- "type": "component",
14
- "price": 5000
13
+ "type": "component"
15
14
  }
@@ -15,7 +15,7 @@ const storyoptions = {
15
15
  };
16
16
  export default storyoptions;
17
17
 
18
- const Template = (args) => (
18
+ const Template = () => (
19
19
  <TopToolbar>
20
20
  <MlCreatePdfButton />
21
21
  </TopToolbar>
@@ -6,7 +6,7 @@ import createPdf from "./lib/createPdf";
6
6
  import PrinterIcon from "@mui/icons-material/Print";
7
7
  import Button from "@mui/material/Button";
8
8
 
9
- interface MlCreatePdfButtonProps {
9
+ export interface MlCreatePdfButtonProps {
10
10
  /**
11
11
  * Id of the target MapLibre instance in mapContext
12
12
  */
@@ -10,6 +10,5 @@
10
10
  },
11
11
  "tags": [],
12
12
  "category": "",
13
- "type": "component",
14
- "price": 0
13
+ "type": "component"
15
14
  }
@@ -1,4 +1,4 @@
1
- import React, { useContext, useMemo, useCallback } from 'react';
1
+ import React, { useContext, useMemo, useCallback, useState } from 'react';
2
2
  import PdfContext from './PdfContext';
3
3
  import PdfPreview from './PdfPreview';
4
4
  import {
@@ -11,6 +11,7 @@ import {
11
11
  FormControlLabel,
12
12
  Radio,
13
13
  RadioGroup,
14
+ CircularProgress,
14
15
  } from '@mui/material';
15
16
 
16
17
  import useMap from '../../../hooks/useMap';
@@ -84,6 +85,7 @@ interface PdfFormProps {
84
85
  }
85
86
 
86
87
  export default function PdfForm(props: PdfFormProps) {
88
+ const [loading, setLoading] = useState(false);
87
89
  const pdfContext = useContext(PdfContext);
88
90
  const mapHook = useMap({
89
91
  // eslint-disable-next-line react/prop-types
@@ -101,6 +103,7 @@ export default function PdfForm(props: PdfFormProps) {
101
103
  pdfContext.geojsonRef?.current?.bbox &&
102
104
  pdfContext.geojsonRef?.current
103
105
  ) {
106
+ setLoading(true);
104
107
  const bbox = turf.bbox(pdfContext.geojsonRef.current);
105
108
 
106
109
  mapExporter
@@ -118,10 +121,12 @@ export default function PdfForm(props: PdfFormProps) {
118
121
  if (typeof props.onCreatePdf === 'function') {
119
122
  props.onCreatePdf(res);
120
123
  }
124
+ setLoading(false);
121
125
  return res.downloadPdf();
122
126
  })
123
127
  .catch((error) => {
124
128
  console.log(error);
129
+ setLoading(false);
125
130
  });
126
131
  }
127
132
  }, [mapHook.map, pdfContext]);
@@ -218,9 +223,27 @@ export default function PdfForm(props: PdfFormProps) {
218
223
  </Select>
219
224
  </FormControl>
220
225
  <FormControl fullWidth sx={formControlStyles}>
221
- <Button variant="contained" className='createPdfButton' onClick={createPdfHandler}>
226
+ <Button
227
+ variant="contained"
228
+ className="createPdfButton"
229
+ onClick={createPdfHandler}
230
+ disabled={loading}
231
+ >
222
232
  PDF erstellen
223
233
  </Button>
234
+ {loading && (
235
+ <CircularProgress
236
+ size={24}
237
+ sx={{
238
+ color: 'primary.main',
239
+ position: 'absolute',
240
+ top: '50%',
241
+ left: '50%',
242
+ marginTop: '-12px',
243
+ marginLeft: '-12px',
244
+ }}
245
+ />
246
+ )}
224
247
  </FormControl>
225
248
  {pdfContext.options && pdfContext.setOptions && (
226
249
  <PdfPreview
@@ -10,6 +10,5 @@
10
10
  },
11
11
  "tags": ["Map add-on"],
12
12
  "category": "add-ons",
13
- "type": "component",
14
- "price": 0
13
+ "type": "component"
15
14
  }
@@ -99,7 +99,6 @@ const MlFeatureEditor = (props: MlFeatureEditorProps) => {
99
99
  });
100
100
 
101
101
  mapHook.map.addControl(draw.current, 'top-left', mapHook.componentId);
102
-
103
102
  mapHook.map.on('draw.modechange', modeChangeHandler, mapHook.componentId);
104
103
 
105
104
  setDrawToolsReady(true);
@@ -10,6 +10,5 @@
10
10
  },
11
11
  "tags": ["Map add-on"],
12
12
  "category": "add-ons",
13
- "type": "component",
14
- "price": 5000
13
+ "type": "component"
15
14
  }
@@ -10,6 +10,5 @@
10
10
  },
11
11
  "tags": [],
12
12
  "category": "",
13
- "type": "component",
14
- "price": 0
13
+ "type": "component"
15
14
  }
@@ -10,6 +10,5 @@
10
10
  },
11
11
  "tags": [],
12
12
  "category": "",
13
- "type": "component",
14
- "price": 0
13
+ "type": "component"
15
14
  }
@@ -4,9 +4,14 @@ import useMap from '../../hooks/useMap';
4
4
  import mapContextDecorator from '../../decorators/MapContextDecorator';
5
5
  import PolygonStyler from './story_utils/MlGeoJsonLayer.polygonStyler';
6
6
  import LineStyler from './story_utils/MlGeoJsonLayer.lineStyler';
7
+ import HeatMapStyler from './story_utils/MlGeojsonLayerHeatMapStyler';
7
8
  import sample_geojson_1 from './assets/sample_1.json';
8
9
  import sample_geojson_2 from './assets/sample_2.json';
10
+ import earthquakes from './assets/earthquake.json';
11
+ import wg_locations from './assets/wg_locations.json';
9
12
  import { GeoJSONObject } from '@turf/turf';
13
+ import { MlGeoJsonLayerProps } from './MlGeoJsonLayer';
14
+ import CircleMapStyler from './story_utils/MlGeojsonLayerCircleStyler';
10
15
 
11
16
  const storyoptions = {
12
17
  title: 'MapComponents/MlGeoJsonLayer',
@@ -65,6 +70,39 @@ const PolygonTemplate = (props: TemplateProps) => {
65
70
  );
66
71
  };
67
72
 
73
+ const HeatmapTemplate = (props: MlGeoJsonLayerProps) => {
74
+ const mapHook = useMap({
75
+ mapId: undefined,
76
+ });
77
+
78
+ const initializedRef = useRef(false);
79
+
80
+ useEffect(() => {
81
+ if (!mapHook.map || initializedRef.current) return;
82
+
83
+ initializedRef.current = true;
84
+ mapHook.map.map.flyTo({ center: [-150.4048, 63.1224], zoom: 3 });
85
+ }, [mapHook.map]);
86
+
87
+ return <HeatMapStyler {...props} />;
88
+ };
89
+ const CircleTemplate = (props: MlGeoJsonLayerProps) => {
90
+ const mapHook = useMap({
91
+ mapId: undefined,
92
+ });
93
+
94
+ const initializedRef = useRef(false);
95
+
96
+ useEffect(() => {
97
+ if (!mapHook.map || initializedRef.current) return;
98
+
99
+ initializedRef.current = true;
100
+ mapHook.map.map.flyTo({ center: [10.251805123900311, 51.11826171422632], zoom: 5 });
101
+ }, [mapHook.map]);
102
+
103
+ return <CircleMapStyler {...props} />;
104
+ };
105
+
68
106
  export const Linestring = Template.bind({});
69
107
  Linestring.parameters = {};
70
108
  Linestring.args = {
@@ -100,3 +138,54 @@ DefaultPaintOverrides.args = {
100
138
  geojson: sample_geojson_1,
101
139
  type: '',
102
140
  };
141
+
142
+ export const HeatMapEarthquakes = HeatmapTemplate.bind({});
143
+ HeatMapEarthquakes.parameters = {};
144
+ HeatMapEarthquakes.args = {
145
+ geojson: earthquakes,
146
+ options: {
147
+ // paint examples copied from https://maplibre.org/maplibre-gl-js-docs/example/heatmap-layer/
148
+ paint: {
149
+ // Increase the heatmap weight based on frequency and property magnitude
150
+ 'heatmap-weight': ['interpolate', ['linear'], ['get', 'mag'], 0, 0, 6, 1],
151
+ // Increase the heatmap color weight by zoom level
152
+ // heatmap-intensity is a multiplier on top of heatmap-weight
153
+ 'heatmap-intensity': ['interpolate', ['linear'], ['zoom'], 0, 1, 9, 3],
154
+ // Color ramp for heatmap. Domain is 0 (low) to 1 (high).
155
+ // Begin color ramp at 0-stop with a 0-transparancy color
156
+ // to create a blur-like effect.
157
+ 'heatmap-color': [
158
+ 'interpolate',
159
+ ['linear'],
160
+ ['heatmap-density'],
161
+ 0,
162
+ 'rgba(33,102,172,0)',
163
+ 0.2,
164
+ 'rgb(103,169,207)',
165
+ 0.4,
166
+ 'rgb(209,229,240)',
167
+ 0.6,
168
+ 'rgb(253,219,199)',
169
+ 0.8,
170
+ 'rgb(239,138,98)',
171
+ 1,
172
+ 'rgb(178,24,43)',
173
+ ],
174
+ // Adjust the heatmap radius by zoom level
175
+ 'heatmap-radius': ['interpolate', ['linear'], ['zoom'], 0, 2, 9, 20],
176
+ // Transition from heatmap to circle layer by zoom level
177
+ 'heatmap-opacity': ['interpolate', ['linear'], ['zoom'], 7, 1, 9, 0],
178
+ },
179
+ },
180
+ type: 'heatmap',
181
+ };
182
+ export const CircleMapWheregroupLocations = CircleTemplate.bind({});
183
+ CircleMapWheregroupLocations.parameters = {};
184
+ CircleMapWheregroupLocations.args = {
185
+ geojson: wg_locations,
186
+ paint: {
187
+ 'circle-radius': ['/', ['get', 'Mitarbeitende'], 1.2],
188
+ 'circle-color': '#B11E40',
189
+ },
190
+ type: 'circle',
191
+ };
@@ -7,16 +7,17 @@ import { v4 as uuidv4 } from 'uuid';
7
7
  import getDefaultPaintPropsByType from './util/getDefaultPaintPropsByType';
8
8
  import getDefaulLayerTypeByGeometry from './util/getDefaultLayerTypeByGeometry';
9
9
  import { Feature, FeatureCollection } from '@turf/turf';
10
+ import { useLayerProps } from '../../hooks/useLayer';
10
11
 
11
12
  import {
12
13
  LineLayerSpecification,
13
14
  CircleLayerSpecification,
14
15
  FillLayerSpecification,
15
- MapLayerMouseEvent,
16
16
  LayerSpecification,
17
+ RasterLayerSpecification,
17
18
  } from 'maplibre-gl';
18
19
 
19
- type MlGeoJsonLayerProps = {
20
+ export type MlGeoJsonLayerProps = {
20
21
  /**
21
22
  * Id of the target MapLibre instance in mapContext
22
23
  */
@@ -38,35 +39,41 @@ type MlGeoJsonLayerProps = {
38
39
  geojson: Feature | FeatureCollection | undefined;
39
40
  /**
40
41
  * Type of the layer that will be added to the MapLibre instance.
41
- * Possible values: "line", "circle", "fill"
42
+ * All types from LayerSpecification union type are supported except the type from
43
+ * RasterLayerSpecification
42
44
  */
43
- type?: 'fill' | 'line' | 'circle';
45
+ type?: Exclude<LayerSpecification['type'], RasterLayerSpecification['type']>;
44
46
  /**
45
47
  * Paint property object, that is passed to the addLayer call.
46
48
  * Possible props depend on the layer type.
49
+ * See https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/
50
+ * Some examples are:
47
51
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line
48
52
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
49
53
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
54
+ * All paint types from LayerSpecification union type are supported except the paint type from
55
+ * RasterLayerSpecification
50
56
  */
51
- paint?:
52
- | CircleLayerSpecification['paint']
53
- | FillLayerSpecification['paint']
54
- | LineLayerSpecification['paint'];
57
+
58
+ paint?: Exclude<LayerSpecification['paint'], RasterLayerSpecification['paint']>;
55
59
  /**
56
60
  * Layout property object, that is passed to the addLayer call.
57
61
  * Possible props depend on the layer type.
62
+ * See https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/
63
+ * Some examples are:
58
64
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line
59
65
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
60
66
  * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
67
+ * All layout types from LayerSpecification union type are supported except the layout type from
68
+ * RasterLayerSpecification
69
+
61
70
  */
62
- layout?:
63
- | CircleLayerSpecification['layout']
64
- | FillLayerSpecification['layout']
65
- | LineLayerSpecification['layout'];
71
+ layout?: Exclude<LayerSpecification['layout'], RasterLayerSpecification['layout']>;
72
+
66
73
  /**
67
74
  * Javascript object that is spread into the addLayer commands first parameter.
68
75
  */
69
- options?: CircleLayerSpecification | FillLayerSpecification | LineLayerSpecification;
76
+ options?: Exclude<LayerSpecification, RasterLayerSpecification>;
70
77
  /**
71
78
  * Javascript object with optional properties "fill", "line", "circle" to override implicit layer type default paint properties.
72
79
  */
@@ -78,20 +85,20 @@ type MlGeoJsonLayerProps = {
78
85
  /**
79
86
  * Hover event handler that is executed whenever a geometry rendered by this component is hovered.
80
87
  */
81
- onHover?: MapLayerMouseEvent;
88
+ onHover?: useLayerProps['onHover'];
82
89
  /**
83
90
  * Click event handler that is executed whenever a geometry rendered by this component is clicked.
84
91
  */
85
- onClick?: MapLayerMouseEvent;
92
+ onClick?: useLayerProps['onClick'];
86
93
  /**
87
94
  * Leave event handler that is executed whenever a geometry rendered by this component is
88
95
  * left/unhovered.
89
96
  */
90
- onLeave?: MapLayerMouseEvent;
97
+ onLeave?: useLayerProps['onLeave'];
91
98
  };
92
99
 
93
100
  /**
94
- * Adds source and layer of types "line", "fill" or "circle" to display GeoJSON data on the map.
101
+ * Adds source and layer to display GeoJSON data on the map.
95
102
  *
96
103
  * @component
97
104
  */