@mapcomponents/react-maplibre 0.1.62 → 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 (340) hide show
  1. package/.babelrc +21 -2
  2. package/.editorconfig +1 -1
  3. package/.eslintrc.js +11 -1
  4. package/.github/workflows/check-catalogue-metadata-schema.yml +19 -0
  5. package/.storybook/main.js +0 -1
  6. package/.storybook/preview.js +0 -2
  7. package/CHANGELOG.md +43 -0
  8. package/coverage/clover.xml +864 -1037
  9. package/coverage/coverage-final.json +32 -21
  10. package/coverage/lcov-report/favicon.png +0 -0
  11. package/coverage/lcov-report/index.html +170 -95
  12. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  13. package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +24 -24
  14. package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
  15. package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +5 -5
  16. package/coverage/lcov-report/src/components/MlCenterPosition/index.html +1 -1
  17. package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +2 -2
  18. package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
  19. package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx.html +148 -0
  20. package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx.html +1 -1
  21. package/coverage/lcov-report/src/components/MlCreatePdfForm/index.html +22 -7
  22. package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +72 -42
  23. package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +15 -15
  24. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
  25. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
  26. package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +1 -1
  27. package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
  28. package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +86 -35
  29. package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
  30. package/coverage/lcov-report/src/components/{MlSpatialElevationProfile/MlSpatialElevationProfile.js.html → MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js.html} +215 -320
  31. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js.html +649 -0
  32. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx.html +112 -0
  33. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx.html +115 -0
  34. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/index.html +161 -0
  35. package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.tsx.html +1 -1
  36. package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/index.html +1 -1
  37. package/coverage/lcov-report/src/components/MlGpxViewer/MlGpxViewer.tsx.html +394 -0
  38. package/coverage/lcov-report/src/components/MlGpxViewer/index.html +116 -0
  39. package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +63 -285
  40. package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +21 -21
  41. package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
  42. package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
  43. package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +58 -76
  44. package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
  45. package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +58 -61
  46. package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +11 -11
  47. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
  48. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +30 -21
  49. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
  50. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
  51. package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
  52. package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
  53. package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
  54. package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
  55. package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
  56. package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
  57. package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +1 -1
  58. package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
  59. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
  60. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +1 -1
  61. package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
  62. package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
  63. package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
  64. package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
  65. package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
  66. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/ColorPicker.tsx.html +214 -0
  67. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerList.tsx.html +121 -0
  68. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerListItem.tsx.html +412 -0
  69. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx.html +463 -0
  70. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/index.html +161 -0
  71. package/coverage/lcov-report/src/components/{MlGPXViewer/MlGPXViewer.tsx.html → MlSketchTool/MlSketchTool.tsx.html} +271 -589
  72. package/coverage/lcov-report/src/components/{MlGPXViewer → MlSketchTool}/index.html +22 -37
  73. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx.html +514 -0
  74. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +21 -21
  75. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
  76. package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
  77. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +20 -206
  78. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
  79. package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
  80. package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
  81. package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +10 -7
  82. package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +5 -5
  83. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
  84. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
  85. package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +111 -57
  86. package/coverage/lcov-report/src/components/MlWmsLayer/index.html +19 -19
  87. package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +201 -144
  88. package/coverage/lcov-report/src/components/MlWmsLoader/index.html +9 -9
  89. package/coverage/lcov-report/src/contexts/MapContext.tsx.html +23 -23
  90. package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
  91. package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
  92. package/coverage/lcov-report/src/contexts/index.html +1 -1
  93. package/coverage/lcov-report/src/hooks/index.html +50 -50
  94. package/coverage/lcov-report/src/hooks/useCameraFollowPath/index.html +1 -1
  95. package/coverage/lcov-report/src/hooks/useCameraFollowPath/useCameraFollowPath.tsx.html +1 -1
  96. package/coverage/lcov-report/src/hooks/useExportMap/index.html +1 -1
  97. package/coverage/lcov-report/src/hooks/useExportMap/index.ts.html +1 -1
  98. package/coverage/lcov-report/src/hooks/useExportMap/lib.ts.html +1 -1
  99. package/coverage/lcov-report/src/hooks/useGpx/index.html +116 -0
  100. package/coverage/lcov-report/src/hooks/useGpx/useGpx.tsx.html +295 -0
  101. package/coverage/lcov-report/src/hooks/useLayer.ts.html +132 -66
  102. package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +1 -1
  103. package/coverage/lcov-report/src/hooks/useLayerHoverPopup/index.html +116 -0
  104. package/coverage/lcov-report/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx.html +331 -0
  105. package/coverage/lcov-report/src/hooks/useMap.ts.html +47 -47
  106. package/coverage/lcov-report/src/hooks/useMapState.ts.html +54 -54
  107. package/coverage/lcov-report/src/hooks/useSource.ts.html +57 -57
  108. package/coverage/lcov-report/src/hooks/{useWms.js.html → useWms.ts.html} +54 -15
  109. package/coverage/lcov-report/src/index.html +1 -1
  110. package/coverage/lcov-report/src/index.ts.html +6 -6
  111. package/coverage/lcov.info +1724 -1974
  112. package/cypress/support/commands.ts +37 -0
  113. package/cypress/support/component-index.html +12 -0
  114. package/cypress/support/component.ts +46 -0
  115. package/cypress.config.ts +101 -0
  116. package/dist/components/MapLibreMap/MapLibreMap.d.ts +1 -1
  117. package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +53 -27
  118. package/dist/components/MlCenterPosition/MlCenterPosition.d.ts +3 -2
  119. package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +35 -16
  120. package/dist/components/MlComponentTemplate/MlComponentTemplate.d.ts +1 -1
  121. package/dist/components/MlComponentTemplate/MlComponentTemplate.stories.d.ts +12 -9
  122. package/dist/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +1 -1
  123. package/dist/components/MlCreatePdfButton/MlCreatePdfButton.stories.d.ts +12 -9
  124. package/dist/components/MlCreatePdfForm/MlCreatePdfForm.cy.d.ts +1 -0
  125. package/dist/components/MlCreatePdfForm/lib/PdfPreview.d.ts +1 -1
  126. package/dist/components/MlFeatureEditor/MlFeatureEditor.d.ts +10 -4
  127. package/dist/components/MlFeatureEditor/lib/double_click_zoom.d.ts +0 -2
  128. package/dist/components/MlFeatureEditor/lib/theme.d.ts +1 -1
  129. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +23 -12
  130. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +12 -11
  131. package/dist/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.d.ts +2 -0
  132. package/dist/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.d.ts +2 -0
  133. package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.d.ts +3 -0
  134. package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.d.ts +3 -0
  135. package/dist/components/MlGpxViewer/MlGpxViewer.d.ts +30 -0
  136. package/dist/components/MlGpxViewer/MlGpxViewer.stories.d.ts +17 -0
  137. package/dist/components/MlGpxViewer/MlGpxViewer.test.d.ts +1 -0
  138. package/dist/components/MlGpxViewer/util/GeoJsonContext.d.ts +10 -0
  139. package/dist/components/MlGpxViewer/util/GeoJsonProvider.d.ts +4 -0
  140. package/dist/components/MlGpxViewer/util/MetadataDrawer.d.ts +7 -0
  141. package/dist/components/MlGpxViewer/util/MlGpxDemoLoader.d.ts +10 -0
  142. package/dist/components/MlGpxViewer/util/MlGpxViewerInstructions.d.ts +3 -0
  143. package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +11 -2
  144. package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.d.ts +7 -9
  145. package/dist/components/MlLayerMagnify/MlLayerMagnify.d.ts +8 -2
  146. package/dist/components/MlLayerMagnify/MlLayerMagnify.stories.d.ts +13 -9
  147. package/dist/components/MlLayerSwipe/MlLayerSwipe.d.ts +13 -3
  148. package/dist/components/MlLayerSwipe/MlLayerSwipe.stories.d.ts +12 -10
  149. package/dist/components/MlSketchTool/LayerList/ColorPicker.d.ts +9 -0
  150. package/dist/components/MlSketchTool/LayerList/LayerList.d.ts +5 -0
  151. package/dist/components/MlSketchTool/LayerList/LayerListItem.d.ts +11 -0
  152. package/dist/components/MlSketchTool/LayerList/LayerPropertyForm.d.ts +9 -0
  153. package/dist/components/MlSketchTool/MlSketchTool.d.ts +29 -0
  154. package/dist/components/MlSketchTool/MlSketchTool.stories.d.ts +10 -0
  155. package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +33 -14
  156. package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.d.ts +18 -15
  157. package/dist/components/MlSpatialElevationProfile/util/getElevationData.d.ts +14 -0
  158. package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +3 -67
  159. package/dist/components/MlWmsLayer/MlWmsLayer.d.ts +7 -4
  160. package/dist/components/MlWmsLoader/MlWmsLoader.d.ts +17 -10
  161. package/dist/components/MlWmsLoader/MlWmsLoader.stories.d.ts +23 -12
  162. package/dist/components/MlWmsLoader/utils/MlWmsLoaderInstructions.d.ts +3 -0
  163. package/dist/components/MlWmsLoader/utils/WMSLinks.d.ts +6 -0
  164. package/dist/contexts/SimpleDataProvider.d.ts +1 -1
  165. package/dist/custom.d.d.ts +1 -1
  166. package/dist/decorators/ThemeWrapper.d.ts +3 -1
  167. package/dist/hooks/useGpx/lib/gpxConverter.d.ts +11 -0
  168. package/dist/hooks/useGpx/useGpx.d.ts +26 -0
  169. package/dist/hooks/useGpx/useGpx.stories.d.ts +10 -0
  170. package/dist/hooks/useLayer.d.ts +14 -8
  171. package/dist/hooks/useLayerHoverPopup/useLayerHoverPopup.d.ts +23 -0
  172. package/dist/hooks/useLayerHoverPopup/useLayerHoverPopup.stories.d.ts +10 -0
  173. package/dist/hooks/useMap.d.ts +2 -2
  174. package/dist/hooks/useMap.test.d.ts +1 -0
  175. package/dist/hooks/useMapState.d.ts +3 -3
  176. package/dist/hooks/useSource.d.ts +3 -3
  177. package/dist/hooks/useWms.d.ts +24 -16
  178. package/dist/index.d.ts +5 -5
  179. package/dist/index.esm.css +1 -1
  180. package/dist/index.esm.js +9327 -14844
  181. package/dist/index.esm.js.map +1 -1
  182. package/dist/setupTests.d.ts +6 -5
  183. package/dist/ui_components/Dropzone.d.ts +5 -0
  184. package/dist/ui_components/ImageLoader.d.ts +8 -1
  185. package/dist/ui_components/LoadingOverlayContext.d.ts +11 -11
  186. package/dist/ui_components/Sidebar.d.ts +10 -1
  187. package/dist/ui_components/Tooltip.d.ts +1 -1
  188. package/dist/ui_components/TopToolbar.d.ts +7 -1
  189. package/dist/ui_components/UploadButton.d.ts +6 -0
  190. package/dist/util/BubbleForInstructions.d.ts +2 -0
  191. package/dist/util/Instructions.d.ts +13 -0
  192. package/package.json +195 -185
  193. package/public/assets/sample1.gpx +3003 -0
  194. package/public/assets/sample2.gpx +1264 -0
  195. package/public/assets/sample3.gpx +912 -0
  196. package/{src/components/MlImageMarkerLayer → public}/assets/wg-marker.png +0 -0
  197. package/public/index.html +0 -4
  198. package/public/thumbnails/MlSketchTool.png +0 -0
  199. package/public/thumbnails/useCameraFollowPath.png +0 -0
  200. package/scripts/build-catalogue-meta.js +35 -11
  201. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +230 -188
  202. package/src/components/MlCenterPosition/MlCenterPosition.meta_.json +1 -2
  203. package/src/components/MlCenterPosition/MlCenterPosition.stories.tsx +20 -0
  204. package/src/components/MlCenterPosition/MlCenterPosition.tsx +4 -4
  205. package/src/components/MlComponentTemplate/MlComponentTemplate.meta_.json +1 -2
  206. package/src/components/MlComponentTemplate/{MlComponentTemplate.stories.js → MlComponentTemplate.stories.tsx} +2 -2
  207. package/src/components/MlComponentTemplate/MlComponentTemplate.tsx +1 -1
  208. package/src/components/MlCreatePdfButton/MlCreatePdfButton.meta_.json +1 -2
  209. package/src/components/MlCreatePdfButton/{MlCreatePdfButton.stories.js → MlCreatePdfButton.stories.tsx} +1 -1
  210. package/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx +1 -1
  211. package/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx +21 -0
  212. package/src/components/MlCreatePdfForm/MlCreatePdfForm.meta.json +1 -2
  213. package/src/components/MlCreatePdfForm/MlCreatePdfForm.stories.tsx +1 -3
  214. package/src/components/MlCreatePdfForm/lib/PdfForm.tsx +25 -2
  215. package/src/components/MlFeatureEditor/MlFeatureEditor.meta.json +2 -3
  216. package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +39 -29
  217. package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.meta.json +1 -2
  218. package/src/components/MlFollowGps/MlFollowGps.meta.json +1 -2
  219. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.meta.json +1 -2
  220. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.tsx +191 -0
  221. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +47 -30
  222. package/src/components/MlGeoJsonLayer/assets/earthquake.json +109937 -0
  223. package/src/components/MlGeoJsonLayer/assets/sample_1.json +138 -24
  224. package/src/components/MlGeoJsonLayer/assets/sample_2.json +140 -20
  225. package/src/components/MlGeoJsonLayer/assets/wg_locations.json +65 -0
  226. package/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js +189 -0
  227. package/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js +188 -0
  228. package/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx +9 -0
  229. package/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx +10 -0
  230. package/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.meta_.json +1 -2
  231. package/src/components/{MlGPXViewer/MlGPXViewer.doc.de.md → MlGpxViewer/MlGpxViewer.doc.de.md} +0 -0
  232. package/src/components/{MlGPXViewer/MlGPXViewer.doc.en.md → MlGpxViewer/MlGpxViewer.doc.en.md} +0 -0
  233. package/src/components/{MlGPXViewer/MlGPXViewer.meta.json → MlGpxViewer/MlGpxViewer.meta.json} +2 -3
  234. package/src/components/MlGpxViewer/MlGpxViewer.stories.tsx +109 -0
  235. package/src/components/MlGpxViewer/MlGpxViewer.test.js +53 -0
  236. package/src/components/MlGpxViewer/MlGpxViewer.tsx +103 -0
  237. package/src/components/{MlGPXViewer → MlGpxViewer}/util/GeoJsonContext.ts +0 -0
  238. package/src/components/{MlGPXViewer → MlGpxViewer}/util/GeoJsonProvider.tsx +0 -0
  239. package/src/components/MlGpxViewer/util/MetadataDrawer.tsx +38 -0
  240. package/src/components/MlGpxViewer/util/MlGpxDemoLoader.tsx +128 -0
  241. package/src/components/MlGpxViewer/util/MlGpxViewerInstructions.tsx +68 -0
  242. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.meta_.json +1 -2
  243. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.tsx +41 -0
  244. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.test.js +27 -8
  245. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx +41 -115
  246. package/src/components/MlLayer/MlLayer.meta_.json +1 -2
  247. package/src/components/MlLayerMagnify/MlLayerMagnify.meta.json +1 -2
  248. package/src/components/MlLayerMagnify/MlLayerMagnify.stories.tsx +44 -0
  249. package/src/components/MlLayerMagnify/{MlLayerMagnify.test.js → MlLayerMagnify.test.tsx} +15 -18
  250. package/src/components/MlLayerMagnify/MlLayerMagnify.tsx +55 -61
  251. package/src/components/MlLayerSwipe/MlLayerSwipe.meta.json +1 -2
  252. package/src/components/MlLayerSwipe/{MlLayerSwipe.stories.js → MlLayerSwipe.stories.tsx} +9 -11
  253. package/src/components/MlLayerSwipe/MlLayerSwipe.tsx +47 -48
  254. package/src/components/MlLayerSwitcher/MlLayerSwitcher.meta_.json +1 -2
  255. package/src/components/MlLayerSwitcher/components/LayerBox.js +22 -19
  256. package/src/components/MlMarker/MlMarker.meta_.json +1 -2
  257. package/src/components/MlMeasureTool/MlMeasureTool.meta.json +1 -2
  258. package/src/components/MlNavigationCompass/MlNavigationCompass.meta.json +1 -2
  259. package/src/components/MlNavigationTools/MlNavigationTools.meta.json +1 -2
  260. package/src/components/MlScaleReference/MlScaleReference.meta.json +1 -2
  261. package/src/components/MlShareMapState/MlShareMapState.meta_.json +1 -2
  262. package/src/components/MlSketchTool/LayerList/ColorPicker.tsx +43 -0
  263. package/src/components/MlSketchTool/LayerList/LayerList.tsx +12 -0
  264. package/src/components/MlSketchTool/LayerList/LayerListItem.tsx +109 -0
  265. package/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx +126 -0
  266. package/src/components/MlSketchTool/MlSketchTool.doc.de.md +3 -0
  267. package/src/components/MlSketchTool/MlSketchTool.meta.json +14 -0
  268. package/src/components/MlSketchTool/MlSketchTool.stories.js +26 -0
  269. package/src/components/MlSketchTool/MlSketchTool.tsx +271 -0
  270. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.meta.json +1 -2
  271. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.tsx +121 -0
  272. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.test.js +30 -1
  273. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx +143 -0
  274. package/src/components/MlSpatialElevationProfile/util/getElevationData.tsx +103 -0
  275. package/src/components/MlThreeJsLayer/MlThreeJsLayer.meta.json +1 -2
  276. package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.meta.json +3 -4
  277. package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.stories.js +2 -3
  278. package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx +17 -79
  279. package/src/components/MlUseMapDebugger/MlUseMapDebugger.meta_.json +1 -2
  280. package/src/components/MlVectorTileLayer/MlVectorTileLayer.meta.json +1 -2
  281. package/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx +3 -2
  282. package/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.meta_.json +1 -2
  283. package/src/components/MlWmsLayer/MlWmsLayer.tsx +59 -41
  284. package/src/components/MlWmsLoader/MlWmsLoader.meta.json +1 -2
  285. package/src/components/MlWmsLoader/MlWmsLoader.stories.tsx +89 -0
  286. package/src/components/MlWmsLoader/MlWmsLoader.tsx +141 -122
  287. package/src/components/MlWmsLoader/utils/MlWmsLoaderInstructions.tsx +50 -0
  288. package/src/components/MlWmsLoader/utils/WMSLinks.tsx +128 -0
  289. package/src/decorators/MapContextDecorator.js +1 -1
  290. package/src/decorators/MapContextDecoratorHooks.js +1 -1
  291. package/src/decorators/ThemeWrapper.tsx +9 -0
  292. package/src/hooks/useCameraFollowPath/useCameraFollowPath.meta.json +1 -2
  293. package/src/{components/MlGPXViewer → hooks/useGpx/lib}/gpxConverter.js +1 -0
  294. package/src/hooks/useGpx/useGpx.doc.de.md +3 -0
  295. package/src/hooks/useGpx/useGpx.meta_.json +15 -0
  296. package/src/{components/MlCenterPosition/MlCenterPosition.stories.js → hooks/useGpx/useGpx.stories.js} +4 -5
  297. package/src/hooks/useGpx/useGpx.tsx +70 -0
  298. package/src/hooks/useLayer.ts +32 -10
  299. package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.doc.de.md +3 -0
  300. package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.meta_.json +15 -0
  301. package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.stories.js +20 -0
  302. package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx +82 -0
  303. package/src/hooks/useMap.test.tsx +48 -0
  304. package/src/hooks/useMap.ts +8 -8
  305. package/src/hooks/useSource.ts +4 -4
  306. package/src/hooks/{useWms.js → useWms.ts} +24 -11
  307. package/src/index.ts +5 -5
  308. package/src/setupTests.js +18 -15
  309. package/src/ui_components/Dropzone.tsx +104 -0
  310. package/src/ui_components/{ImageLoader.js → ImageLoader.tsx} +30 -25
  311. package/src/ui_components/{LoadingOverlayContext.js → LoadingOverlayContext.tsx} +12 -15
  312. package/src/ui_components/Sidebar.tsx +82 -0
  313. package/src/ui_components/Tooltip.tsx +17 -0
  314. package/src/ui_components/TopToolbar.tsx +26 -0
  315. package/src/ui_components/UploadButton.tsx +57 -0
  316. package/src/util/BubbleForInstructions.js +46 -0
  317. package/src/util/Instructions.tsx +60 -0
  318. package/tsconfig.json +39 -58
  319. package/config/getHttpsConfig.js +0 -66
  320. package/config/modules.js +0 -134
  321. package/config/pnpTs.js +0 -35
  322. package/config/webpack.config.js +0 -757
  323. package/config/webpackDevServer.config.js +0 -130
  324. package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +0 -1645
  325. package/scripts/start.js +0 -166
  326. package/src/components/MlGPXViewer/MlGPXViewer.stories.js +0 -31
  327. package/src/components/MlGPXViewer/MlGPXViewer.test.js +0 -28
  328. package/src/components/MlGPXViewer/MlGPXViewer.tsx +0 -377
  329. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.js +0 -66
  330. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.js +0 -45
  331. package/src/components/MlLayerMagnify/MlLayerMagnify.stories.js +0 -41
  332. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js +0 -224
  333. package/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.js +0 -57
  334. package/src/components/MlWmsLoader/MlWmsLoader.stories.js +0 -47
  335. package/src/decorators/ThemeWrapper.jsx +0 -9
  336. package/src/ui_components/Legend.js +0 -44
  337. package/src/ui_components/LoadingOverlay.js +0 -41
  338. package/src/ui_components/Sidebar.js +0 -100
  339. package/src/ui_components/Tooltip.js +0 -21
  340. package/src/ui_components/TopToolbar.js +0 -29
