@mapcomponents/react-maplibre 0.1.34 → 0.1.37

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 (305) hide show
  1. package/.babelrc +3 -0
  2. package/.github/workflows/storybook.yml +1 -1
  3. package/.storybook/.babelrc +26 -0
  4. package/.storybook/main.js +15 -1
  5. package/.storybook/mapcomponents_logo.png +0 -0
  6. package/CHANGELOG.md +16 -1
  7. package/config/env.js +106 -0
  8. package/config/getHttpsConfig.js +66 -0
  9. package/config/jest/babelTransform.js +29 -0
  10. package/config/jest/cssTransform.js +14 -0
  11. package/config/jest/fileTransform.js +40 -0
  12. package/config/modules.js +134 -0
  13. package/config/paths.js +75 -0
  14. package/config/pnpTs.js +35 -0
  15. package/config/webpack.config.js +757 -0
  16. package/config/webpackDevServer.config.js +130 -0
  17. package/coverage/clover.xml +822 -900
  18. package/coverage/coverage-final.json +23 -24
  19. package/coverage/lcov-report/index.html +135 -150
  20. package/coverage/lcov-report/src/components/MapLibreMap/{MapLibreMap.js.html → MapLibreMap.tsx.html} +77 -68
  21. package/coverage/lcov-report/src/components/MapLibreMap/index.html +6 -6
  22. package/coverage/lcov-report/src/components/MlCreatePdfButton/{MlCreatePdfButton.js.html → MlCreatePdfButton.tsx.html} +40 -43
  23. package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +10 -10
  24. package/coverage/lcov-report/src/components/MlFeatureEditor/{MlFeatureEditor.js.html → MlFeatureEditor.tsx.html} +145 -85
  25. package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +21 -21
  26. package/coverage/lcov-report/src/components/{MlImageMarkerLayer/MlImageMarkerLayer.js.html → MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html} +141 -111
  27. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +20 -20
  28. package/coverage/lcov-report/src/components/MlFollowGps/{MlFollowGps.js.html → MlFollowGps.tsx.html} +177 -138
  29. package/coverage/lcov-report/src/components/MlFollowGps/index.html +15 -15
  30. package/coverage/lcov-report/src/components/MlGPXViewer/{MlGPXViewer.js.html → MlGPXViewer.tsx.html} +134 -80
  31. package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
  32. package/coverage/lcov-report/src/components/MlGPXViewer/index.html +16 -16
  33. package/coverage/lcov-report/src/components/{MlLayer/MlLayer.js.html → MlGeoJsonLayer/MlGeoJsonLayer.tsx.html} +151 -154
  34. package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +19 -19
  35. package/coverage/lcov-report/src/components/{MlFillExtrusionLayer/MlFillExtrusionLayer.js.html → MlImageMarkerLayer/MlImageMarkerLayer.tsx.html} +151 -223
  36. package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +16 -16
  37. package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +229 -0
  38. package/coverage/lcov-report/src/components/MlLayer/index.html +21 -21
  39. package/coverage/lcov-report/src/components/MlLayerMagnify/{MlLayerMagnify.js.html → MlLayerMagnify.tsx.html} +134 -77
  40. package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +20 -20
  41. package/coverage/lcov-report/src/components/MlLayerSwipe/{MlLayerSwipe.js.html → MlLayerSwipe.tsx.html} +83 -41
  42. package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +2 -2
  43. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +3 -15
  44. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
  45. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
  46. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
  47. package/coverage/lcov-report/src/components/MlMarker/{MlMarker.js.html → MlMarker.tsx.html} +89 -137
  48. package/coverage/lcov-report/src/components/MlMarker/index.html +10 -10
  49. package/coverage/lcov-report/src/components/MlNavigationCompass/{MlNavigationCompass.js.html → MlNavigationCompass.tsx.html} +76 -25
  50. package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +17 -17
  51. package/coverage/lcov-report/src/components/MlNavigationTools/{MlNavigationTools.js.html → MlNavigationTools.tsx.html} +67 -52
  52. package/coverage/lcov-report/src/components/MlNavigationTools/index.html +10 -10
  53. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
  54. package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
  55. package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
  56. package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
  57. package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
  58. package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
  59. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +3 -3
  60. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
  61. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +5 -5
  62. package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
  63. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/{MlTransitionGeoJsonLayer.js.html → MlTransitionGeoJsonLayer.tsx.html} +127 -118
  64. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +11 -11
  65. package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
  66. package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
  67. package/coverage/lcov-report/src/components/MlVectorTileLayer/{MlVectorTileLayer.js.html → MlVectorTileLayer.tsx.html} +59 -11
  68. package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +2 -2
  69. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
  70. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
  71. package/coverage/lcov-report/src/components/MlWmsLayer/{MlWmsLayer.js.html → MlWmsLayer.tsx.html} +56 -11
  72. package/coverage/lcov-report/src/components/MlWmsLayer/index.html +2 -2
  73. package/coverage/lcov-report/src/components/MlWmsLoader/{MlWmsLoader.js.html → MlWmsLoader.tsx.html} +102 -78
  74. package/coverage/lcov-report/src/components/MlWmsLoader/index.html +8 -8
  75. package/coverage/lcov-report/src/hooks/index.html +44 -29
  76. package/coverage/lcov-report/src/{components/MlGeoJsonLayer/MlGeoJsonLayer.js.html → hooks/useLayer.ts.html} +328 -184
  77. package/coverage/lcov-report/src/hooks/{useMap.js.html → useMap.ts.html} +140 -50
  78. package/coverage/lcov-report/src/hooks/{useMapState.js.html → useMapState.ts.html} +166 -61
  79. package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
  80. package/coverage/lcov-report/src/index.html +15 -15
  81. package/coverage/lcov-report/src/{i18n.js.html → index.ts.html} +50 -32
  82. package/coverage/lcov.info +1540 -1669
  83. package/dist/index.esm.css +195 -0
  84. package/dist/index.esm.js +42894 -4862
  85. package/dist/index.esm.js.map +1 -1
  86. package/docs-build/0.d0c23b79.iframe.bundle.js +2 -0
  87. package/docs-build/0.d0c23b79.iframe.bundle.js.map +1 -0
  88. package/docs-build/0.fd1aa3ea21956d993519.manager.bundle.js +1 -0
  89. package/docs-build/1.34075652.iframe.bundle.js +10 -0
  90. package/docs-build/1.34075652.iframe.bundle.js.map +1 -0
  91. package/docs-build/16.ca488dae.iframe.bundle.js +2 -0
  92. package/docs-build/16.ca488dae.iframe.bundle.js.map +1 -0
  93. package/docs-build/17.e40eac7f.iframe.bundle.js +17 -0
  94. package/docs-build/17.e40eac7f.iframe.bundle.js.map +1 -0
  95. package/docs-build/18.62af0912.iframe.bundle.js +14 -0
  96. package/docs-build/18.62af0912.iframe.bundle.js.map +1 -0
  97. package/docs-build/19.0a217189.iframe.bundle.js +2 -0
  98. package/docs-build/19.0a217189.iframe.bundle.js.map +1 -0
  99. package/docs-build/2.f15ae19a.iframe.bundle.js +2 -0
  100. package/docs-build/2.f15ae19a.iframe.bundle.js.map +1 -0
  101. package/docs-build/20.4c43e27c.iframe.bundle.js +4 -0
  102. package/docs-build/20.4c43e27c.iframe.bundle.js.map +1 -0
  103. package/docs-build/21.19c21085.iframe.bundle.js +22 -0
  104. package/docs-build/21.19c21085.iframe.bundle.js.map +1 -0
  105. package/docs-build/3.5dd9e88b.iframe.bundle.js +2 -0
  106. package/docs-build/3.5dd9e88b.iframe.bundle.js.map +1 -0
  107. package/docs-build/4.f741dafe1833630ec8bf.manager.bundle.js +2 -0
  108. package/docs-build/4.f741dafe1833630ec8bf.manager.bundle.js.LICENSE.txt +8 -0
  109. package/docs-build/5.d4de191e7daeefb036ca.manager.bundle.js +1 -0
  110. package/docs-build/6.2b178c5444648ee5c0fa.manager.bundle.js +2 -0
  111. package/docs-build/6.2b178c5444648ee5c0fa.manager.bundle.js.LICENSE.txt +12 -0
  112. package/docs-build/7.7c16aea8ec7ea6e91994.manager.bundle.js +1 -0
  113. package/docs-build/8.52fa838fdf937b29676a.manager.bundle.js +1 -0
  114. package/docs-build/assets/dop.png +0 -0
  115. package/docs-build/assets/historic.png +0 -0
  116. package/docs-build/assets/marker.png +0 -0
  117. package/docs-build/assets/osm.png +0 -0
  118. package/docs-build/assets/sample.gpx +716 -0
  119. package/docs-build/{.gitkeep → catalogue/.gitkeep} +0 -0
  120. package/docs-build/catalogue/mc_meta.json +1 -0
  121. package/docs-build/favicon.ico +0 -0
  122. package/docs-build/iframe.html +348 -0
  123. package/docs-build/index.html +59 -0
  124. package/docs-build/logo.png +0 -0
  125. package/docs-build/main.8a7ec710ea1c16b5e13f.manager.bundle.js +1 -0
  126. package/docs-build/main~24120820.ba6665a8.iframe.bundle.js +2 -0
  127. package/docs-build/main~24120820.ba6665a8.iframe.bundle.js.map +1 -0
  128. package/docs-build/manifest.json +25 -0
  129. package/docs-build/robots.txt +3 -0
  130. package/docs-build/runtime~main.67aa1de2d72f40a81164.manager.bundle.js +1 -0
  131. package/docs-build/static/media/mapcomponents_logo.98b01a05.png +0 -0
  132. package/docs-build/static/media/wg-marker.bf3eeb2d.png +0 -0
  133. package/docs-build/stories.json +331 -0
  134. package/docs-build/thumbnails/MapLibreMap.png +0 -0
  135. package/docs-build/thumbnails/MlCameraFollowPath.png +0 -0
  136. package/docs-build/thumbnails/MlCreatePdfButton.png +0 -0
  137. package/docs-build/thumbnails/MlDeckGlLayer.png +0 -0
  138. package/docs-build/thumbnails/MlDeckGlTerrainLayer.png +0 -0
  139. package/docs-build/thumbnails/MlDemoDashboard.png +0 -0
  140. package/docs-build/thumbnails/MlFeatureEditor.png +0 -0
  141. package/docs-build/thumbnails/MlFillExtrusionLayer.png +0 -0
  142. package/docs-build/thumbnails/MlFollowGps.png +0 -0
  143. package/docs-build/thumbnails/MlGPXViewer.png +0 -0
  144. package/docs-build/thumbnails/MlGeoJsonLayer.png +0 -0
  145. package/docs-build/thumbnails/MlHillshadeLayer.png +0 -0
  146. package/docs-build/thumbnails/MlIconLayer.png +0 -0
  147. package/docs-build/thumbnails/MlLaermkarte.png +0 -0
  148. package/docs-build/thumbnails/MlLayerMagnify.png +0 -0
  149. package/docs-build/thumbnails/MlLayerSwipe.png +0 -0
  150. package/docs-build/thumbnails/MlMapDrawTools.png +0 -0
  151. package/docs-build/thumbnails/MlMobilerImker.png +0 -0
  152. package/docs-build/thumbnails/MlNavigationCompass.png +0 -0
  153. package/docs-build/thumbnails/MlNavigationTools.png +0 -0
  154. package/docs-build/thumbnails/MlOsmLayer.png +0 -0
  155. package/docs-build/thumbnails/MlScaleReference.png +0 -0
  156. package/docs-build/thumbnails/MlSpatialElevationProfile.png +0 -0
  157. package/docs-build/thumbnails/MlThreeJsLayer.png +0 -0
  158. package/docs-build/thumbnails/MlTransitionGeoJsonLayer.png +0 -0
  159. package/docs-build/thumbnails/MlVectorTileLayer.png +0 -0
  160. package/docs-build/thumbnails/MlWanderApp.png +0 -0
  161. package/docs-build/thumbnails/MlWmsLayer.png +0 -0
  162. package/docs-build/thumbnails/MlWmsLoader.png +0 -0
  163. package/docs-build/vendors~main.351900838c49e9200954.manager.bundle.js +2 -0
  164. package/docs-build/vendors~main.351900838c49e9200954.manager.bundle.js.LICENSE.txt +101 -0
  165. package/docs-build/vendors~main~0ad7406a.a6abfed7.iframe.bundle.js +8 -0
  166. package/docs-build/vendors~main~0ad7406a.a6abfed7.iframe.bundle.js.map +1 -0
  167. package/docs-build/vendors~main~0f485567.1d7a15b7.iframe.bundle.js +2 -0
  168. package/docs-build/vendors~main~0f485567.1d7a15b7.iframe.bundle.js.map +1 -0
  169. package/docs-build/vendors~main~41a6ab2c.525ecc56.iframe.bundle.js +2 -0
  170. package/docs-build/vendors~main~41a6ab2c.525ecc56.iframe.bundle.js.map +1 -0
  171. package/docs-build/vendors~main~52589227.1d1558cd.iframe.bundle.js +8 -0
  172. package/docs-build/vendors~main~52589227.1d1558cd.iframe.bundle.js.map +1 -0
  173. package/docs-build/vendors~main~73914085.227c6747.iframe.bundle.js +293 -0
  174. package/docs-build/vendors~main~73914085.227c6747.iframe.bundle.js.map +1 -0
  175. package/docs-build/vendors~main~9c5b28f6.f02cc741.iframe.bundle.js +7 -0
  176. package/docs-build/vendors~main~9c5b28f6.f02cc741.iframe.bundle.js.map +1 -0
  177. package/docs-build/vendors~main~b5906859.4083ac60.iframe.bundle.js +21 -0
  178. package/docs-build/vendors~main~b5906859.4083ac60.iframe.bundle.js.map +1 -0
  179. package/docs-build/vendors~main~b8f44717.7a612c34.iframe.bundle.js +89 -0
  180. package/docs-build/vendors~main~b8f44717.7a612c34.iframe.bundle.js.map +1 -0
  181. package/docs-build/vendors~main~b9cf3951.45da142d.iframe.bundle.js +68 -0
  182. package/docs-build/vendors~main~b9cf3951.45da142d.iframe.bundle.js.map +1 -0
  183. package/docs-build/vendors~main~d939e436.92c27fbf.iframe.bundle.js +2 -0
  184. package/docs-build/vendors~main~d939e436.92c27fbf.iframe.bundle.js.map +1 -0
  185. package/docs-build/vendors~main~dab50aa4.b0d58038.iframe.bundle.js +107 -0
  186. package/docs-build/vendors~main~dab50aa4.b0d58038.iframe.bundle.js.map +1 -0
  187. package/package.json +131 -113
  188. package/public/favicon.ico +0 -0
  189. package/public/logo.png +0 -0
  190. package/rollup.config.js +26 -3
  191. package/scripts/start.js +166 -0
  192. package/scripts/test.js +53 -0
  193. package/src/components/MapLibreMap/MapLibreMap.stories.js +14 -5
  194. package/src/components/MapLibreMap/MapLibreMap.test.js +1 -1
  195. package/src/components/MapLibreMap/{MapLibreMap.js → MapLibreMap.tsx} +40 -37
  196. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.test.js +3 -3
  197. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +636 -0
  198. package/src/components/MlComponentTemplate/MlComponentTemplate.stories.js +0 -2
  199. package/src/components/MlComponentTemplate/MlComponentTemplate.tsx +42 -0
  200. package/src/components/MlCreatePdfButton/MlCreatePdfButton.stories.js +0 -5
  201. package/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx +51 -0
  202. package/src/components/MlCreatePdfButton/lib/{createPdf.js → createPdf.ts} +26 -23
  203. package/src/components/MlCreatePdfButton/lib/{nominatimMap.js → nominatimMap.ts} +3 -3
  204. package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +139 -0
  205. package/src/components/MlFeatureEditor/custom-direct-select-mode.js +12 -8
  206. package/src/components/MlFeatureEditor/custom-polygon-mode.js +9 -5
  207. package/src/components/MlFeatureEditor/custom-select-mode.js +11 -7
  208. package/src/components/MlFeatureEditor/lib/LICENSE.md +18 -0
  209. package/src/components/MlFeatureEditor/lib/common_selectors.js +4 -0
  210. package/src/components/MlFeatureEditor/lib/constants.js +4 -0
  211. package/src/components/MlFeatureEditor/lib/constrain_feature_movement.js +4 -0
  212. package/src/components/MlFeatureEditor/lib/create_midpoint.js +4 -0
  213. package/src/components/MlFeatureEditor/lib/create_supplementary_points.js +4 -0
  214. package/src/components/MlFeatureEditor/lib/create_vertex.js +4 -0
  215. package/src/components/MlFeatureEditor/lib/double_click_zoom.js +4 -0
  216. package/src/components/MlFeatureEditor/lib/euclidean_distance.js +4 -0
  217. package/src/components/MlFeatureEditor/lib/features_at.js +4 -0
  218. package/src/components/MlFeatureEditor/lib/get_features_and_set_cursor.js +4 -0
  219. package/src/components/MlFeatureEditor/lib/is_click.js +4 -0
  220. package/src/components/MlFeatureEditor/lib/is_event_at_coordinates.js +4 -0
  221. package/src/components/MlFeatureEditor/lib/is_tap.js +4 -0
  222. package/src/components/MlFeatureEditor/lib/map_event_to_bounding_box.js +4 -0
  223. package/src/components/MlFeatureEditor/lib/mode_handler.js +4 -0
  224. package/src/components/MlFeatureEditor/lib/mouse_event_point.js +4 -0
  225. package/src/components/MlFeatureEditor/lib/move_features.js +4 -0
  226. package/src/components/MlFeatureEditor/lib/sort_features.js +4 -0
  227. package/src/components/MlFeatureEditor/lib/string_set.js +4 -0
  228. package/src/components/MlFeatureEditor/lib/string_sets_are_equal.js +4 -0
  229. package/src/components/MlFeatureEditor/lib/theme.js +4 -0
  230. package/src/components/MlFeatureEditor/lib/to_dense_array.js +4 -0
  231. package/src/components/MlFeatureEditor/lib/utils.js +4 -0
  232. package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.stories.js +6 -11
  233. package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx +85 -0
  234. package/src/components/MlFollowGps/MlFollowGps.stories.js +0 -2
  235. package/src/components/MlFollowGps/{MlFollowGps.js → MlFollowGps.tsx} +99 -86
  236. package/src/components/MlGPXViewer/{MlGPXViewer.js → MlGPXViewer.tsx} +68 -50
  237. package/src/components/MlGPXViewer/util/GeoJsonContext.ts +13 -0
  238. package/src/components/MlGPXViewer/util/{GeoJsonProvider.js → GeoJsonProvider.tsx} +3 -7
  239. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.js +8 -3
  240. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +106 -0
  241. package/src/components/MlGeoJsonLayer/util/{getDefaultLayerTypeByGeometry.js → getDefaultLayerTypeByGeometry.ts} +6 -1
  242. package/src/components/MlGeoJsonLayer/util/{getDefaultPaintPropsByType.js → getDefaultPaintPropsByType.ts} +1 -1
  243. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.js +1 -4
  244. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx +129 -0
  245. package/src/components/MlLayer/MlLayer.stories.js +0 -2
  246. package/src/components/MlLayer/MlLayer.tsx +48 -0
  247. package/src/components/MlLayerMagnify/MlLayerMagnify.stories.js +3 -3
  248. package/src/components/MlLayerMagnify/{MlLayerMagnify.js → MlLayerMagnify.tsx} +62 -43
  249. package/src/components/MlLayerSwipe/MlLayerSwipe.stories.js +0 -2
  250. package/src/components/MlLayerSwipe/{MlLayerSwipe.js → MlLayerSwipe.tsx} +38 -24
  251. package/src/components/MlLayerSwitcher/MlLayerSwitcher.js +0 -4
  252. package/src/components/MlMarker/MlMarker.tsx +140 -0
  253. package/src/components/MlNavigationCompass/{MlNavigationCompass.js → MlNavigationCompass.tsx} +27 -10
  254. package/src/components/MlNavigationTools/{MlNavigationTools.js → MlNavigationTools.tsx} +37 -32
  255. package/src/components/MlTransitionGeoJsonLayer/{MlTransitionGeoJsonLayer.js → MlTransitionGeoJsonLayer.tsx} +76 -73
  256. package/src/components/MlVectorTileLayer/{MlVectorTileLayer.js → MlVectorTileLayer.tsx} +23 -7
  257. package/src/components/MlWmsLayer/{MlWmsLayer.js → MlWmsLayer.tsx} +22 -7
  258. package/src/components/MlWmsLoader/{MlWmsLoader.js → MlWmsLoader.tsx} +55 -47
  259. package/src/custom.d.tsx +26 -0
  260. package/src/hooks/useLayer.ts +221 -0
  261. package/src/hooks/{useMap.js → useMap.ts} +48 -17
  262. package/src/hooks/{useMapState.js → useMapState.ts} +42 -7
  263. package/src/{index.js → index.ts} +15 -8
  264. package/tsconfig.json +18 -24
  265. package/.env +0 -1
  266. package/.storybook/main.bck.js +0 -56
  267. package/babel.config.json +0 -4
  268. package/coverage/lcov-report/src/translations/english.js.html +0 -94
  269. package/coverage/lcov-report/src/translations/german.js.html +0 -94
  270. package/coverage/lcov-report/src/translations/index.html +0 -131
  271. package/jest.config.json +0 -16
  272. package/jsdoc.json +0 -21
  273. package/public/assets/3D/posttower.gltf +0 -103
  274. package/public/assets/3D/posttower_simple.gltf +0 -103
  275. package/public/assets/3D/posttower_wh.gltf.glb +0 -0
  276. package/public/bee.png +0 -0
  277. package/public/logo192.png +0 -0
  278. package/public/logo512.png +0 -0
  279. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.js +0 -528
  280. package/src/components/MlComponentTemplate/MlComponentTemplate.js +0 -39
  281. package/src/components/MlCreatePdfButton/MlCreatePdfButton.js +0 -52
  282. package/src/components/MlFeatureEditor/MlFeatureEditor.js +0 -119
  283. package/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.js +0 -153
  284. package/src/components/MlGPXViewer/util/GeoJsonContext.js +0 -6
  285. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.js +0 -173
  286. package/src/components/MlImageMarkerLayer/MlImageMarkerLayer.js +0 -75
  287. package/src/components/MlLayer/MlLayer.js +0 -107
  288. package/src/components/MlLayerMagnify/utils/compareMagnify.js +0 -173
  289. package/src/components/MlLayerSwipe/utils/swipeCompare.js +0 -220
  290. package/src/components/MlMarker/MlMarker.js +0 -156
  291. package/src/components/index.js +0 -6
  292. package/src/i18n.js +0 -28
  293. package/src/react-app-env.d.ts +0 -1
  294. package/src/stories/IntroductionCore.stories.mdx +0 -3
  295. package/src/stories/assets/code-brackets.svg +0 -1
  296. package/src/stories/assets/colors.svg +0 -1
  297. package/src/stories/assets/comments.svg +0 -1
  298. package/src/stories/assets/direction.svg +0 -1
  299. package/src/stories/assets/flow.svg +0 -1
  300. package/src/stories/assets/plugin.svg +0 -1
  301. package/src/stories/assets/repo.svg +0 -1
  302. package/src/stories/assets/stackalt.svg +0 -1
  303. package/src/stories/components/ComponentTeaser.js +0 -64
  304. package/src/translations/english.js +0 -4
  305. package/src/translations/german.js +0 -4
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ import useMap from "../../hooks/useMap";
3
+
4
+ import createPdf from "./lib/createPdf";
5
+
6
+ import PrinterIcon from "@mui/icons-material/Print";
7
+ import Button from "@mui/material/Button";
8
+
9
+ interface MlCreatePdfButtonProps {
10
+ /**
11
+ * Id of the target MapLibre instance in mapContext
12
+ */
13
+ mapId?: string;
14
+ /**
15
+ * Id of an existing layer in the mapLibre instance to help specify the layer order
16
+ * This layer will be visually beneath the layer with the "insertBeforeLayer" id.
17
+ */
18
+ insertBeforeLayer?: string;
19
+ }
20
+
21
+ /**
22
+ * Renders a button that will create a PDF version of the current map view (dimensions adjusted to fit Din A4 Paper).
23
+ */
24
+ const MlCreatePdfButton = (props: MlCreatePdfButtonProps) => {
25
+ const mapHook = useMap({
26
+ mapId: props.mapId,
27
+ waitForLayer: props.insertBeforeLayer,
28
+ });
29
+
30
+ return (
31
+ <>
32
+ <Button
33
+ color="primary"
34
+ variant="contained"
35
+ onClick={() => {
36
+ if (mapHook.map) {
37
+ createPdf(mapHook.map, null, () => {});
38
+ }
39
+ }}
40
+ >
41
+ <PrinterIcon />
42
+ </Button>
43
+ </>
44
+ );
45
+ };
46
+
47
+ MlCreatePdfButton.defaultProps = {
48
+ mapId: undefined,
49
+ };
50
+
51
+ export default MlCreatePdfButton;
@@ -1,8 +1,9 @@
1
- import maplibregl from "maplibre-gl";
1
+ import {Map} from "maplibre-gl";
2
2
  import jsPDF from "jspdf";
