@mapcomponents/react-maplibre 0.1.48 → 0.1.52

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 (346) hide show
  1. package/.github/workflows/node_version_test.yml +2 -1
  2. package/CHANGELOG.md +22 -1
  3. package/README.md +61 -150
  4. package/coverage/clover.xml +269 -246
  5. package/coverage/coverage-final.json +10 -9
  6. package/coverage/lcov-report/index.html +49 -34
  7. package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +25 -25
  8. package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
  9. package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +343 -0
  10. package/coverage/lcov-report/src/components/MlCenterPosition/index.html +116 -0
  11. package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
  12. package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
  13. package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +69 -63
  14. package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +18 -18
  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 +1 -1
  18. package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
  19. package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.tsx.html +1 -1
  20. package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
  21. package/coverage/lcov-report/src/components/MlGPXViewer/index.html +1 -1
  22. package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +26 -11
  23. package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
  24. package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
  25. package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
  26. package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
  27. package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
  28. package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +1 -1
  29. package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
  30. package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +1 -1
  31. package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
  32. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
  33. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
  34. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
  35. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
  36. package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
  37. package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
  38. package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
  39. package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
  40. package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
  41. package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
  42. package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +106 -34
  43. package/coverage/lcov-report/src/components/MlNavigationTools/index.html +15 -15
  44. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
  45. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +1 -1
  46. package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
  47. package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
  48. package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
  49. package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
  50. package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
  51. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +1 -1
  52. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
  53. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
  54. package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
  55. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +22 -19
  56. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
  57. package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
  58. package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
  59. package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +1 -1
  60. package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +1 -1
  61. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
  62. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
  63. package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +1 -1
  64. package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
  65. package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +1 -1
  66. package/coverage/lcov-report/src/components/MlWmsLoader/index.html +1 -1
  67. package/coverage/lcov-report/src/contexts/MapContext.tsx.html +23 -23
  68. package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
  69. package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
  70. package/coverage/lcov-report/src/contexts/index.html +1 -1
  71. package/coverage/lcov-report/src/hooks/index.html +15 -15
  72. package/coverage/lcov-report/src/hooks/useLayer.ts.html +78 -69
  73. package/coverage/lcov-report/src/hooks/useMap.ts.html +25 -25
  74. package/coverage/lcov-report/src/hooks/useMapState.ts.html +28 -28
  75. package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
  76. package/coverage/lcov-report/src/index.html +1 -1
  77. package/coverage/lcov-report/src/index.ts.html +1 -1
  78. package/coverage/lcov.info +544 -494
  79. package/dist/components/MapLibreMap/MapLibreMap.d.ts +31 -0
  80. package/dist/components/MapLibreMap/MapLibreMap.stories.d.ts +15 -0
  81. package/dist/components/MapLibreMap/MapLibreMap.test.d.ts +1 -0
  82. package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +76 -0
  83. package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.test.d.ts +1 -0
  84. package/dist/components/MlBasicComponent.d.ts +5 -0
  85. package/dist/components/MlCenterPosition/MlCenterPosition.d.ts +50 -0
  86. package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +17 -0
  87. package/dist/components/MlComponentTemplate/MlComponentTemplate.d.ts +22 -0
  88. package/dist/components/MlComponentTemplate/MlComponentTemplate.stories.d.ts +10 -0
  89. package/dist/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +21 -0
  90. package/dist/components/MlCreatePdfButton/MlCreatePdfButton.stories.d.ts +10 -0
  91. package/dist/components/MlCreatePdfButton/lib/createPdf.d.ts +2 -0
  92. package/dist/components/MlCreatePdfButton/lib/nominatimMap.d.ts +2 -0
  93. package/dist/components/MlFeatureEditor/MlFeatureEditor.d.ts +35 -0
  94. package/dist/components/MlFeatureEditor/MlFeatureEditor.stories.d.ts +15 -0
  95. package/dist/components/MlFeatureEditor/MlFeatureEditor.test.d.ts +1 -0
  96. package/dist/components/MlFeatureEditor/custom-direct-select-mode.d.ts +37 -0
  97. package/dist/components/MlFeatureEditor/custom-polygon-mode.d.ts +16 -0
  98. package/dist/components/MlFeatureEditor/custom-select-mode.d.ts +37 -0
  99. package/dist/components/MlFeatureEditor/lib/common_selectors.d.ts +11 -0
  100. package/dist/components/MlFeatureEditor/lib/constants.d.ts +85 -0
  101. package/dist/components/MlFeatureEditor/lib/constrain_feature_movement.d.ts +2 -0
  102. package/dist/components/MlFeatureEditor/lib/create_midpoint.d.ts +15 -0
  103. package/dist/components/MlFeatureEditor/lib/create_supplementary_points.d.ts +2 -0
  104. package/dist/components/MlFeatureEditor/lib/create_vertex.d.ts +13 -0
  105. package/dist/components/MlFeatureEditor/lib/double_click_zoom.d.ts +7 -0
  106. package/dist/components/MlFeatureEditor/lib/euclidean_distance.d.ts +5 -0
  107. package/dist/components/MlFeatureEditor/lib/features_at.d.ts +7 -0
  108. package/dist/components/MlFeatureEditor/lib/get_features_and_set_cursor.d.ts +1 -0
  109. package/dist/components/MlFeatureEditor/lib/is_click.d.ts +1 -0
  110. package/dist/components/MlFeatureEditor/lib/is_event_at_coordinates.d.ts +6 -0
  111. package/dist/components/MlFeatureEditor/lib/is_tap.d.ts +3 -0
  112. package/dist/components/MlFeatureEditor/lib/map_event_to_bounding_box.d.ts +12 -0
  113. package/dist/components/MlFeatureEditor/lib/mode_handler.d.ts +24 -0
  114. package/dist/components/MlFeatureEditor/lib/mouse_event_point.d.ts +11 -0
  115. package/dist/components/MlFeatureEditor/lib/move_features.d.ts +2 -0
  116. package/dist/components/MlFeatureEditor/lib/sort_features.d.ts +2 -0
  117. package/dist/components/MlFeatureEditor/lib/string_set.d.ts +21 -0
  118. package/dist/components/MlFeatureEditor/lib/string_sets_are_equal.d.ts +5 -0
  119. package/dist/components/MlFeatureEditor/lib/theme.d.ts +88 -0
  120. package/dist/components/MlFeatureEditor/lib/to_dense_array.d.ts +12 -0
  121. package/dist/components/MlFeatureEditor/lib/utils.d.ts +10 -0
  122. package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.d.ts +61 -0
  123. package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.stories.d.ts +10 -0
  124. package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.test.d.ts +1 -0
  125. package/dist/components/MlFollowGps/MlFollowGps.d.ts +80 -0
  126. package/dist/components/MlFollowGps/MlFollowGps.stories.d.ts +10 -0
  127. package/dist/components/MlFollowGps/MlFollowGps.test.d.ts +1 -0
  128. package/dist/components/MlGPXViewer/MlGPXViewer.d.ts +29 -0
  129. package/dist/components/MlGPXViewer/MlGPXViewer.stories.d.ts +16 -0
  130. package/dist/components/MlGPXViewer/MlGPXViewer.test.d.ts +1 -0
  131. package/dist/components/MlGPXViewer/gpxConverter.d.ts +11 -0
  132. package/dist/components/MlGPXViewer/util/GeoJsonContext.d.ts +10 -0
  133. package/dist/components/MlGPXViewer/util/GeoJsonProvider.d.ts +4 -0
  134. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +76 -0
  135. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +12 -0
  136. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.test.d.ts +1 -0
  137. package/dist/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.d.ts +2 -0
  138. package/dist/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.d.ts +2 -0
  139. package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +29 -0
  140. package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.d.ts +10 -0
  141. package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.test.d.ts +1 -0
  142. package/dist/components/MlLayer/MlLayer.d.ts +26 -0
  143. package/dist/components/MlLayer/MlLayer.stories.d.ts +10 -0
  144. package/dist/components/MlLayer/MlLayer.test.d.ts +1 -0
  145. package/dist/components/MlLayerMagnify/MlLayerMagnify.d.ts +27 -0
  146. package/dist/components/MlLayerMagnify/MlLayerMagnify.stories.d.ts +10 -0
  147. package/dist/components/MlLayerMagnify/MlLayerMagnify.test.d.ts +1 -0
  148. package/dist/components/MlLayerSwipe/MlLayerSwipe.d.ts +16 -0
  149. package/dist/components/MlLayerSwipe/MlLayerSwipe.stories.d.ts +11 -0
  150. package/dist/components/MlLayerSwipe/MlLayerSwipe.test.d.ts +1 -0
  151. package/dist/components/MlLayerSwitcher/MlLayerSwitcher.d.ts +30 -0
  152. package/dist/components/MlLayerSwitcher/MlLayerSwitcher.stories.d.ts +13 -0
  153. package/dist/components/MlLayerSwitcher/components/LayerBox.d.ts +6 -0
  154. package/dist/components/MlMarker/MlMarker.d.ts +33 -0
  155. package/dist/components/MlMarker/MlMarker.stories.d.ts +9 -0
  156. package/dist/components/MlMeasureTool/MlMeasureTool.d.ts +20 -0
  157. package/dist/components/MlMeasureTool/MlMeasureTool.stories.d.ts +11 -0
  158. package/dist/components/MlNavigationCompass/MlNavigationCompass.d.ts +47 -0
  159. package/dist/components/MlNavigationCompass/MlNavigationCompass.stories.d.ts +10 -0
  160. package/dist/components/MlNavigationCompass/MlNavigationCompass.test.d.ts +1 -0
  161. package/dist/components/MlNavigationTools/MlNavigationTools.d.ts +31 -0
  162. package/dist/components/MlNavigationTools/MlNavigationTools.stories.d.ts +13 -0
  163. package/dist/components/MlOsmLayer/MlOsmLayer.d.ts +18 -0
  164. package/dist/components/MlOsmLayer/MlOsmLayer.stories_.d.ts +16 -0
  165. package/dist/components/MlOsmLayer/MlOsmLayer.test.d.ts +1 -0
  166. package/dist/components/MlScaleReference/MlScaleReference.d.ts +2 -0
  167. package/dist/components/MlScaleReference/MlScaleReference.stories.d.ts +14 -0
  168. package/dist/components/MlShareMapState/MlShareMapState.d.ts +22 -0
  169. package/dist/components/MlShareMapState/MlShareMapState.stories.d.ts +10 -0
  170. package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +20 -0
  171. package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.d.ts +16 -0
  172. package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.test.d.ts +1 -0
  173. package/dist/components/MlThreeJsLayer/MlThreeJsLayer.d.ts +15 -0
  174. package/dist/components/MlThreeJsLayer/MlThreeJsLayer.stories.d.ts +16 -0
  175. package/dist/components/MlThreeJsLayer/MlThreeJsLayer.test.d.ts +1 -0
  176. package/dist/components/MlThreeJsLayer/lib/GLTFLoader.d.ts +17 -0
  177. package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +73 -0
  178. package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.stories.d.ts +13 -0
  179. package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.test.d.ts +1 -0
  180. package/dist/components/MlTransitionGeoJsonLayer/util/transitionFunctions.d.ts +2 -0
  181. package/dist/components/MlUseMapDebugger/MlUseMapDebugger.d.ts +22 -0
  182. package/dist/components/MlUseMapDebugger/MlUseMapDebugger.stories.d.ts +13 -0
  183. package/dist/components/MlVectorTileLayer/MlVectorTileLayer.d.ts +37 -0
  184. package/dist/components/MlVectorTileLayer/MlVectorTileLayer.stories.d.ts +13 -0
  185. package/dist/components/MlVectorTileLayer/MlVectorTileLayer.test.d.ts +1 -0
  186. package/dist/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.d.ts +22 -0
  187. package/dist/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.stories.d.ts +13 -0
  188. package/dist/components/MlWmsLayer/MlWmsLayer.d.ts +100 -0
  189. package/dist/components/MlWmsLayer/MlWmsLayer.stories.d.ts +13 -0
  190. package/dist/components/MlWmsLayer/MlWmsLayer.test.d.ts +1 -0
  191. package/dist/components/MlWmsLoader/MlWmsLoader.d.ts +48 -0
  192. package/dist/components/MlWmsLoader/MlWmsLoader.stories.d.ts +13 -0
  193. package/dist/contexts/MapComponentsProvider.test.d.ts +1 -0
  194. package/dist/contexts/MapContext.d.ts +13 -0
  195. package/dist/contexts/SimpleDataContext.d.ts +4 -0
  196. package/dist/contexts/SimpleDataProvider.d.ts +8 -0
  197. package/dist/contexts/SimpleDataProvider.test.d.ts +1 -0
  198. package/dist/custom.d.d.ts +22 -0
  199. package/dist/decorators/MapContextDecorator.d.ts +2 -0
  200. package/dist/decorators/MultiMapContextDecorator.d.ts +2 -0
  201. package/dist/hooks/useLayer.d.ts +26 -0
  202. package/dist/hooks/useLayer.test.d.ts +1 -0
  203. package/dist/hooks/useMap.d.ts +14 -0
  204. package/dist/hooks/useMapState.d.ts +62 -0
  205. package/dist/hooks/useMapState.stories.d.ts +14 -0
  206. package/dist/hooks/useWms.d.ts +18 -0
  207. package/dist/index.d.ts +32 -0
  208. package/dist/index.esm.js +96 -33
  209. package/dist/index.esm.js.map +1 -1
  210. package/dist/setupTests.d.ts +12 -0
  211. package/dist/stories/components/Readme.d.ts +2 -0
  212. package/dist/ui_components/ImageLoader.d.ts +2 -0
  213. package/dist/ui_components/Legend.d.ts +1 -0
  214. package/dist/ui_components/LoadingOverlay.d.ts +2 -0
  215. package/dist/ui_components/LoadingOverlayContext.d.ts +11 -0
  216. package/dist/ui_components/Sidebar.d.ts +1 -0
  217. package/dist/ui_components/Tooltip.d.ts +1 -0
  218. package/dist/ui_components/TopToolbar.d.ts +1 -0
  219. package/dist/util/index.d.ts +3 -0
  220. package/dist/util/layerRemovalTest.d.ts +2 -0
  221. package/dist/util/sourceRemovalTest.d.ts +2 -0
  222. package/package.json +2 -1
  223. package/scripts/create-map-component.sh +2 -2
  224. package/src/components/MapLibreMap/MapLibreMap.tsx +1 -1
  225. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +4 -3
  226. package/src/components/MlCenterPosition/MlCenterPosition.doc.de.md +3 -0
  227. package/src/components/MlCenterPosition/MlCenterPosition.meta_.json +15 -0
  228. package/src/components/MlCenterPosition/MlCenterPosition.stories.js +21 -0
  229. package/src/components/MlCenterPosition/MlCenterPosition.tsx +86 -0
  230. package/src/components/MlFeatureEditor/MlFeatureEditor.stories.js +1 -2
  231. package/src/components/MlFeatureEditor/MlFeatureEditor.test.js +3 -3
  232. package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +37 -35
  233. package/src/components/MlFeatureEditor/lib/utils.js +1 -2
  234. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +14 -9
  235. package/src/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.ts +2 -1
  236. package/src/components/MlNavigationTools/MlNavigationTools.stories.js +3 -2
  237. package/src/components/MlNavigationTools/MlNavigationTools.tsx +44 -20
  238. package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx +18 -17
  239. package/src/components/MlWmsLoader/MlWmsLoader.stories.js +1 -1
  240. package/src/hooks/useLayer.test.js +205 -0
  241. package/src/hooks/useLayer.ts +11 -8
  242. package/tsconfig.json +35 -7
  243. package/docs-build/0.20735a16c2ad9677fe7d.manager.bundle.js +0 -1
  244. package/docs-build/0.968bdc5f.iframe.bundle.js +0 -2
  245. package/docs-build/0.968bdc5f.iframe.bundle.js.map +0 -1
  246. package/docs-build/1.3530bc86.iframe.bundle.js +0 -10
  247. package/docs-build/1.3530bc86.iframe.bundle.js.map +0 -1
  248. package/docs-build/17.c96fb6bc.iframe.bundle.js +0 -2
  249. package/docs-build/17.c96fb6bc.iframe.bundle.js.map +0 -1
  250. package/docs-build/18.0947f810.iframe.bundle.js +0 -17
  251. package/docs-build/18.0947f810.iframe.bundle.js.map +0 -1
  252. package/docs-build/19.44204e5a.iframe.bundle.js +0 -14
  253. package/docs-build/19.44204e5a.iframe.bundle.js.map +0 -1
  254. package/docs-build/2.c62e9630.iframe.bundle.js +0 -2
  255. package/docs-build/2.c62e9630.iframe.bundle.js.map +0 -1
  256. package/docs-build/20.50a2ad76.iframe.bundle.js +0 -2
  257. package/docs-build/20.50a2ad76.iframe.bundle.js.map +0 -1
  258. package/docs-build/21.ce55b70e.iframe.bundle.js +0 -4
  259. package/docs-build/21.ce55b70e.iframe.bundle.js.map +0 -1
  260. package/docs-build/22.639c6bb4.iframe.bundle.js +0 -22
  261. package/docs-build/22.639c6bb4.iframe.bundle.js.map +0 -1
  262. package/docs-build/3.afb0e0a5.iframe.bundle.js +0 -2
  263. package/docs-build/3.afb0e0a5.iframe.bundle.js.map +0 -1
  264. package/docs-build/4.8ac31bba1926f4f011b0.manager.bundle.js +0 -2
  265. package/docs-build/4.8ac31bba1926f4f011b0.manager.bundle.js.LICENSE.txt +0 -8
  266. package/docs-build/5.daf044a6c0f55d839078.manager.bundle.js +0 -1
  267. package/docs-build/6.99fba2cf6af0473f8209.manager.bundle.js +0 -2
  268. package/docs-build/6.99fba2cf6af0473f8209.manager.bundle.js.LICENSE.txt +0 -12
  269. package/docs-build/7.b6a48b90f61cb575c2e4.manager.bundle.js +0 -1
  270. package/docs-build/8.50518a5391398d9d5812.manager.bundle.js +0 -1
  271. package/docs-build/assets/3D/godzilla_simple.glb +0 -0
  272. package/docs-build/assets/dop.png +0 -0
  273. package/docs-build/assets/historic.png +0 -0
  274. package/docs-build/assets/marker.png +0 -0
  275. package/docs-build/assets/osm.png +0 -0
  276. package/docs-build/assets/sample.gpx +0 -716
  277. package/docs-build/catalogue/.gitkeep +0 -0
  278. package/docs-build/catalogue/mc_meta.json +0 -1
  279. package/docs-build/favicon.ico +0 -0
  280. package/docs-build/iframe.html +0 -348
  281. package/docs-build/index.html +0 -59
  282. package/docs-build/logo.png +0 -0
  283. package/docs-build/main.ef9704b1252e8efa56a0.manager.bundle.js +0 -1
  284. package/docs-build/main~24120820.e956ad2c.iframe.bundle.js +0 -2
  285. package/docs-build/main~24120820.e956ad2c.iframe.bundle.js.map +0 -1
  286. package/docs-build/manifest.json +0 -25
  287. package/docs-build/robots.txt +0 -3
  288. package/docs-build/runtime~main.6e6ed7dc9ea4785ef286.manager.bundle.js +0 -1
  289. package/docs-build/static/media/mapcomponents_logo.98b01a05.png +0 -0
  290. package/docs-build/static/media/wg-marker.bf3eeb2d.png +0 -0
  291. package/docs-build/thumbnails/MapLibreMap.png +0 -0
  292. package/docs-build/thumbnails/MlCameraFollowPath.png +0 -0
  293. package/docs-build/thumbnails/MlCreatePdfButton.png +0 -0
  294. package/docs-build/thumbnails/MlDeckGlLayer.png +0 -0
  295. package/docs-build/thumbnails/MlDeckGlTerrainLayer.png +0 -0
  296. package/docs-build/thumbnails/MlDemoDashboard.png +0 -0
  297. package/docs-build/thumbnails/MlFeatureEditor.png +0 -0
  298. package/docs-build/thumbnails/MlFillExtrusionLayer.png +0 -0
  299. package/docs-build/thumbnails/MlFollowGps.png +0 -0
  300. package/docs-build/thumbnails/MlGPXViewer.png +0 -0
  301. package/docs-build/thumbnails/MlGeoJsonLayer.png +0 -0
  302. package/docs-build/thumbnails/MlHillshadeLayer.png +0 -0
  303. package/docs-build/thumbnails/MlIconLayer.png +0 -0
  304. package/docs-build/thumbnails/MlLaermkarte.png +0 -0
  305. package/docs-build/thumbnails/MlLayerMagnify.png +0 -0
  306. package/docs-build/thumbnails/MlLayerSwipe.png +0 -0
  307. package/docs-build/thumbnails/MlMapDrawTools.png +0 -0
  308. package/docs-build/thumbnails/MlMeasureTool.png +0 -0
  309. package/docs-build/thumbnails/MlMobilerImker.png +0 -0
  310. package/docs-build/thumbnails/MlNavigationCompass.png +0 -0
  311. package/docs-build/thumbnails/MlNavigationTools.png +0 -0
  312. package/docs-build/thumbnails/MlOsmLayer.png +0 -0
  313. package/docs-build/thumbnails/MlScaleReference.png +0 -0
  314. package/docs-build/thumbnails/MlSpatialElevationProfile.png +0 -0
  315. package/docs-build/thumbnails/MlThreeJsLayer.png +0 -0
  316. package/docs-build/thumbnails/MlTransitionGeoJsonLayer.png +0 -0
  317. package/docs-build/thumbnails/MlVectorTileLayer.png +0 -0
  318. package/docs-build/thumbnails/MlWanderApp.png +0 -0
  319. package/docs-build/thumbnails/MlWmsLayer.png +0 -0
  320. package/docs-build/thumbnails/MlWmsLoader.png +0 -0
  321. package/docs-build/vendors~main.4b570b3072ba06ee44b5.manager.bundle.js +0 -2
  322. package/docs-build/vendors~main.4b570b3072ba06ee44b5.manager.bundle.js.LICENSE.txt +0 -104
  323. package/docs-build/vendors~main~0ad7406a.834c9ace.iframe.bundle.js +0 -8
  324. package/docs-build/vendors~main~0ad7406a.834c9ace.iframe.bundle.js.map +0 -1
  325. package/docs-build/vendors~main~0f485567.7297d057.iframe.bundle.js +0 -2
  326. package/docs-build/vendors~main~0f485567.7297d057.iframe.bundle.js.map +0 -1
  327. package/docs-build/vendors~main~41a6ab2c.19d97527.iframe.bundle.js +0 -2
  328. package/docs-build/vendors~main~41a6ab2c.19d97527.iframe.bundle.js.map +0 -1
  329. package/docs-build/vendors~main~52589227.cebbe724.iframe.bundle.js +0 -8
  330. package/docs-build/vendors~main~52589227.cebbe724.iframe.bundle.js.map +0 -1
  331. package/docs-build/vendors~main~57c1f6cb.8a8dd47e.iframe.bundle.js +0 -2
  332. package/docs-build/vendors~main~57c1f6cb.8a8dd47e.iframe.bundle.js.map +0 -1
  333. package/docs-build/vendors~main~73914085.2e61c0dc.iframe.bundle.js +0 -293
  334. package/docs-build/vendors~main~73914085.2e61c0dc.iframe.bundle.js.map +0 -1
  335. package/docs-build/vendors~main~9c5b28f6.32356887.iframe.bundle.js +0 -7
  336. package/docs-build/vendors~main~9c5b28f6.32356887.iframe.bundle.js.map +0 -1
  337. package/docs-build/vendors~main~b5906859.94dc520a.iframe.bundle.js +0 -21
  338. package/docs-build/vendors~main~b5906859.94dc520a.iframe.bundle.js.map +0 -1
  339. package/docs-build/vendors~main~b8f44717.8669cfb8.iframe.bundle.js +0 -89
  340. package/docs-build/vendors~main~b8f44717.8669cfb8.iframe.bundle.js.map +0 -1
  341. package/docs-build/vendors~main~b9cf3951.2a2025c3.iframe.bundle.js +0 -63
  342. package/docs-build/vendors~main~b9cf3951.2a2025c3.iframe.bundle.js.map +0 -1
  343. package/docs-build/vendors~main~d939e436.bb2b0303.iframe.bundle.js +0 -2
  344. package/docs-build/vendors~main~d939e436.bb2b0303.iframe.bundle.js.map +0 -1
  345. package/docs-build/vendors~main~f420d588.3481b43e.iframe.bundle.js +0 -107
  346. package/docs-build/vendors~main~f420d588.3481b43e.iframe.bundle.js.map +0 -1