@@ -2,8 +2,37 @@ import { layerRemovalTest, sourceRemovalTest } from "../../util";
2
2
 
3
3
  import MlSpatialElevationProfile from "./MlSpatialElevationProfile";
4
4
  import { uuid_regex } from "../../setupTests";
5
+ const sampleGeojson = {
6
+ "type": "FeatureCollection",
7
+ "features": [
8
+ {
9
+ "type": "Feature",
10
+ "properties": {
11
+ "name": "Rundwanderung auf dem Wiedweg zwischen Seelbach und Oberlahr",
12
+ "desc": "Diese Rundtour gibt mir viele historische Einblicke und zeigt mir einzigartige und mir bisher verborgene Kultur- und Naturschönheiten. Eine rundum spannende und erlebnisreiche Tour.",
13
+ "type": "hikingTourTrail"
14
+ },
15
+ "geometry": {
16
+ "type": "LineString",
17
+ "coordinates": [
18
+ [
19
+ 7.526536,
20
+ 50.647383,
21
+ 267.71535
22
+ ],
23
+ [
24
+ 7.526617,
25
+ 50.647247,
26
+ 267.83347
27
+ ],
28
+ ]
29
+ }
30
+ }
31
+ ]
32
+ }
5
33
 
6
- const testComponent = <MlSpatialElevationProfile />;
34
+ // eslint-disable-next-line react/react-in-jsx-scope
35
+ const testComponent = <MlSpatialElevationProfile geojson={sampleGeojson} />;
7
36
 