3
- import nmConverter from "./nominatimMap.js";
3
+ import nmConverter from "./nominatimMap";
4
+ import MapLibreGlWrapper from '../../MapLibreMap/lib/MapLibreGlWrapper'
4
5
 
5
- const toPixels = (length) => {
6
+ const toPixels = (length:number):string => {
6
7
  let conversionFactor = 96;
7
8
 
8
9
  conversionFactor /= 25.4;
@@ -10,7 +11,7 @@ const toPixels = (length) => {
10
11
  return conversionFactor * length + "px";
11
12
  };
12
13
 
13
- const createPdf = (map, locationValue, setLoading) => {
14
+ const createPdf:Function = (map:MapLibreGlWrapper, locationValue:any, setLoading:any) => {
14
15
  setLoading(true);
15
16
 
16
17
  const width = 210;
@@ -27,19 +28,7 @@ const createPdf = (map, locationValue, setLoading) => {
27
28
  container.style.height = toPixels(height);
28
29
  hidden.appendChild(container);
29
30
 
30
- //Render map
31
- var renderMap = new maplibregl.Map({
32
- container: container,
33
- center: map.getCenter(),
34
- zoom: map.getZoom(),
35
- bearing: map.getBearing(),
36
- pitch: map.getPitch(),
37
- interactive: false,
38
- preserveDrawingBuffer: true,
39
- fadeDuration: 0,
40
- attributionControl: false,
41
- });
42
- let style = map.getStyle();
31
+ let style = map.map.getStyle();
43
32
  for (let name in style.sources) {
44
33
  let src = style.sources[name];
45
34
 
@@ -51,7 +40,19 @@ const createPdf = (map, locationValue, setLoading) => {
51
40
  }
52
41
  });
53
42
  }
54
- renderMap.setStyle(style);
43
+ //Render map
44
+ var renderMap = new Map({
45
+ container: container,
46
+ center: map.map.getCenter(),
47
+ zoom: map.map.getZoom(),
48
+ bearing: map.map.getBearing(),
49
+ pitch: map.map.getPitch(),
50
+ interactive: false,
51
+ preserveDrawingBuffer: true,
52
+ fadeDuration: 0,
53
+ attributionControl: false,
54
+ style: style
55
+ });
55
56
 
56
57
  renderMap.once("idle", function () {
57
58
  // TO DO: It is still under development
@@ -76,12 +77,14 @@ const createPdf = (map, locationValue, setLoading) => {
76
77
  const lineHeight = 3.25;
77
78
  const text = locationValue ? nmConverter(locationValue.address) : "";
78
79
  const textChunksSeperator = text.split(",");
79
- const textChunks = [];
80
+ const textChunks:string[] = [];
80
81
 
81
82
  if (textChunks.length) {
82
- textChunksSeperator.forEach((chunk) => {
83
- const limitChunks = chunk.match(/.{1,34}/g);
83
+ textChunksSeperator.forEach((chunk:string) => {
84
+ const limitChunks:(RegExpMatchArray | null) = chunk.match(/.{1,34}/g);
85
+ if(limitChunks){
84
86
  textChunks.push(...limitChunks);
87
+ }
85
88
  });
86
89
  }
87
90
 
@@ -93,7 +96,7 @@ const createPdf = (map, locationValue, setLoading) => {
93
96
  0,
94
97
  210,
95
98
  297,
96
- null,
99
+ undefined,
97
100
  "FAST"
98
101
  );
99
102
 
@@ -144,7 +147,7 @@ const createPdf = (map, locationValue, setLoading) => {
144
147
  offsetY + marginTop + lineHeight * 2 + textChunks.length * 3 + innerMargin * 2,
145
148
  3,
146
149
  3,
147
- null,
150
+ undefined,
148
151
  "FAST"
149
152
  );
150
153
 
@@ -41,10 +41,10 @@ const nmMap = {
41
41
  state: ["state", "province", "state_code"],
42
42
  };
43
43
 
44
- const nmConverter = (nmAddress) => {
45
- const addressArr = [];
44
+ const nmConverter:Function = (nmAddress:any):string => {
45
+ const addressArr:string[] = [];
46
46
  for (let key in nmMap) {
47
- nmMap[key].some((element) => {
47
+ nmMap[key].some((element:string) => {
48
48
  if (nmAddress.hasOwnProperty(element)) {
49
49
  addressArr.push(nmAddress[element]);
50
50
  return true;
@@ -0,0 +1,139 @@
1
+ import React, { useState, useEffect, useRef } from "react";
2
+ import "./MlFeatureEditor.css";
3
+
4
+ import "@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css";
5
+ import MapboxDraw from "@mapbox/mapbox-gl-draw";
6
+ import CustomPolygonMode from "./custom-polygon-mode.js";
7
+ import CustomSelectMode from "./custom-select-mode.js";
8
+ import CustomDirectSelectMode from "./custom-direct-select-mode.js";
9
+
10
+ import useMap from "../../hooks/useMap";
11
+
12
+
13
+ interface MlFeatureEditorProps {
14
+ /**
15
+ * Id of the target MapLibre instance in mapContext
16
+ */
17
+ mapId: string;
18
+ /**
19
+ * Id of an existing layer in the mapLibre instance to help specify the layer order
20
+ * This layer will be visually beneath the layer with the "insertBeforeLayer" id.
21
+ */
22
+ insertBeforeLayer: string;
23
+ /**
24
+ * Input GeoJson data at initialization
25
+ */
26
+ geojson: any;
27
+ /**
28
+ * Callback function that is called each time the GeoJson data within has changed within MlFeatureEditor.
29
+ * First parameter is the new GeoJson feature.
30
+ */
31
+ onChange?: Function
32
+ /**
33
+ * Feature editor mode:
34
+ * - "custom_select" edit features
35
+ * - "custom_polygon" draw Polygon
36
+ * - "draw_point" draw Point
37
+ * - "draw_line_string" draw LineString
38
+ */
39
+ mode?:string
40
+ }
41
+
42
+ /**
43
+ * GeoJson Feature editor that allows to create or manipulate GeoJson data
44
+ */
45
+ const MlFeatureEditor = (props:MlFeatureEditorProps) => {
46
+ const draw = useRef<MapboxDraw>();
47
+ const mapHook = useMap({
48
+ mapId: props.mapId,
49
+ waitForLayer: props.insertBeforeLayer,
50
+ });
51
+ const onChangeRef = useRef(props.onChange);
52
+
53
+ const drawToolsInitialized = useRef(false);
54
+ const [drawToolsReady, setDrawToolsReady] = useState(false);
55
+
56
+ const [mouseUpTrigger, setMouseUpTrigger] = useState(0);
57
+
58
+ const modeChangeHandler = (e:any) => {
59
+ console.log("MlFeatureEditor mode change to " + e.mode);
60
+ //setDrawMode(e.mode);
61
+ };
62
+
63
+ const mouseUpHandler = () => {
64
+ setMouseUpTrigger(Math.random());
65
+ };
66
+
67
+ useEffect(() => {
68
+ if (
69
+ mapHook.map &&
70
+ !drawToolsInitialized.current
71
+ ) {
72
+
73
+ drawToolsInitialized.current = true;
74
+
75
+ if (
76
+ mapHook.map.map.style &&
77
+ mapHook.map.map.getSource("mapbox-gl-draw-cold") &&
78
+ draw.current
79
+ ) {
80
+ // remove old Mapbox-gl-Draw from Mapbox instance when hot-reloading this component during development
81
+ // @ts-ignore
82
+ draw.current?.remove();
83
+ }
84
+
85
+ draw.current = new MapboxDraw({
86
+ displayControlsDefault: false,
87
+ defaultMode: props.mode || "custom_select",
88
+ // @ts-ignore
89
+ modes: Object.assign(
90
+ {
91
+ custom_polygon: CustomPolygonMode,
92
+ custom_select: CustomSelectMode,
93
+ custom_direct_select: CustomDirectSelectMode,
94
+ },
95
+ MapboxDraw.modes
96
+ ),
97
+ });
98
+
99
+ mapHook.map.on("draw.modechange", modeChangeHandler, mapHook.componentId);
100
+
101
+ mapHook.map.addControl(draw.current, "top-left", mapHook.componentId);
102
+
103
+ mapHook.map.on("mouseup", mouseUpHandler, mapHook.componentId);
104
+
105
+ setDrawToolsReady(true);
106
+ }
107
+ }, [mapHook.map, props, drawToolsInitialized]);
108
+
109
+ useEffect(() => {
110
+ if (
111
+ draw.current &&
112
+ props.geojson?.geometry
113
+ ) {
114
+ // @ts-ignore
115
+ draw.current.set({ type: "FeatureCollection", features: [props.geojson] });
116
+ }
117
+ }, [props.geojson, drawToolsReady]);
118
+
119
+ useEffect(() => {
120
+ if (draw.current && mouseUpTrigger) {
121
+ // update drawnFeatures state object
122
+ let currentFeatureCollection = draw.current.getAll();
123
+ if (typeof onChangeRef.current === "function") {
124
+ onChangeRef.current(currentFeatureCollection.features);
125
+ }
126
+ }
127
+ }, [mouseUpTrigger]);
128
+
129
+ useEffect(() => {
130
+ if (props.mode && draw.current) {
131
+ // @ts-ignore
132
+ draw.current.changeMode(props.mode);
133
+ }
134
+ }, [props.mode]);
135
+
136
+ return (<></>);
137
+ }
138
+
139
+ export default MlFeatureEditor;
@@ -1,23 +1,27 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import {
2
6
  noTarget,
3
7
  isOfMetaType,
4
8
  isActiveFeature,
5
9
  isInactiveFeature,
6
10
  isShiftDown,
7
- } from "./lib/common_selectors";
8
- import createSupplementaryPoints from "./lib/create_supplementary_points";
9
- import constrainFeatureMovement from "./lib/constrain_feature_movement";
10
- import doubleClickZoom from "./lib/double_click_zoom";
11
- import * as Constants from "./lib/constants";
12
- import moveFeatures from "./lib/move_features";
13
- import drawUtils from "./lib/utils";
11
+ } from "./lib/common_selectors.js";
12
+ import createSupplementaryPoints from "./lib/create_supplementary_points.js";
13
+ import constrainFeatureMovement from "./lib/constrain_feature_movement.js";
14
+ import doubleClickZoom from "./lib/double_click_zoom.js";
15
+ import * as Constants from "./lib/constants.js";
16
+ import moveFeatures from "./lib/move_features.js";
17
+ import drawUtils from "./lib/utils.js";
14
18
 
15
19
  const isVertex = isOfMetaType(Constants.meta.VERTEX);
16
20
  const isMidpoint = isOfMetaType(Constants.meta.MIDPOINT);
17
21
 
18
22
  const DirectSelect = {};
19
23
 
20
- // INTERNAL FUCNTIONS
24
+ // INTERNAL FUNCTIONS
21
25
 
22
26
  DirectSelect.fireUpdate = function () {
23
27
  this.map.fire(Constants.events.UPDATE, {
@@ -1,8 +1,12 @@
1
- import * as CommonSelectors from "./lib/common_selectors";
2
- import doubleClickZoom from "./lib/double_click_zoom";
3
- import * as Constants from "./lib/constants";
4
- import isEventAtCoordinates from "./lib/is_event_at_coordinates";
5
- import createVertex from "./lib/create_vertex";
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
5
+ import * as CommonSelectors from "./lib/common_selectors.js";
6
+ import doubleClickZoom from "./lib/double_click_zoom.js";
7
+ import * as Constants from "./lib/constants.js";
8
+ import isEventAtCoordinates from "./lib/is_event_at_coordinates.js";
9
+ import createVertex from "./lib/create_vertex.js";
6
10
 
7
11
  const CustomPolygonMode = {};
8
12
 
@@ -1,10 +1,14 @@
1
- import * as CommonSelectors from "./lib/common_selectors";
2
- import doubleClickZoom from "./lib/double_click_zoom";
3
- import * as Constants from "./lib/constants";
4
- import mouseEventPoint from "./lib/mouse_event_point";
5
- import createSupplementaryPoints from "./lib/create_supplementary_points";
6
- import StringSet from "./lib/string_set";
7
- import moveFeatures from "./lib/move_features";
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
5
+ import * as CommonSelectors from "./lib/common_selectors.js";
6
+ import doubleClickZoom from "./lib/double_click_zoom.js";
7
+ import * as Constants from "./lib/constants.js";
8
+ import mouseEventPoint from "./lib/mouse_event_point.js";
9
+ import createSupplementaryPoints from "./lib/create_supplementary_points.js";
10
+ import StringSet from "./lib/string_set.js";
11
+ import moveFeatures from "./lib/move_features.js";
8
12
 
9
13
  const CustomSelectMode = {};
10
14
  CustomSelectMode.onSetup = function (opts) {
@@ -0,0 +1,18 @@
1
+ All code inside of this folder is from https://github.com/mapbox/mapbox-gl-draw
2
+ and licensed under ISC
3
+
4
+ Copyright (c) Mapbox
5
+
6
+ All rights reserved.
7
+
8
+ Permission to use, copy, modify, and/or distribute this software for any
9
+ purpose with or without fee is hereby granted, provided that the above
10
+ copyright notice and this permission notice appear in all copies.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
13
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
15
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
17
+ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
+ PERFORMANCE OF THIS SOFTWARE.
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import * as Constants from "./constants";
2
6
 
3
7
  export function isOfMetaType(type) {
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  export const classes = {
2
6
  CONTROL_BASE: 'mapboxgl-ctrl',
3
7
  CONTROL_PREFIX: 'mapboxgl-ctrl-',
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import extent from "@mapbox/geojson-extent";
2
6
  import * as Constants from "./constants";
3
7
 
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import * as Constants from "./constants";
2
6
 
3
7
  const create_midpoint = function (parent, startVertex, endVertex) {
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import createVertex from "./create_vertex";
2
6
  import createMidpoint from "./create_midpoint";
3
7
  import * as Constants from "./constants";
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import * as Constants from "./constants";
2
6
 
3
7
  /**
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  const doubleClickZoom = {
2
6
  enable(ctx) {
3
7
  setTimeout(() => {
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  export default function(a, b) {
2
6
  const x = a.x - b.x;
3
7
  const y = a.y - b.y;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import sortFeatures from "./sort_features";
2
6
  import mapEventToBoundingBox from "./map_event_to_bounding_box";
3
7
  import * as Constants from "./constants";
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import featuresAt from "./features_at";
2
6
  import * as Constants from "./constants";
3
7
 
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import euclideanDistance from './euclidean_distance';
2
6
 
3
7
  const FINE_TOLERANCE = 4;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  function isEventAtCoordinates(event, coordinates) {
2
6
  if (!event.lngLat) return false;
3
7
  return event.lngLat.lng === coordinates[0] && event.lngLat.lat === coordinates[1];
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import euclideanDistance from './euclidean_distance';
2
6
 
3
7
  export const TAP_TOLERANCE = 25;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  /**
2
6
  * Returns a bounding box representing the event's location.
3
7
  *
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
 
2
6
  const ModeHandler = function(mode, DrawContext) {
3
7
 
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import Point from '@mapbox/point-geometry';
2
6
 
3
7
  /**
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import constrainFeatureMovement from "./constrain_feature_movement";
2
6
  import * as Constants from "./constants";
3
7
 
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  import area from "@mapbox/geojson-area";
2
6
  import * as Constants from "./constants";
3
7
 
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  function StringSet(items) {
2
6
  this._items = {};
3
7
  this._nums = {};
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  export default function(a, b) {
2
6
  if (a.length !== b.length) return false;
3
7
  return JSON.stringify(a.map(id => id).sort()) === JSON.stringify(b.map(id => id).sort());
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  export default [
2
6
  {
3
7
  id: "gl-draw-polygon-fill-inactive",
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  /**
2
6
  * Derive a dense array (no `undefined`s) from a single value or array.
3
7
  *
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Code from https://github.com/mapbox/mapbox-gl-draw
3
+ * and licensed under ISC
4
+ */
1
5
  const drawUtils = {
2
6
  getMatchingVertices: (vertex, featureId, allFeatures, map) => {
3
7
  // number of decimals should probably be dynamic depending on zoom level
@@ -1,6 +1,5 @@
1
- import React from "react";
1
+ import React, {useState} from "react";
2
2
 
3
- import TopToolbar from "../../ui_components/TopToolbar";
4
3
  import MlFillExtrusionLayer from "./MlFillExtrusionLayer";
5
4
 
6
5
  import mapContextDecorator from "../../decorators/MapContextDecorator";
@@ -9,21 +8,17 @@ const storyoptions = {
9
8
  title: "MapComponents/MlFillExtrusionLayer",
10
9
  component: MlFillExtrusionLayer,
11
10
  argTypes: {
12
- options: {
13
- control: {
14
- type: "object",
15
- },
16
- },
17
11
  },
18
12
  decorators: mapContextDecorator,
19
13
  };
20
14
  export default storyoptions;
21
15
 
22
- const Template = (args) => (
23
- <TopToolbar>
24
- <MlFillExtrusionLayer />
25
- </TopToolbar>
16
+ const Template = (props) => {
17
+
18
+ return (
19
+ <MlFillExtrusionLayer {...props} />
26
20
  );
21
+ }
27
22
 
28
23
  export const ExampleConfig = Template.bind({});
29
24
  ExampleConfig.parameters = {};