@@ -0,0 +1,13 @@
1
+ export default storyoptions;
2
+ export const ExampleConfig: any;
3
+ declare namespace storyoptions {
4
+ export const title: string;
5
+ export { MlWmsFeatureInfoPopup as component };
6
+ export namespace argTypes {
7
+ const url: {};
8
+ const layer: {};
9
+ }
10
+ export { mapContextDecorator as decorators };
11
+ }
12
+ import MlWmsFeatureInfoPopup from "./MlWmsFeatureInfoPopup";
13
+ import mapContextDecorator from "../../decorators/MapContextDecorator";
@@ -0,0 +1,100 @@
1
+ import PropTypes from "prop-types";
2
+ interface MlWmsLayerProps {
3
+ urlParameters?: any;
4
+ url: string;
5
+ visible?: boolean;
6
+ attribution?: string;
7
+ mapId?: string;
8
+ sourceOptions?: any;
9
+ layerOptions?: any;
10
+ insertBeforeLayer?: string;
11
+ layerId?: string;
12
+ }
13
+ /**
14
+ * Adds a WMS raster source & layer to the maplibre-gl instance
15
+ *
16
+ * @param {object} props
17
+ * @param {object} props.urlParameters URL query parameters that will be added to the WMS URL. A layers property (string) is mandatory. Any value defined on this attribute will extend the default object
18
+ * @param {string} props.url WMS URL
19
+ * @param {bool} props.visible Sets layer "visibility" property to "visible" if true or "none" if false
20
+ * @param {string} props.attribution MapLibre attribution shown in the bottom right of the map, if this layer is visible
21
+ * @param {string} props.mapId Id of the target MapLibre instance in mapContext
22
+ * @param {object} props.sourceOptions Object that is passed to the MapLibre.addSource call as config option parameter
23
+ * @param {object} props.layerOptions Object that is passed to the MapLibre.addLayer call as config option parameter
24
+ * @param {string} props.insertBeforeLayer Id of an existing layer in the mapLibre instance to help specify the layer order
25
+ This layer will be visually beneath the layer with the "insertBeforeLayer" id
26
+ *
27
+ * @component
28
+ */
29
+ declare const MlWmsLayer: {
30
+ (props: MlWmsLayerProps): JSX.Element;
31
+ defaultProps: {
32
+ visible: boolean;
33
+ urlParameters: {
34
+ bbox: string;
35
+ format: string;
36
+ service: string;
37
+ version: string;
38
+ request: string;
39
+ srs: string;
40
+ width: number;
41
+ height: number;
42
+ styles: string;
43
+ };
44
+ attribution: string;
45
+ sourceOptions: {
46
+ minZoom: number;
47
+ maxZoom: number;
48
+ };
49
+ layerOptions: {
50
+ minZoom: number;
51
+ maxZoom: number;
52
+ };
53
+ };
54
+ propTypes: {
55
+ /**
56
+ * WMS URL
57
+ */
58
+ url: PropTypes.Validator<string>;
59
+ /**
60
+ * URL query parameters that will be added to the WMS URL. A layers property (string) is mandatory. Any value defined on this attribute will extend the default object.
61
+ */
62
+ urlParameters: PropTypes.Requireable<PropTypes.InferProps<{
63
+ layers: PropTypes.Validator<string>;
64
+ bbox: PropTypes.Requireable<string>;
65
+ format: PropTypes.Requireable<string>;
66
+ service: PropTypes.Requireable<string>;
67
+ version: PropTypes.Requireable<string>;
68
+ request: PropTypes.Requireable<string>;
69
+ srs: PropTypes.Requireable<string>;
70
+ width: PropTypes.Requireable<number>;
71
+ height: PropTypes.Requireable<number>;
72
+ }>>;
73
+ /**
74
+ * Id of the target MapLibre instance in mapContext
75
+ */
76
+ mapId: PropTypes.Requireable<string>;
77
+ /**
78
+ * MapLibre attribution shown in the bottom right of the map, if this layer is visible
79
+ */
80
+ attribution: PropTypes.Requireable<string>;
81
+ /**
82
+ * Object that is passed to the MapLibre.addLayer call as config option parameter
83
+ */
84
+ layerOptions: PropTypes.Requireable<object>;
85
+ /**
86
+ * Object that is passed to the MapLibre.addSource call as config option parameter
87
+ */
88
+ sourceOptions: PropTypes.Requireable<object>;
89
+ /**
90
+ * Id of an existing layer in the mapLibre instance to help specify the layer order
91
+ * This layer will be visually beneath the layer with the "insertBeforeLayer" id.
92
+ */
93
+ insertBeforeLayer: PropTypes.Requireable<string>;
94
+ /**
95
+ * Sets layer "visibility" property to "visible" if true or "none" if false
96
+ */
97
+ visible: PropTypes.Requireable<boolean>;
98
+ };
99
+ };
100
+ export default MlWmsLayer;
@@ -0,0 +1,13 @@
1
+ export default storyoptions;
2
+ export const ExampleConfig: any;
3
+ declare namespace storyoptions {
4
+ export const title: string;
5
+ export { MlWmsLayer as component };
6
+ export namespace argTypes {
7
+ const url: {};
8
+ const layer: {};
9
+ }
10
+ export { mapContextDecorator as decorators };
11
+ }
12
+ import MlWmsLayer from "./MlWmsLayer";
13
+ import mapContextDecorator from "../../decorators/MapContextDecorator";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,48 @@
1
+ import { LngLat } from "maplibre-gl";
2
+ interface MlWmsLoaderProps {
3
+ /**
4
+ * WMS URL
5
+ */
6
+ url: string;
7
+ /**
8
+ * Id of the target MapLibre instance in mapContext
9
+ */
10
+ mapId: string;
11
+ /**
12
+ * URL parameters that will be used in the getCapabilities request
13
+ */
14
+ urlParameters: object;
15
+ /**
16
+ * URL parameters that will be added when requesting WMS capabilities
17
+ */
18
+ wmsUrlParameters: object;
19
+ /**
20
+ * URL parameters that will be added when requesting tiles
21
+ */
22
+ layerUrlParameters: object;
23
+ lngLat: LngLat;
24
+ idPrefix: string;
25
+ }
26
+ /**
27
+ * Loads a WMS getCapabilities xml document and adds a MlWmsLayer component for each layer that is
28
+ * offered by the WMS.
29
+ *
30
+ * TODO: EaseTo the extend offered by the WMS in a zoom level that is supported
31
+ *
32
+ * @component
33
+ */
34
+ declare const MlWmsLoader: {
35
+ (props: MlWmsLoaderProps): JSX.Element;
36
+ defaultProps: {
37
+ url: string;
38
+ urlParameters: {
39
+ SERVICE: string;
40
+ VERSION: string;
41
+ REQUEST: string;
42
+ };
43
+ wmsUrlParameters: {
44
+ TRANSPARENT: string;
45
+ };
46
+ };
47
+ };
48
+ export default MlWmsLoader;
@@ -0,0 +1,13 @@
1
+ export default storyoptions;
2
+ export const ExampleConfig: any;
3
+ declare namespace storyoptions {
4
+ export const title: string;
5
+ export { MlWmsLoader as component };
6
+ export namespace argTypes {
7
+ const url: {};
8
+ const layer: {};
9
+ }
10
+ export { mapContextDecorator as decorators };
11
+ }
12
+ import MlWmsLoader from "./MlWmsLoader";
13
+ import mapContextDecorator from "../../decorators/MapContextDecorator";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ declare const MapContext: React.Context<MapContextType>;
3
+ /**
4
+ * MapComponentsProvider must be imported and wrapped around component where at least one of its child nodes requires access to a MapLibre-gl or openlayers instance that is registered in this mapContext.
5
+ MapComponentsProvider must be used one level higher than the first use of MapContext.
6
+ *
7
+ * MapComponentsProvider requires at least one use of the MapLibreMap component somewhere down the component tree that will create the MapLibre-gl object and set the reference at MapContext.map. For MapLibre maps it is a good idea to provide a mapId attribute to the MapLibreMap Component even if you are only using a single map instance at start. It will make a later transition to using multiple instances within the same project much easier.
8
+ */
9
+ declare const MapComponentsProvider: ({ children }: {
10
+ children: any;
11
+ }) => JSX.Element;
12
+ export { MapComponentsProvider };
13
+ export default MapContext;
@@ -0,0 +1,4 @@
1
+ export const SimpleDataContextProvider: React.Provider<{}>;
2
+ export default SimpleDataContext;
3
+ import React from "react";
4
+ declare const SimpleDataContext: React.Context<{}>;
@@ -0,0 +1,8 @@
1
+ export default SimpleDataProvider;
2
+ declare function SimpleDataProvider(props: any): JSX.Element;
3
+ declare namespace SimpleDataProvider {
4
+ namespace propTypes {
5
+ const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
6
+ }
7
+ }
8
+ import PropTypes from "prop-types";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ declare module "*.svg" {
2
+ const content: any;
3
+ export default content;
4
+ export { content as ReactComponent };
5
+ }
6
+ declare module "*.js" {
7
+ const content: any;
8
+ export default content;
9
+ }
10
+ declare type MapContextType = {
11
+ mapIds: [string?];
12
+ mapExists: Function;
13
+ maps: [];
14
+ map: any;
15
+ getMap: Function;
16
+ setMap: Function;
17
+ };
18
+ interface GeoJSON {
19
+ type: string;
20
+ features?: any;
21
+ geometry?: any;
22
+ }
@@ -0,0 +1,2 @@
1
+ export default decorators;
2
+ declare const decorators: ((Story: any) => JSX.Element)[];
@@ -0,0 +1,2 @@
1
+ export default decorators;
2
+ declare const decorators: ((Story: any) => JSX.Element)[];
@@ -0,0 +1,26 @@
1
+ import { useMapType } from "./useMap";
2
+ import { LayerSpecification } from "maplibre-gl";
3
+ import MapLibreGlWrapper from "../components/MapLibreMap/lib/MapLibreGlWrapper";
4
+ import { MapLayerMouseEvent } from "maplibre-gl";
5
+ import { GeoJSONObject } from "@turf/turf";
6
+ declare type useLayerType = {
7
+ map: MapLibreGlWrapper | undefined;
8
+ layer: LayerSpecification;
9
+ layerId: string;
10
+ componentId: string;
11
+ mapHook: useMapType;
12
+ };
13
+ interface useLayerProps {
14
+ mapId?: string;
15
+ layerId?: string;
16
+ idPrefix?: string;
17
+ insertBeforeLayer?: string;
18
+ insertBeforeFirstSymbolLayer?: boolean;
19
+ geojson?: GeoJSONObject;
20
+ options: Partial<LayerSpecification>;
21
+ onHover?: MapLayerMouseEvent;
22
+ onClick?: MapLayerMouseEvent;
23
+ onLeave?: MapLayerMouseEvent;
24
+ }
25
+ declare function useLayer(props: useLayerProps): useLayerType;
26
+ export default useLayer;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import MapLibreGlWrapper, { LayerState } from "../components/MapLibreMap/lib/MapLibreGlWrapper";
2
+ declare type useMapType = {
3
+ map: MapLibreGlWrapper | undefined;
4
+ mapIsReady: boolean;
5
+ componentId: string;
6
+ layers: (LayerState | undefined)[];
7
+ cleanup: Function;
8
+ };
9
+ declare function useMap(props: {
10
+ mapId?: string;
11
+ waitForLayer?: string;
12
+ }): useMapType;
13
+ export default useMap;
14
+ export type { useMapType };
@@ -0,0 +1,62 @@
1
+ import PropTypes from "prop-types";
2
+ import { LayerState, ViewportState } from "../components/MapLibreMap/lib/MapLibreGlWrapper";
3
+ declare type useMapStateType = {
4
+ layers: (LayerState | undefined)[];
5
+ viewport: ViewportState | undefined;
6
+ };
7
+ /**
8
+ * React hook that allows subscribing to map state changes
9
+ *
10
+ * @component
11
+ */
12
+ declare function useMapState(props: {
13
+ mapId?: string;
14
+ watch?: {
15
+ layers?: boolean;
16
+ sources?: boolean;
17
+ viewport?: boolean;
18
+ };
19
+ filter?: {
20
+ includeBaseLayers?: boolean;
21
+ matchLayerIds?: RegExp | string;
22
+ matchSourceIds?: RegExp | string;
23
+ };
24
+ }): useMapStateType;
25
+ declare namespace useMapState {
26
+ var defaultProps: {
27
+ mapId: undefined;
28
+ watch: {
29
+ layers: boolean;
30
+ sources: boolean;
31
+ viewport: boolean;
32
+ };
33
+ filter: {
34
+ includeBaseLayers: boolean;
35
+ };
36
+ };
37
+ var propTypes: {
38
+ /**
39
+ * Id of the target MapLibre instance in mapContext
40
+ */
41
+ mapId: PropTypes.Requireable<string>;
42
+ /**
43
+ * Defines map Resources to watch
44
+ */
45
+ watch: PropTypes.Requireable<PropTypes.InferProps<{
46
+ layers: PropTypes.Requireable<boolean>;
47
+ sources: PropTypes.Requireable<boolean>;
48
+ viewport: PropTypes.Requireable<boolean>;
49
+ }>>;
50
+ /**
51
+ * Filter string or RegExp to more explicitly define the elements watched and increase performance
52
+ * strings will be matched using layerId.includes(matchString)
53
+ * RegExps will be matched using matchRegExp.test(layerId)
54
+ */
55
+ filter: PropTypes.Requireable<PropTypes.InferProps<{
56
+ includeBaseLayers: PropTypes.Requireable<boolean>;
57
+ matchLayerIds: PropTypes.Requireable<string | RegExp>;
58
+ matchSourceIds: PropTypes.Requireable<string | RegExp>;
59
+ }>>;
60
+ };
61
+ }
62
+ export default useMapState;
@@ -0,0 +1,14 @@
1
+ export default storyoptions;
2
+ export const ViewportOnly: any;
3
+ export const IncludeBaseLayers: any;
4
+ export const MatchLayerIdString: any;
5
+ export const MatchLayerIdRegexp: any;
6
+ export const NonBaseLayersOnly: any;
7
+ declare namespace storyoptions {
8
+ export const title: string;
9
+ export { useMapState as component };
10
+ export const argTypes: {};
11
+ export { mapContextDecorator as decorators };
12
+ }
13
+ import useMapState from "./useMapState";
14
+ import mapContextDecorator from "../decorators/MapContextDecorator";
@@ -0,0 +1,18 @@
1
+ export default useWms;
2
+ declare function useWms(props: any): {
3
+ capabilities: undefined;
4
+ getFeatureInfoUrl: undefined;
5
+ wmsUrl: string;
6
+ error: undefined;
7
+ setUrl: import("react").Dispatch<any>;
8
+ };
9
+ declare namespace useWms {
10
+ namespace defaultProps {
11
+ const url: string;
12
+ namespace urlParameters {
13
+ const SERVICE: string;
14
+ const VERSION: string;
15
+ const REQUEST: string;
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,32 @@
1
+ export { default as MapLibreMap } from "./components/MapLibreMap/MapLibreMap";
2
+ export { default as MlComponentTemplate } from "./components/MlComponentTemplate/MlComponentTemplate";
3
+ export { default as MlCreatePdfButton } from "./components/MlCreatePdfButton/MlCreatePdfButton";
4
+ export { default as MlFeatureEditor } from "./components/MlFeatureEditor/MlFeatureEditor";
5
+ export { default as MlFillExtrusionLayer } from "./components/MlFillExtrusionLayer/MlFillExtrusionLayer";
6
+ export { default as MlFollowGps } from "./components/MlFollowGps/MlFollowGps";
7
+ export { default as MlGeoJsonLayer } from "./components/MlGeoJsonLayer/MlGeoJsonLayer";
8
+ export { default as MlImageMarkerLayer } from "./components/MlImageMarkerLayer/MlImageMarkerLayer";
9
+ export { default as MlMeasureTool } from "./components/MlMeasureTool/MlMeasureTool";
10
+ export { default as MlNavigationTools } from "./components/MlNavigationTools/MlNavigationTools";
11
+ export { default as MlNavigationCompass } from "./components/MlNavigationCompass/MlNavigationCompass";
12
+ export { default as MlLayer } from "./components/MlLayer/MlLayer";
13
+ export { default as MlVectorTileLayer } from "./components/MlVectorTileLayer/MlVectorTileLayer";
14
+ export { default as MlWmsLayer } from "./components/MlWmsLayer/MlWmsLayer";
15
+ export { default as MlLayerMagnify } from "./components/MlLayerMagnify/MlLayerMagnify";
16
+ export { default as MlLayerSwipe } from "./components/MlLayerSwipe/MlLayerSwipe";
17
+ export { default as MlTransitionGeoJsonLayer } from "./components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer";
18
+ export { default as MlMarker } from "./components/MlMarker/MlMarker";
19
+ export { default as MlGPXViewer } from "./components/MlGPXViewer/MlGPXViewer";
20
+ export { default as GeoJsonProvider } from "./components/MlGPXViewer/util/GeoJsonProvider";
21
+ export { default as GeoJsonContext } from "./components/MlGPXViewer/util/GeoJsonContext";
22
+ export { default as MlSpatialElevationProfile } from "./components/MlSpatialElevationProfile/MlSpatialElevationProfile.js";
23
+ export { default as MlOsmLayer } from "./components/MlOsmLayer/MlOsmLayer.js";
24
+ export { default as MlBasicComponent } from "./components/MlBasicComponent.js";
25
+ export { default as useLayer } from "./hooks/useLayer";
26
+ export { default as useMapState } from "./hooks/useMapState";
27
+ export { default as useMap } from "./hooks/useMap";
28
+ export { default as useWms } from "./hooks/useWms.js";
29
+ export { MapComponentsProvider } from "./contexts/MapContext";
30
+ export { default as MapContext } from "./contexts/MapContext";
31
+ export { default as SimpleDataProvider } from "./contexts/SimpleDataProvider";
32
+ export { default as SimpleDataContext } from "./contexts/SimpleDataContext";
package/dist/index.esm.js CHANGED
@@ -11859,7 +11859,9 @@ var drawUtils = {
11859
11859
  },
11860
11860
  getDrawInstance: function getDrawInstance(map) {
11861
11861
  for (var i = map._controls.length - 1; i >= 0; i--) {
11862
- if (map._controls[i].options && map._controls[i].options.defaultMode === "custom_select") {
11862
+ var _map$_controls$i, _map$_controls$i$mode;
11863
+
11864
+ if (((_map$_controls$i = map._controls[i]) === null || _map$_controls$i === void 0 ? void 0 : (_map$_controls$i$mode = _map$_controls$i.modes) === null || _map$_controls$i$mode === void 0 ? void 0 : _map$_controls$i$mode.SIMPLE_SELECT) === "simple_select") {
11863
11865
  return map._controls[i];
11864
11866
  }
11865
11867
  }
@@ -12143,21 +12145,15 @@ var MlFeatureEditor = function (props) {
12143
12145
  mapId: props.mapId,
12144
12146
  waitForLayer: props.insertBeforeLayer,
12145
12147
  });
12146
- var onChangeRef = useRef(props.onChange);
12147
12148
  var drawToolsInitialized = useRef(false);
12148
12149
  var _a = useState(false), drawToolsReady = _a[0], setDrawToolsReady = _a[1];
12149
- var _b = useState(0), mouseUpTrigger = _b[0], setMouseUpTrigger = _b[1];
12150
12150
  var modeChangeHandler = function (e) {
12151
12151
  console.log("MlFeatureEditor mode change to " + e.mode);
12152
12152
  //setDrawMode(e.mode);
12153
12153
  };
12154
- var mouseUpHandler = function () {
12155
- setMouseUpTrigger(Math.random());
12156
- };
12157
12154
  useEffect(function () {
12158
12155
  var _a;
12159
- if (mapHook.map &&
12160
- !drawToolsInitialized.current) {
12156
+ if (mapHook.map && !drawToolsInitialized.current) {
12161
12157
  drawToolsInitialized.current = true;
12162
12158
  if (mapHook.map.map.style &&
12163
12159
  mapHook.map.map.getSource("mapbox-gl-draw-cold") &&
@@ -12176,35 +12172,46 @@ var MlFeatureEditor = function (props) {
12176
12172
  custom_direct_select: DirectSelect,
12177
12173
  }, MapboxDraw.modes),
12178
12174
  });
12179
- mapHook.map.on("draw.modechange", modeChangeHandler, mapHook.componentId);
12180
12175
  mapHook.map.addControl(draw.current, "top-left", mapHook.componentId);
12181
- mapHook.map.on("mouseup", mouseUpHandler, mapHook.componentId);
12176
+ mapHook.map.on("draw.modechange", modeChangeHandler, mapHook.componentId);
12182
12177
  setDrawToolsReady(true);
12183
12178
  }
12184
12179
  }, [mapHook.map, props, drawToolsInitialized]);
12180
+ useEffect(function () {
12181
+ if (!mapHook.map || !drawToolsReady)
12182
+ return;
12183
+ var changeHandler = function () {
12184
+ var _a, _b;
12185
+ if (draw.current) {
12186
+ // update drawnFeatures state object
12187
+ if (typeof props.onChange === "function") {
12188
+ var currentFeatureCollection = (_b = (_a = draw.current).getAll) === null || _b === void 0 ? void 0 : _b.call(_a);
12189
+ props.onChange(currentFeatureCollection === null || currentFeatureCollection === void 0 ? void 0 : currentFeatureCollection.features);
12190
+ }
12191
+ }
12192
+ };
12193
+ mapHook.map.on("mouseup", changeHandler);
12194
+ mapHook.map.on("touchend", changeHandler);
12195
+ return function () {
12196
+ if (!mapHook.map)
12197
+ return;
12198
+ mapHook.map.map.off("mouseup", changeHandler);
12199
+ mapHook.map.map.off("touchend", changeHandler);
12200
+ };
12201
+ }, [drawToolsReady, mapHook.map]);
12185
12202
  useEffect(function () {
12186
12203
  var _a;
12187
- if (draw.current &&
12188
- ((_a = props.geojson) === null || _a === void 0 ? void 0 : _a.geometry)) {
12204
+ if (draw.current && ((_a = props.geojson) === null || _a === void 0 ? void 0 : _a.geometry)) {
12189
12205
  draw.current.set({ type: "FeatureCollection", features: [props.geojson] });
12190
12206
  }
12191
12207
  }, [props.geojson, drawToolsReady]);
12192
- useEffect(function () {
12193
- if (draw.current && mouseUpTrigger) {
12194
- // update drawnFeatures state object
12195
- var currentFeatureCollection = draw.current.getAll();
12196
- if (typeof onChangeRef.current === "function") {
12197
- onChangeRef.current(currentFeatureCollection.features);
12198
- }
12199
- }
12200
- }, [mouseUpTrigger]);
12201
12208
  useEffect(function () {
12202
12209
  if (props.mode && draw.current) {
12203
12210
  // @ts-ignore
12204
12211
  draw.current.changeMode(props.mode);
12205
12212
  }
12206
12213
  }, [props.mode]);
12207
- return (React__default.createElement(React__default.Fragment, null));
12214
+ return React__default.createElement(React__default.Fragment, null);
12208
12215
  };
12209
12216
 
12210
12217
  var legalLayerTypes = [
@@ -13309,8 +13316,55 @@ function useMediaQuery(queryInput, options = {}) {
13309
13316
  }
13310
13317
 
13311
13318
  /**
13312
- * @component
13313
- */
13319
+ * Component template
13320
+ *
13321
+ */
13322
+ var MlCenterPosition = function (props) {
13323
+ var _a, _b;
13324
+ var mapHook = useMap({
13325
+ mapId: props.mapId,
13326
+ waitForLayer: props.insertBeforeLayer,
13327
+ });
13328
+ var _c = useState(false), locationAccessDenied = _c[0], setLocationAccessDenied = _c[1];
13329
+ var centerCurrentLocation = function () {
13330
+ navigator.geolocation.getCurrentPosition(getLocationSuccess, getLocationError);
13331
+ };
13332
+ var getLocationSuccess = useCallback(function (location) {
13333
+ var _a, _b, _c;
13334
+ (_c = (_a = mapHook.map) === null || _a === void 0 ? void 0 : (_b = _a.map).setCenter) === null || _c === void 0 ? void 0 : _c.call(_b, [location.coords.longitude, location.coords.latitude]);
13335
+ }, [mapHook.map]);
13336
+ var getLocationError = function () {
13337
+ console.log("Access of user location denied");
13338
+ setLocationAccessDenied(true);
13339
+ };
13340
+ return React__default.createElement(React__default.Fragment, null,
13341
+ React__default.createElement(Button$2, { sx: __assign({ zIndex: 1002, color: !locationAccessDenied ? props.onColor : props.offColor }, props.style), onClick: centerCurrentLocation, disabled: locationAccessDenied },
13342
+ React__default.createElement(default_1$4, { sx: __assign({}, (((_a = props.style) === null || _a === void 0 ? void 0 : _a.fontSize) ? { fontSize: (_b = props.style) === null || _b === void 0 ? void 0 : _b.fontSize } : {})) }),
13343
+ " "));
13344
+ };
13345
+ MlCenterPosition.defaultProps = {
13346
+ mapId: undefined,
13347
+ style: {
13348
+ minWidth: "30px",
13349
+ minHeight: "30px",
13350
+ width: "30px",
13351
+ height: "30px",
13352
+ backgroundColor: "#414141",
13353
+ borderRadius: "23%",
13354
+ margin: 0.15,
13355
+ fontSize: "1.3em",
13356
+ ":hover": {
13357
+ backgroundColor: "#515151",
13358
+ color: "#ececec",
13359
+ },
13360
+ },
13361
+ onColor: "#ececec",
13362
+ offColor: "#666",
13363
+ };
13364
+
13365
+ /**
13366
+ * @component
13367
+ */
13314
13368
  var MlNavigationTools = function (props) {
13315
13369
  var mapHook = useMap({
13316
13370
  mapId: props.mapId,
@@ -13347,16 +13401,14 @@ var MlNavigationTools = function (props) {
13347
13401
  var zoomIn = function () {
13348
13402
  if (!mapHook.map)
13349
13403
  return;
13350
- if (mapHook.map.map.transform._zoom + 0.5 <=
13351
- mapHook.map.map.transform._maxZoom) {
13404
+ if (mapHook.map.map.transform._zoom + 0.5 <= mapHook.map.map.transform._maxZoom) {
13352
13405
  mapHook.map.map.easeTo({ zoom: mapHook.map.map.transform._zoom + 0.5 });
13353
13406
  }
13354
13407
  };
13355
13408
  var zoomOut = function () {
13356
13409
  if (!mapHook.map)
13357
13410
  return;
13358
- if (mapHook.map.map.transform._zoom - 0.5 >=
13359
- mapHook.map.map.transform._minZoom) {
13411
+ if (mapHook.map.map.transform._zoom - 0.5 >= mapHook.map.map.transform._minZoom) {
13360
13412
  mapHook.map.map.easeTo({ zoom: mapHook.map.map.transform._zoom - 0.5 });
13361
13413
  }
13362
13414
  };
@@ -13386,11 +13438,17 @@ var MlNavigationTools = function (props) {
13386
13438
  }, backgroundStyle: {
13387
13439
  boxShadow: "0px 0px 18px rgba(0,0,0,.5)",
13388
13440
  } }),
13389
- React__default.createElement(Button$1, { sx: __assign(__assign({}, buttonStyle), { fontSize: mediaIsMobile ? '1.4em' : '1em', fontWeight: 600 }), onClick: adjustPitch }, pitch ? "2D" : "3D"),
13390
- React__default.createElement(MlFollowGps, { style: __assign({}, (function (_a) {
13391
- _a.color; var rest = __rest(_a, ["color"]);
13392
- return rest;
13393
- })(buttonStyle)) }),
13441
+ React__default.createElement(Button$1, { sx: __assign(__assign({}, buttonStyle), { fontSize: mediaIsMobile ? "1.4em" : "1em", fontWeight: 600 }), onClick: adjustPitch }, pitch ? "2D" : "3D"),
13442
+ props.showFollowGpsButton &&
13443
+ React__default.createElement(MlFollowGps, { style: __assign({}, (function (_a) {
13444
+ _a.color; var rest = __rest(_a, ["color"]);
13445
+ return rest;
13446
+ })(buttonStyle)) }),
13447
+ props.showCenterLocationButton &&
13448
+ React__default.createElement(MlCenterPosition, { style: __assign({}, (function (_a) {
13449
+ _a.color; var rest = __rest(_a, ["color"]);
13450
+ return rest;
13451
+ })(buttonStyle)) }),
13394
13452
  React__default.createElement(ButtonGroup$1, { orientation: "vertical", sx: {
13395
13453
  width: "50px",
13396
13454
  border: "none",
@@ -13401,6 +13459,11 @@ var MlNavigationTools = function (props) {
13401
13459
  React__default.createElement(default_1$3, { sx: { fontSize: mediaIsMobile ? "1.5em" : "1.2em" } })),
13402
13460
  React__default.createElement(Button$1, { sx: __assign(__assign({}, buttonStyle), { color: "#ececec" }), onClick: zoomOut },
13403
13461
  React__default.createElement(default_1$2, { sx: { fontSize: mediaIsMobile ? "1.5em" : "1.2em" } })))));
13462
+ };
13463
+ MlNavigationTools.defaultProps = {
13464
+ mapId: undefined,
13465
+ showFollowGpsButton: true,
13466
+ showCenterLocationButton: false,
13404
13467
  };
13405
13468
 
13406
13469
  /**