8
37
  layerRemovalTest(
9
38
  "<MlSpatialElevationProfile />",
@@ -0,0 +1,143 @@
1
+ import React, { useRef, useMemo } from 'react';
2
+ import { featureCollection } from '@turf/helpers';
3
+ import { Feature, FeatureCollection } from '@turf/turf';
4
+ import { v4 as uuidv4 } from 'uuid';
5
+ import useSource from '../../hooks/useSource';
6
+ import useLayer from '../../hooks/useLayer';
7
+ import getElevationData from './util/getElevationData';
8
+ import { Coordinates, DataDrivenPropertyValueSpecification } from 'maplibre-gl';
9
+
10
+ const defaultFillExtrusionColor: (string | number | string[])[] = [
11
+ 'interpolate',
12
+ ['linear'],
13
+ ['get', 'height'],
14
+ 0,
15
+ 'rgba(0, 0, 255, 0)',
16
+ 0.1,
17
+ 'royalblue',
18
+ 0.3,
19
+ 'cyan',
20
+ 0.5,
21
+ 'lime',
22
+ 0.7,
23
+ 'yellow',
24
+ 1,
25
+ 'yellow',
26
+ ];
27
+ /**
28
+ * MlSpatialElevationProfile returns a Button that will add a standard OSM tile layer to the maplibre-gl instance.
29
+ *
30
+ * @component
31
+ */
32
+
33
+ interface geojson {
34
+ features: Feature | FeatureCollection | undefined;
35
+ }
36
+
37
+ export interface MlSpatialElevationProfileProps {
38
+ /**
39
+ * Id of the target MapLibre instance in mapContext
40
+ */
41
+ mapId?: string;
42
+ /**
43
+ * GeoJSON data that is supposed to be rendered by this component.
44
+ */
45
+ //geojson: {features: Feature | FeatureCollection | undefined };
46
+ geojson: geojson | FeatureCollection | undefined;
47
+ /**
48
+ * Prefix of the component id this component uses when adding elements to the MapLibreGl-instance
49
+ */
50
+ idPrefix?: string;
51
+ /**
52
+ * Number describes the factor of the height of the elevation
53
+ */
54
+ elevationFactor?: number;
55
+ /**
56
+ * The layerId of an existing layer this layer should be rendered visually beneath
57
+ * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see "beforeId" property
58
+ */
59
+ insertBeforeLayer?: string;
60
+ }
61
+
62
+ const MlSpatialElevationProfile = (props: MlSpatialElevationProfileProps) => {
63
+ const sourceName = useRef('elevationprofile-' + uuidv4());
64
+ const layerName = useRef('elevationprofile-layer-' + uuidv4());
65
+ const elevationFactor =
66
+ props.elevationFactor || MlSpatialElevationProfile.defaultProps.elevationFactor;
67
+
68
+ const _geojsonInfo = useMemo(() => {
69
+ if (!props?.geojson?.features) return;
70
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
71
+ // @ts-ignore
72
+ const line = props.geojson.features?.find((element: Feature) => {
73
+ return element.geometry.type === 'LineString';
74
+ });
75
+
76
+ if (!line || !line.geometry) return;
77
+
78
+ const heights = line.geometry.coordinates.map((coordinate: Coordinates) => {
79
+ return coordinate[2];
80
+ });
81
+
82
+ const min = Math.min(...heights);
83
+
84
+ let max = Math.max(...heights) - min;
85
+
86
+ max = max === 0 ? 1 : max;
87
+
88
+ return { max, min, line };
89
+ }, [props.geojson]);
90
+
91
+ const _fillExtrusionColor: (string | number | string[])[] = useMemo(() => {
92
+ if (!_geojsonInfo) return defaultFillExtrusionColor;
93
+
94
+ return [
95
+ 'interpolate',
96
+ ['linear'],
97
+ ['get', 'height'],
98
+ 0,
99
+ 'rgb(0,255,55)',
100
+ _geojsonInfo.max * elevationFactor,
101
+ 'rgb(255,0,0)',
102
+ ];
103
+ }, [_geojsonInfo, props.elevationFactor]);
104
+
105
+ const _geojson = useMemo(() => {
106
+ if (!props.geojson?.features || !_geojsonInfo) return;
107
+
108
+ const newData = getElevationData(_geojsonInfo, elevationFactor);
109
+ return newData;
110
+ }, [_geojsonInfo, elevationFactor]);
111
+
112
+ useSource({
113
+ mapId: props.mapId,
114
+ sourceId: sourceName.current,
115
+ source: {
116
+ type: 'geojson',
117
+ data: _geojson || featureCollection([]),
118
+ },
119
+ });
120
+
121
+ useLayer({
122
+ layerId: layerName.current,
123
+ source: sourceName.current,
124
+
125
+ options: {
126
+ type: 'fill-extrusion',
127
+ paint: {
128
+ 'fill-extrusion-height': ['get', 'height'],
129
+ 'fill-extrusion-opacity': 0.9,
130
+ 'fill-extrusion-color': (_fillExtrusionColor || defaultFillExtrusionColor) as (DataDrivenPropertyValueSpecification<string>),
131
+ },
132
+ },
133
+ insertBeforeLayer: props.insertBeforeLayer,
134
+ });
135
+
136
+ return <></>;
137
+ };
138
+
139
+ MlSpatialElevationProfile.defaultProps = {
140
+ elevationFactor: 1,
141
+ };
142
+
143
+ export default MlSpatialElevationProfile;
@@ -0,0 +1,103 @@
1
+ import { distance, lineOffset } from '@turf/turf';
2
+ import { polygon, lineString, featureCollection} from '@turf/helpers';
3
+ import { GeoJSONFeature } from 'maplibre-gl';
4
+
5
+ interface geometry{
6
+ coordinates: Array<number>
7
+ }
8
+ interface line {
9
+ geometry: geometry
10
+ }
11
+ interface _geojsonInfo {
12
+ line: line,
13
+ min: number
14
+ }
15
+
16
+
17
+
18
+ export default function getElevationData(_geojsonInfo: _geojsonInfo, elevationFactor: number) {
19
+
20
+ const createStep = (x: number, y: number, z: number, x2: number, y2: number) => {
21
+ //const summand = 0.0002;
22
+ const line = lineString([
23
+ [x, y],
24
+ [x2, y2],
25
+ ]);
26
+ const offsetLine = lineOffset(line, 5, { units: 'meters' });
27
+ const x3 = offsetLine.geometry.coordinates[0][0];
28
+ const y3 = offsetLine.geometry.coordinates[0][1];
29
+ const x4 = offsetLine.geometry.coordinates[1][0];
30
+ const y4 = offsetLine.geometry.coordinates[1][1];
31
+
32
+ return polygon(
33
+ [
34
+ [
35
+ [x, y],
36
+ [x2, y2],
37
+
38
+ [x4, y4],
39
+ [x3, y3],
40
+ [x, y],
41
+ ],
42
+ ],
43
+ { height: z * elevationFactor }
44
+ );
45
+ };
46
+
47
+ const lerp = (x: number, y: number, a: number) => x * (1 - a) + y * a;
48
+ const points: GeoJSONFeature[] = [];
49
+
50
+ _geojsonInfo.line.geometry.coordinates.forEach((coordinate: number, index: number) => {
51
+ //const point = createPoint(coordinate[0],coordinate[1],coordinate[2]-min);
52
+ //points.push(point);
53
+ if (_geojsonInfo.line.geometry.coordinates[index + 1]) {
54
+ const wayLength = distance(
55
+ [coordinate[0], coordinate[1]],
56
+ [
57
+ _geojsonInfo.line.geometry.coordinates[index + 1][0],
58
+ _geojsonInfo.line.geometry.coordinates[index + 1][1],
59
+ ],
60
+ { units: 'kilometers' }
61
+ );
62
+ let listLength = ~~((wayLength * 1000) / 10);
63
+ listLength = listLength < 1 ? 1 : listLength;
64
+ for (let i = 0; i < listLength; i++) {
65
+ const x = lerp(
66
+ _geojsonInfo.line.geometry.coordinates[index][0],
67
+ _geojsonInfo.line.geometry.coordinates[index + 1][0],
68
+ i / listLength
69
+ );
70
+ const y = lerp(
71
+ _geojsonInfo.line.geometry.coordinates[index][1],
72
+ _geojsonInfo.line.geometry.coordinates[index + 1][1],
73
+ i / listLength
74
+ );
75
+ const z = lerp(
76
+ _geojsonInfo.line.geometry.coordinates[index][2] - _geojsonInfo.min,
77
+ _geojsonInfo.line.geometry.coordinates[index + 1][2] - _geojsonInfo.min,
78
+ i / listLength
79
+ );
80
+
81
+ const x2 = lerp(
82
+ _geojsonInfo.line.geometry.coordinates[index][0],
83
+ _geojsonInfo.line.geometry.coordinates[index + 1][0],
84
+ (i + 1) / listLength
85
+ );
86
+ const y2 = lerp(
87
+ _geojsonInfo.line.geometry.coordinates[index][1],
88
+ _geojsonInfo.line.geometry.coordinates[index + 1][1],
89
+ (i + 1) / listLength
90
+ );
91
+
92
+ const point = createStep(x, y, z, x2, y2);
93
+ points.push(point as unknown as GeoJSONFeature);
94
+ }
95
+ }
96
+ });
97
+
98
+ const output = featureCollection(points);
99
+
100
+ return output;
101
+
102
+ }
103
+
@@ -10,6 +10,5 @@
10
10
  },
11
11
  "tags": [ "Map layer" ],
12
12
  "category": "layer",
13
- "type": "component",
14
- "price": 5000
13
+ "type": "component"
15
14
  }
@@ -1,15 +1,14 @@
1
1
  {
2
2
  "name": "MlTransitionGeoJsonLayer",
3
- "title": "GeoJSON layer",
3
+ "title": "Transition GeoJSON layer",
4
4
  "description": "",
5
5
  "i18n": {
6
6
  "de": {
7
- "title": "GeoJSON Ebene",
7
+ "title": "Animierte GeoJSON Ebene",
8
8
  "description": ""
9
9
  }
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, { useState, useContext, useRef, useEffect } from "react";
1
+ import React, { useState, useRef, useEffect } from "react";
2
2
 
3
3
  import MlTransitionGeoJsonLayer from "./MlTransitionGeoJsonLayer";
4
4
 
@@ -7,9 +7,8 @@ import useMap from "../../hooks/useMap";
7
7
 
8
8
  import sample_geojson_1 from "./assets/sample_1.json";
9
9
  import sample_geojson_2 from "./assets/sample_2.json";
10
- import sample_polygon_geojson_1 from "./assets/sample_polygon_1.json";
11
10
 
12
- console.log(sample_polygon_geojson_1);
11
+
13
12
  const storyoptions = {
14
13
  title: "MapComponents/MlTransitionGeoJsonLayer",
15
14
  component: MlTransitionGeoJsonLayer,
@@ -1,83 +1,23 @@
1
- import React, { useState, useRef, useEffect, useCallback } from "react";
2
-
3
- import * as turf from "@turf/turf";
4
-
5
- import useMap from "../../hooks/useMap";
6
-
7
- import { _transitionToGeojson } from "./util/transitionFunctions";
8
- import MlGeoJsonLayer from "../MlGeoJsonLayer/MlGeoJsonLayer";
9
- import { Feature, FeatureCollection } from "@turf/turf";
10
- import { CircleLayerSpecification, FillLayerSpecification, LineLayerSpecification, MapLayerMouseEvent } from "maplibre-gl";
1
+ import React, { useState, useRef, useEffect, useCallback } from 'react';
2
+ import * as turf from '@turf/turf';
3
+ import useMap from '../../hooks/useMap';
4
+ import { _transitionToGeojson } from './util/transitionFunctions';
5
+ import MlGeoJsonLayer from '../MlGeoJsonLayer/MlGeoJsonLayer';
6
+ import { Feature, FeatureCollection } from '@turf/turf';
7
+ import { MlGeoJsonLayerProps } from '../MlGeoJsonLayer/MlGeoJsonLayer';
11
8
 
12
9
  const msPerStep = 50;
13
10
 
14
- interface MlTransitionGeoJsonLayerProps {
15
- /**
16
- * Id of the target MapLibre instance in mapContext
17
- */
18
- mapId: string;
19
- /**
20
- * GeoJSON data that is supposed to be rendered by this component.
21
- */
22
- geojson: Feature | FeatureCollection | undefined;
23
- /**
24
- * Type of the layer that will be added to the MapLibre instance.
25
- * Possible values: "line", "circle", "fill"
26
- */
27
- type?: "fill" | "line" | "circle";
28
- /**
29
- * Paint property object, that is passed to the addLayer call.
30
- * Possible props depend on the layer type.
31
- * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line
32
- * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
33
- * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
34
- */
35
- paint?: CircleLayerSpecification['paint'] | FillLayerSpecification['paint'] | LineLayerSpecification['paint'];
36
- /**
37
- * Layout property object, that is passed to the addLayer call.
38
- * Possible props depend on the layer type.
39
- * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line
40
- * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle
41
- * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill
42
- */
43
- layout?: CircleLayerSpecification['layout'] | FillLayerSpecification['layout'] | LineLayerSpecification['layout'];
44
- /**
45
- * Javascript object that is spread into the addLayer commands first parameter.
46
- */
47
- options?: CircleLayerSpecification | FillLayerSpecification | LineLayerSpecification;
48
- /**
49
- * Javascript object with optional properties "fill", "line", "circle" to override implicit layer type default paint properties.
50
- */
51
- defaultPaintOverrides?: { circle?: CircleLayerSpecification['paint'], fill?: FillLayerSpecification['paint'], line?: LineLayerSpecification['paint'] };
52
- /**
53
- * Id of an existing layer in the mapLibre instance to help specify the layer order
54
- * This layer will be visually beneath the layer with the "insertBeforeLayer" id.
55
- */
56
- insertBeforeLayer: string;
57
- /**
58
- * Hover event handler that is executed whenever a geometry rendered by this component is hovered.
59
- */
60
- onHover?: MapLayerMouseEvent;
61
- /**
62
- * Click event handler that is executed whenever a geometry rendered by this component is clicked.
63
- */
64
- onClick?: MapLayerMouseEvent;
65
- /**
66
- * Leave event handler that is executed whenever a geometry rendered by this component is
67
- * left/unhovered.
68
- */
69
- onLeave?: MapLayerMouseEvent;
70
- /**
71
- * Creates transition animation whenever the geojson prop changes.
72
- * Only works with layer type "line" and LineString GeoJSON data.
73
- */
11
+ type MlTransitionGeoJsonLayerProps = MlGeoJsonLayerProps & {
74
12
  transitionTime: number;
75
- }
13
+ };
76
14
 
77
15
  /**
78
16
  * Adds source and layer of types "line", "fill" or "circle" to display GeoJSON data on the map.
79
17
  */
80
18
  const MlTransitionGeoJsonLayer = (props: MlTransitionGeoJsonLayerProps) => {
19
+ // ignore eslint. Only using `geojson` for destructuring
20
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
81
21
  const { geojson, ...restProps } = props;
82
22
 
83
23
  const mapHook = useMap({
@@ -93,9 +33,7 @@ const MlTransitionGeoJsonLayer = (props: MlTransitionGeoJsonLayerProps) => {
93
33
  const currentTransitionStepRef = useRef(false);
94
34
  const transitionGeojsonDataRef = useRef([]);
95
35
  const transitionGeojsonCommonDataRef = useRef([]);
96
- const [displayGeojson, setDisplayGeojson] = useState(
97
- turf.featureCollection([])
98
- );
36
+ const [displayGeojson, setDisplayGeojson] = useState(turf.featureCollection([]));
99
37
 
100
38
  useEffect(() => {
101
39
  return () => {
@@ -125,8 +63,8 @@ const MlTransitionGeoJsonLayer = (props: MlTransitionGeoJsonLayerProps) => {
125
63
  if (!mapHook.map || !initializedRef.current) return;
126
64
 
127
65
  if (
128
- typeof props.transitionTime !== "undefined" &&
129
- props.type === "line" &&
66
+ typeof props.transitionTime !== 'undefined' &&
67
+ props.type === 'line' &&
130
68
  oldGeojsonRef.current
131
69
  ) {
132
70
  transitionInProgressRef.current = false;
@@ -140,10 +78,10 @@ const MlTransitionGeoJsonLayer = (props: MlTransitionGeoJsonLayerProps) => {
140
78
 
141
79
  const startTransition = useCallback(() => {
142
80
  if (
143
- props.type === "line" &&
144
- typeof props.transitionTime !== "undefined" &&
81
+ props.type === 'line' &&
82
+ typeof props.transitionTime !== 'undefined' &&
145
83
  props.transitionTime &&
146
- typeof props.geojson !== "undefined" &&
84
+ typeof props.geojson !== 'undefined' &&
147
85
  JSON.stringify(oldGeojsonRef.current) !== JSON.stringify(props.geojson)
148
86
  ) {
149
87
  transitionToGeojson();
@@ -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": ["Map layer"],
12
12
  "category": "layer",
13
- "type": "component",
14
- "price": 5000
13
+ "type": "component"
15
14
  }
@@ -43,8 +43,7 @@ const MlVectorTileLayer = (props: MlVectorTileLayerProps) => {
43
43
  layerId.current,
44
44
  {
45
45
  type: 'vector',
46
- tiles: [props.url],
47
- tileSize: 512,
46
+ tiles: [props.url || ""],
48
47
  attribution: '',
49
48
  ...props.sourceOptions,
50
49
  },
@@ -60,6 +59,8 @@ const MlVectorTileLayer = (props: MlVectorTileLayerProps) => {
60
59
  maxzoom: 22,
61
60
  layout: {},
62
61
  paint: {
62
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
63
+ // @ts-ignore
63
64
  'line-opacity': 0.5,
64
65
  'line-color': 'rgb(80, 80, 80)',
65
66
  'line-width': 2,
@@ -10,6 +10,5 @@
10
10
  },
11
11
  "tags": [],
12
12
  "category": "",
13
- "type": "component",
14
- "price": 0
13
+ "type": "component"
15
14
  }