@mapcomponents/react-maplibre 0.1.61 → 0.1.63

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 (197) hide show
  1. package/.babelrc +21 -2
  2. package/.eslintrc.js +8 -1
  3. package/.storybook/main.js +0 -1
  4. package/.storybook/preview.js +0 -2
  5. package/CHANGELOG.md +23 -0
  6. package/coverage/clover.xml +265 -89
  7. package/coverage/coverage-final.json +14 -6
  8. package/coverage/lcov-report/favicon.png +0 -0
  9. package/coverage/lcov-report/index.html +84 -39
  10. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  11. package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +1 -1
  12. package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
  13. package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +1 -1
  14. package/coverage/lcov-report/src/components/MlCenterPosition/index.html +1 -1
  15. package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
  16. package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
  17. package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx.html +148 -0
  18. package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx.html +2 -8
  19. package/coverage/lcov-report/src/components/MlCreatePdfForm/index.html +22 -7
  20. package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +73 -40
  21. package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +15 -15
  22. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
  23. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
  24. package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +1 -1
  25. package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
  26. package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.tsx.html +9 -3
  27. package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
  28. package/coverage/lcov-report/src/components/MlGPXViewer/index.html +1 -1
  29. package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +59 -29
  30. package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
  31. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js.html +652 -0
  32. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js.html +649 -0
  33. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/index.html +131 -0
  34. package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.tsx.html +1 -1
  35. package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/index.html +1 -1
  36. package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
  37. package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
  38. package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
  39. package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
  40. package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +1 -1
  41. package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
  42. package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +1 -1
  43. package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
  44. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
  45. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
  46. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
  47. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
  48. package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
  49. package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
  50. package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
  51. package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
  52. package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
  53. package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
  54. package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +1 -1
  55. package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
  56. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
  57. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +1 -1
  58. package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
  59. package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
  60. package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
  61. package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
  62. package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
  63. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/ColorPicker.tsx.html +214 -0
  64. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerList.tsx.html +121 -0
  65. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerListItem.tsx.html +412 -0
  66. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx.html +463 -0
  67. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/index.html +161 -0
  68. package/coverage/lcov-report/src/components/MlSketchTool/MlSketchTool.tsx.html +898 -0
  69. package/coverage/lcov-report/src/components/MlSketchTool/index.html +116 -0
  70. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +1 -1
  71. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
  72. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
  73. package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
  74. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +1 -1
  75. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
  76. package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
  77. package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
  78. package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +1 -1
  79. package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +1 -1
  80. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
  81. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
  82. package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +1 -1
  83. package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
  84. package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +1 -1
  85. package/coverage/lcov-report/src/components/MlWmsLoader/index.html +1 -1
  86. package/coverage/lcov-report/src/contexts/MapContext.tsx.html +1 -1
  87. package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
  88. package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
  89. package/coverage/lcov-report/src/contexts/index.html +1 -1
  90. package/coverage/lcov-report/src/hooks/index.html +11 -11
  91. package/coverage/lcov-report/src/hooks/useCameraFollowPath/index.html +1 -1
  92. package/coverage/lcov-report/src/hooks/useCameraFollowPath/useCameraFollowPath.tsx.html +1 -1
  93. package/coverage/lcov-report/src/hooks/useExportMap/index.html +14 -14
  94. package/coverage/lcov-report/src/hooks/useExportMap/index.ts.html +1 -1
  95. package/coverage/lcov-report/src/hooks/useExportMap/lib.ts.html +21 -108
  96. package/coverage/lcov-report/src/hooks/useLayer.ts.html +1 -1
  97. package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +9 -9
  98. package/coverage/lcov-report/src/hooks/useMap.ts.html +1 -1
  99. package/coverage/lcov-report/src/hooks/useMapState.ts.html +1 -1
  100. package/coverage/lcov-report/src/hooks/useSource.ts.html +1 -1
  101. package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
  102. package/coverage/lcov-report/src/index.html +1 -1
  103. package/coverage/lcov-report/src/index.ts.html +5 -2
  104. package/coverage/lcov.info +564 -161
  105. package/cypress/support/commands.ts +37 -0
  106. package/cypress/support/component-index.html +12 -0
  107. package/cypress/support/component.ts +46 -0
  108. package/cypress.config.ts +101 -0
  109. package/dist/components/MapLibreMap/MapLibreMap.d.ts +1 -1
  110. package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +3 -3
  111. package/dist/components/MlCreatePdfForm/MlCreatePdfForm.cy.d.ts +1 -0
  112. package/dist/components/MlCreatePdfForm/MlCreatePdfForm.stories.d.ts +1 -0
  113. package/dist/components/MlCreatePdfForm/lib/PdfContext.d.ts +3 -16
  114. package/dist/components/MlCreatePdfForm/lib/PdfPreview.d.ts +19 -6
  115. package/dist/components/MlCreatePdfForm/lib/_PdfPreview.d.ts +13 -0
  116. package/dist/components/MlFeatureEditor/MlFeatureEditor.d.ts +10 -4
  117. package/dist/components/MlFeatureEditor/lib/double_click_zoom.d.ts +0 -2
  118. package/dist/components/MlFeatureEditor/lib/theme.d.ts +1 -1
  119. package/dist/components/MlGPXViewer/util/GeoJsonContext.d.ts +1 -1
  120. package/dist/components/MlGPXViewer/util/MlGPXViewerInstructions.d.ts +1 -0
  121. package/dist/components/MlGPXViewer/util/SampleLayer.d.ts +0 -0
  122. package/dist/components/MlGPXViewer/util/demoViewer.d.ts +5 -0
  123. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +4 -4
  124. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +103 -11
  125. package/dist/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.d.ts +2 -0
  126. package/dist/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.d.ts +2 -0
  127. package/dist/components/MlSketchTool/LayerList/ColorPicker.d.ts +9 -0
  128. package/dist/components/MlSketchTool/LayerList/LayerList.d.ts +5 -0
  129. package/dist/components/MlSketchTool/LayerList/LayerListItem.d.ts +11 -0
  130. package/dist/components/MlSketchTool/LayerList/LayerPropertyForm.d.ts +9 -0
  131. package/dist/components/MlSketchTool/MlSketchTool.d.ts +29 -0
  132. package/dist/components/MlSketchTool/MlSketchTool.stories.d.ts +10 -0
  133. package/dist/contexts/SimpleDataProvider.d.ts +1 -1
  134. package/dist/custom.d.d.ts +1 -1
  135. package/dist/hooks/useLayer.d.ts +1 -1
  136. package/dist/hooks/useMap.d.ts +1 -1
  137. package/dist/hooks/useMapState.d.ts +3 -3
  138. package/dist/hooks/useSource.d.ts +1 -1
  139. package/dist/index.d.ts +1 -0
  140. package/dist/index.esm.css +1 -1
  141. package/dist/index.esm.js +3473 -4386
  142. package/dist/index.esm.js.map +1 -1
  143. package/dist/ui_components/LoadingOverlayContext.d.ts +1 -1
  144. package/dist/ui_components/Sidebar.d.ts +9 -1
  145. package/dist/ui_components/TopToolbar.d.ts +6 -1
  146. package/package.json +22 -15
  147. package/public/assets/sample1.gpx +3003 -0
  148. package/public/assets/sample2.gpx +1264 -0
  149. package/public/assets/sample3.gpx +912 -0
  150. package/public/index.html +0 -4
  151. package/public/thumbnails/MlSketchTool.png +0 -0
  152. package/public/thumbnails/useCameraFollowPath.png +0 -0
  153. package/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx +21 -0
  154. package/src/components/MlCreatePdfForm/MlCreatePdfForm.stories.tsx +14 -1
  155. package/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx +0 -2
  156. package/src/components/MlCreatePdfForm/lib/PdfContext.tsx +16 -18
  157. package/src/components/MlCreatePdfForm/lib/PdfForm.tsx +79 -6
  158. package/src/components/MlCreatePdfForm/lib/PdfPreview.tsx +285 -357
  159. package/src/components/MlCreatePdfForm/lib/_PdfPreview.tsx +399 -0
  160. package/src/components/MlCreatePdfForm/lib/pdfContext.d.ts +24 -0
  161. package/src/components/MlCreatePdfForm/lib/preview.css +114 -0
  162. package/src/components/MlFeatureEditor/MlFeatureEditor.meta.json +1 -1
  163. package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +39 -28
  164. package/src/components/MlGPXViewer/MlGPXViewer.stories.js +75 -15
  165. package/src/components/MlGPXViewer/MlGPXViewer.tsx +3 -1
  166. package/src/components/MlGPXViewer/util/MlGPXViewerInstructions.js +145 -0
  167. package/src/components/MlGPXViewer/util/SampleLayer.js +2 -0
  168. package/src/components/MlGPXViewer/util/demoViewer.js +254 -0
  169. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.tsx +102 -0
  170. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +33 -23
  171. package/src/components/MlGeoJsonLayer/assets/sample_1.json +138 -24
  172. package/src/components/MlGeoJsonLayer/assets/sample_2.json +140 -20
  173. package/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js +189 -0
  174. package/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js +188 -0
  175. package/src/components/MlSketchTool/LayerList/ColorPicker.tsx +43 -0
  176. package/src/components/MlSketchTool/LayerList/LayerList.tsx +12 -0
  177. package/src/components/MlSketchTool/LayerList/LayerListItem.tsx +109 -0
  178. package/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx +126 -0
  179. package/src/components/MlSketchTool/MlSketchTool.doc.de.md +3 -0
  180. package/src/components/MlSketchTool/MlSketchTool.meta.json +15 -0
  181. package/src/components/MlSketchTool/MlSketchTool.stories.js +26 -0
  182. package/src/components/MlSketchTool/MlSketchTool.tsx +271 -0
  183. package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.meta.json +2 -2
  184. package/src/hooks/useExportMap/lib.ts +14 -43
  185. package/src/index.ts +1 -0
  186. package/src/ui_components/Sidebar.tsx +80 -0
  187. package/src/ui_components/TopToolbar.tsx +24 -0
  188. package/tsconfig.json +39 -58
  189. package/config/getHttpsConfig.js +0 -66
  190. package/config/modules.js +0 -134
  191. package/config/pnpTs.js +0 -35
  192. package/config/webpack.config.js +0 -757
  193. package/config/webpackDevServer.config.js +0 -130
  194. package/scripts/start.js +0 -166
  195. package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.js +0 -66
  196. package/src/ui_components/Sidebar.js +0 -100
  197. package/src/ui_components/TopToolbar.js +0 -29
@@ -0,0 +1,37 @@
1
+ /// <reference types="cypress" />
2
+ // ***********************************************
3
+ // This example commands.ts shows you how to
4
+ // create various custom commands and overwrite
5
+ // existing commands.
6
+ //
7
+ // For more comprehensive examples of custom
8
+ // commands please read more here:
9
+ // https://on.cypress.io/custom-commands
10
+ // ***********************************************
11
+ //
12
+ //
13
+ // -- This is a parent command --
14
+ // Cypress.Commands.add('login', (email, password) => { ... })
15
+ //
16
+ //
17
+ // -- This is a child command --
18
+ // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19
+ //
20
+ //
21
+ // -- This is a dual command --
22
+ // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23
+ //
24
+ //
25
+ // -- This will overwrite an existing command --
26
+ // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27
+ //
28
+ // declare global {
29
+ // namespace Cypress {
30
+ // interface Chainable {
31
+ // login(email: string, password: string): Chainable<void>
32
+ // drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
33
+ // dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34
+ // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
35
+ // }
36
+ // }
37
+ // }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
+ <title>Components App</title>
8
+ </head>
9
+ <body>
10
+ <div data-cy-root></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,46 @@
1
+ // ***********************************************************
2
+ // This example support/component.ts is processed and
3
+ // loaded automatically before your test files.
4
+ //
5
+ // This is a great place to put global configuration and
6
+ // behavior that modifies Cypress.
7
+ //
8
+ // You can change the location of this file or turn off
9
+ // automatically serving support files with the
10
+ // 'supportFile' configuration option.
11
+ //
12
+ // You can read more here:
13
+ // https://on.cypress.io/configuration
14
+ // ***********************************************************
15
+ import { setGlobalConfig } from "@storybook/testing-react";
16
+ import * as sbPreview from "../../.storybook/preview";
17
+
18
+ setGlobalConfig(sbPreview);
19
+
20
+ // Import commands.js using ES2015 syntax:
21
+ import './commands'
22
+
23
+ // Alternatively you can use CommonJS syntax:
24
+ // require('./commands')
25
+
26
+ import { mount } from 'cypress/react'
27
+
28
+ //import MlCreatePdfForm from "../../src/components/MlCreatePdfForm/MlCreatePdfForm";
29
+
30
+ // Augment the Cypress namespace to include type definitions for
31
+ // your custom command.
32
+ // Alternatively, can be defined in cypress/support/component.d.ts
33
+ // with a <reference path="./component" /> at the top of your spec.
34
+ declare global {
35
+ // eslint-disable-next-line @typescript-eslint/no-namespace
36
+ namespace Cypress {
37
+ interface Chainable {
38
+ mount: typeof mount
39
+ }
40
+ }
41
+ }
42
+
43
+ Cypress.Commands.add('mount', mount)
44
+
45
+ // Example use:
46
+ // cy.mount(<MyComponent />)
@@ -0,0 +1,101 @@
1
+ import { defineConfig } from 'cypress';
2
+
3
+ //const isRunningInCI = process.env.CI === 'true';
4
+
5
+ export default defineConfig({
6
+ component: {
7
+ //supportFile: './cypress/support/component.js',
8
+ devServer: {
9
+ framework: 'react',
10
+ bundler: 'webpack',
11
+ webpackConfig: {
12
+ mode: 'development',
13
+ resolve: {
14
+ extensions: ['.mjs', '.js', '.jsx', '.json', '.cjs', '.ts', '.tsx'],
15
+ },
16
+
17
+ module: {
18
+ rules: [
19
+ {
20
+ test: /\.(js|jsx|tsx|ts)$/, // USE THE babel-loader FOR THESE FILE EXTENSIONS
21
+ use: [
22
+ {
23
+ loader: 'babel-loader',
24
+ options: {
25
+ sourceType: 'unambiguous',
26
+ presets: [
27
+ ['@babel/preset-env', { shippedProposals: true, loose: true }],
28
+ '@babel/preset-typescript',
29
+ '@babel/preset-react',
30
+ ],
31
+ plugins: [
32
+ '@babel/plugin-transform-shorthand-properties',
33
+ '@babel/plugin-transform-block-scoping',
34
+ ['@babel/plugin-proposal-decorators', { legacy: true }],
35
+ ['@babel/plugin-proposal-class-properties', { loose: true }],
36
+ ['@babel/plugin-proposal-private-methods', { loose: true }],
37
+ '@babel/plugin-proposal-export-default-from',
38
+ '@babel/plugin-syntax-dynamic-import',
39
+ [
40
+ '@babel/plugin-proposal-object-rest-spread',
41
+ { loose: true, useBuiltIns: true },
42
+ ],
43
+ '@babel/plugin-transform-classes',
44
+ '@babel/plugin-transform-arrow-functions',
45
+ '@babel/plugin-transform-parameters',
46
+ '@babel/plugin-transform-destructuring',
47
+ '@babel/plugin-transform-spread',
48
+ '@babel/plugin-transform-for-of',
49
+ '@storybook/core-common/node_modules/babel-plugin-macros',
50
+ '@babel/plugin-proposal-optional-chaining',
51
+ '@babel/plugin-proposal-nullish-coalescing-operator',
52
+ [
53
+ 'babel-plugin-polyfill-corejs3',
54
+ {
55
+ method: 'usage-global',
56
+ absoluteImports: 'core-js',
57
+ version: '3.21.1',
58
+ },
59
+ ],
60
+ '@babel/plugin-transform-template-literals',
61
+ ],
62
+ babelrc: true,
63
+ configFile: false,
64
+ },
65
+ },
66
+ ],
67
+ exclude: [ /node_modules/, /dist/ ]
68
+ },
69
+ /*{
70
+ test: /\.(ts|tsx)$/,
71
+ exclude: [/node_modules/],
72
+ use: {
73
+ loader: require.resolve('babel-loader'),
74
+ options: {
75
+ plugins: [],
76
+ presets: ['@babel/preset-typescript'],
77
+ babelrc: false,
78
+ },
79
+ },
80
+ },*/
81
+ {
82
+ test: /\.(svg|ico|jpg|jpeg|png|apng|gif|eot|otf|webp|ttf|woff|woff2|cur|ani|pdf)(\?.*)?$/,
83
+ loader: 'file-loader',
84
+ options: { name: 'static/media/[path][name].[ext]' },
85
+ },
86
+ {
87
+ test: /\.css$/,
88
+ use: [
89
+ 'style-loader',
90
+ {
91
+ loader: 'css-loader',
92
+ options: { importLoaders: 1 },
93
+ },
94
+ ],
95
+ },
96
+ ],
97
+ },
98
+ },
99
+ },
100
+ },
101
+ });
@@ -1,7 +1,7 @@
1
1
  import { FC } from "react";
2
2
  import { MapOptions as MapOptionsType } from "maplibre-gl";
3
3
  import "maplibre-gl/dist/maplibre-gl.css";
4
- declare type MapLibreMapProps = {
4
+ type MapLibreMapProps = {
5
5
  /**
6
6
  * Id of the MapLibreGl(Wrapper) instance in mapContext
7
7
  */
@@ -1,13 +1,13 @@
1
1
  import { IControl, MapOptions as MapOptionsType } from "!maplibre-gl";
2
2
  import { Map as MapType } from "maplibre-gl";
3
- declare type EventArgArray = [string, string | Function, Function?];
4
- declare type LayerState = {
3
+ type EventArgArray = [string, string | Function, Function?];
4
+ type LayerState = {
5
5
  id: string;
6
6
  type: string;
7
7
  visible: boolean;
8
8
  baseLayer: boolean;
9
9
  };
10
- declare type ViewportState = {
10
+ type ViewportState = {
11
11
  center: {
12
12
  lng: number;
13
13
  lat: number;
@@ -1,3 +1,4 @@
1
+ import './lib/preview.css';
1
2
  declare const storyoptions: {
2
3
  title: string;
3
4
  component: {
@@ -1,19 +1,6 @@
1
- import React, { MutableRefObject } from 'react';
2
- import { Feature } from '@turf/turf';
3
- interface PdfContextInterface {
4
- format: string;
5
- setFormat: (format: string) => void;
6
- quality: string;
7
- setQuality: (quality: string) => void;
8
- orientation: string;
9
- setOrientation: (orientation: string) => void;
10
- geojsonRef: MutableRefObject<Feature | undefined>;
11
- template: {
12
- width: number;
13
- height: number;
14
- };
15
- }
16
- declare const PdfContext: React.Context<Partial<PdfContextInterface>>;
1
+ import React from 'react';
2
+ import { PdfContextInterface } from './pdfContext';
3
+ declare const PdfContext: React.Context<PdfContextInterface>;
17
4
  declare const PdfContextProvider: ({ children }: {
18
5
  children: React.ReactNode;
19
6
  }) => JSX.Element;
@@ -1,13 +1,26 @@
1
- interface PdfPreviewProps {
1
+ import React from 'react';
2
+ import { PdfPreviewOptions } from './pdfContext';
3
+ import { Feature } from '@turf/turf';
4
+ type Props = {
2
5
  /**
3
6
  * Id of the target MapLibre instance in mapContext
4
7
  */
5
8
  mapId?: string;
6
9
  /**
7
- * Id of an existing layer in the mapLibre instance to help specify the layer order
8
- * This layer will be visually beneath the layer with the "insertBeforeLayer" id.
10
+ * Polygon GeoJson Feature representing the printing area
9
11
  */
10
- insertBeforeLayer?: string;
11
- }
12
- export default function PdfPreview(props: PdfPreviewProps): JSX.Element;
12
+ geojsonRef: React.MutableRefObject<Feature | undefined>;
13
+ /**
14
+ * a state variable containing the PDF previews current state
15
+ */
16
+ options: PdfPreviewOptions;
17
+ /**
18
+ * setter function to update the current PDF preview state
19
+ */
20
+ setOptions: (arg1: (val: PdfPreviewOptions) => PdfPreviewOptions) => void;
21
+ };
22
+ /**
23
+ * PdfPreview component renders a transformable (drag, scale, rotate) preview of the desired export or print content
24
+ */
25
+ export default function PdfPreview(props: Props): JSX.Element;
13
26
  export {};
@@ -0,0 +1,13 @@
1
+ interface PdfPreviewProps {
2
+ /**
3
+ * Id of the target MapLibre instance in mapContext
4
+ */
5
+ mapId?: string;
6
+ /**
7
+ * Id of an existing layer in the mapLibre instance to help specify the layer order
8
+ * This layer will be visually beneath the layer with the "insertBeforeLayer" id.
9
+ */
10
+ insertBeforeLayer?: string;
11
+ }
12
+ export default function PdfPreview(props: PdfPreviewProps): JSX.Element;
13
+ export {};
@@ -1,5 +1,6 @@
1
- import "./MlFeatureEditor.css";
2
- import "@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css";
1
+ import './MlFeatureEditor.css';
2
+ import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
3
+ import { GeoJSONObject, Feature } from '@turf/turf';
3
4
  interface MlFeatureEditorProps {
4
5
  /**
5
6
  * Id of the target MapLibre instance in mapContext
@@ -13,12 +14,17 @@ interface MlFeatureEditorProps {
13
14
  /**
14
15
  * Input GeoJson data at initialization
15
16
  */
16
- geojson?: any;
17
+ geojson?: Feature;
17
18
  /**
18
19
  * Callback function that is called each time the GeoJson data within has changed within MlFeatureEditor.
19
20
  * First parameter is the new GeoJson feature.
20
21
  */
21
- onChange?: Function;
22
+ onChange?: (para: GeoJSONObject[]) => void;
23
+ /**
24
+ * Callback function that is called each time the GeoJson data within has been finished within MlFeatureEditor.
25
+ * First parameter is the new GeoJson feature.
26
+ */
27
+ onFinish?: () => void;
22
28
  /**
23
29
  * Feature editor mode:
24
30
  * - "custom_select" edit features
@@ -1,7 +1,5 @@
1
1
  export default doubleClickZoom;
2
2
  declare namespace doubleClickZoom {
3
3
  function enable(ctx: any): void;
4
- function enable(ctx: any): void;
5
- function disable(ctx: any): void;
6
4
  function disable(ctx: any): void;
7
5
  }
@@ -1,4 +1,4 @@
1
- declare var _default: ({
1
+ declare const _default: ({
2
2
  id: string;
3
3
  type: string;
4
4
  filter: (string | string[])[];
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { FeatureCollection } from '@turf/turf';
3
- declare type ContextProps = {
3
+ type ContextProps = {
4
4
  data: FeatureCollection;
5
5
  setData: Function;
6
6
  getEmptyFeatureCollection: Function;
@@ -0,0 +1 @@
1
+ export default function MlGPXViewerInstructions(props: any): JSX.Element;
@@ -0,0 +1,5 @@
1
+ export default MlGPXDemoLoader;
2
+ /**
3
+ * MlSpatialElevationProfileDemoViewer returns a button to load a Demo GPX Track into the map.
4
+ */
5
+ declare function MlGPXDemoLoader(props: any): JSX.Element;
@@ -1,6 +1,6 @@
1
- import { Feature, FeatureCollection } from "@turf/turf";
2
- import { LineLayerSpecification, CircleLayerSpecification, FillLayerSpecification, MapLayerMouseEvent } from "maplibre-gl";
3
- declare type MlGeoJsonLayerProps = {
1
+ import { Feature, FeatureCollection } from '@turf/turf';
2
+ import { LineLayerSpecification, CircleLayerSpecification, FillLayerSpecification, MapLayerMouseEvent } from 'maplibre-gl';
3
+ type MlGeoJsonLayerProps = {
4
4
  /**
5
5
  * Id of the target MapLibre instance in mapContext
6
6
  */
@@ -24,7 +24,7 @@ declare type MlGeoJsonLayerProps = {
24
24
  * Type of the layer that will be added to the MapLibre instance.
25
25
  * Possible values: "line", "circle", "fill"
26
26
  */
27
- type?: "fill" | "line" | "circle";
27
+ type?: 'fill' | 'line' | 'circle';
28
28
  /**
29
29
  * Paint property object, that is passed to the addLayer call.
30
30
  * Possible props depend on the layer type.
@@ -1,12 +1,104 @@
1
+ declare const storyoptions: {
2
+ title: string;
3
+ component: (props: {
4
+ mapId?: string | undefined;
5
+ insertBeforeLayer?: string | undefined;
6
+ layerId?: string | undefined;
7
+ geojson: import("@turf/turf").Feature<import("@turf/turf").Geometry | import("@turf/turf").GeometryCollection, import("@turf/turf").Properties> | import("@turf/turf").FeatureCollection<import("@turf/turf").Geometry | import("@turf/turf").GeometryCollection, import("@turf/turf").Properties> | undefined;
8
+ type?: "circle" | "line" | "fill" | undefined;
9
+ paint?: {
10
+ "circle-radius"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
11
+ "circle-color"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
12
+ "circle-blur"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
13
+ "circle-opacity"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
14
+ "circle-translate"?: import("maplibre-gl").PropertyValueSpecification<[number, number]> | undefined;
15
+ "circle-translate-anchor"?: import("maplibre-gl").PropertyValueSpecification<"map" | "viewport"> | undefined;
16
+ "circle-pitch-scale"?: import("maplibre-gl").PropertyValueSpecification<"map" | "viewport"> | undefined;
17
+ "circle-pitch-alignment"?: import("maplibre-gl").PropertyValueSpecification<"map" | "viewport"> | undefined;
18
+ "circle-stroke-width"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
19
+ "circle-stroke-color"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
20
+ "circle-stroke-opacity"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
21
+ } | {
22
+ "fill-antialias"?: import("maplibre-gl").PropertyValueSpecification<boolean> | undefined;
23
+ "fill-opacity"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
24
+ "fill-color"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
25
+ "fill-outline-color"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
26
+ "fill-translate"?: import("maplibre-gl").PropertyValueSpecification<[number, number]> | undefined;
27
+ "fill-translate-anchor"?: import("maplibre-gl").PropertyValueSpecification<"map" | "viewport"> | undefined;
28
+ "fill-pattern"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
29
+ } | {
30
+ "line-opacity"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
31
+ "line-color"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
32
+ "line-translate"?: import("maplibre-gl").PropertyValueSpecification<[number, number]> | undefined;
33
+ "line-translate-anchor"?: import("maplibre-gl").PropertyValueSpecification<"map" | "viewport"> | undefined;
34
+ "line-width"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
35
+ "line-gap-width"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
36
+ "line-offset"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
37
+ "line-blur"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
38
+ "line-dasharray"?: import("maplibre-gl").PropertyValueSpecification<number[]> | undefined;
39
+ "line-pattern"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
40
+ "line-gradient"?: import("maplibre-gl").ExpressionSpecification | undefined;
41
+ } | undefined;
42
+ layout?: {
43
+ "circle-sort-key"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
44
+ visibility?: "none" | "visible" | undefined;
45
+ } | {
46
+ "fill-sort-key"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
47
+ visibility?: "none" | "visible" | undefined;
48
+ } | {
49
+ "line-cap"?: import("maplibre-gl").PropertyValueSpecification<"square" | "round" | "butt"> | undefined;
50
+ "line-join"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<"round" | "bevel" | "miter"> | undefined;
51
+ "line-miter-limit"?: import("maplibre-gl").PropertyValueSpecification<number> | undefined;
52
+ "line-round-limit"?: import("maplibre-gl").PropertyValueSpecification<number> | undefined;
53
+ "line-sort-key"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
54
+ visibility?: "none" | "visible" | undefined;
55
+ } | undefined;
56
+ options?: import("maplibre-gl").CircleLayerSpecification | import("maplibre-gl").FillLayerSpecification | import("maplibre-gl").LineLayerSpecification | undefined;
57
+ defaultPaintOverrides?: {
58
+ circle?: {
59
+ "circle-radius"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
60
+ "circle-color"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
61
+ "circle-blur"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
62
+ "circle-opacity"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
63
+ "circle-translate"?: import("maplibre-gl").PropertyValueSpecification<[number, number]> | undefined;
64
+ "circle-translate-anchor"?: import("maplibre-gl").PropertyValueSpecification<"map" | "viewport"> | undefined;
65
+ "circle-pitch-scale"?: import("maplibre-gl").PropertyValueSpecification<"map" | "viewport"> | undefined;
66
+ "circle-pitch-alignment"?: import("maplibre-gl").PropertyValueSpecification<"map" | "viewport"> | undefined;
67
+ "circle-stroke-width"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
68
+ "circle-stroke-color"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
69
+ "circle-stroke-opacity"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
70
+ } | undefined;
71
+ fill?: {
72
+ "fill-antialias"?: import("maplibre-gl").PropertyValueSpecification<boolean> | undefined;
73
+ "fill-opacity"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
74
+ "fill-color"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
75
+ "fill-outline-color"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
76
+ "fill-translate"?: import("maplibre-gl").PropertyValueSpecification<[number, number]> | undefined;
77
+ "fill-translate-anchor"?: import("maplibre-gl").PropertyValueSpecification<"map" | "viewport"> | undefined;
78
+ "fill-pattern"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
79
+ } | undefined;
80
+ line?: {
81
+ "line-opacity"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
82
+ "line-color"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
83
+ "line-translate"?: import("maplibre-gl").PropertyValueSpecification<[number, number]> | undefined;
84
+ "line-translate-anchor"?: import("maplibre-gl").PropertyValueSpecification<"map" | "viewport"> | undefined;
85
+ "line-width"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
86
+ "line-gap-width"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
87
+ "line-offset"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
88
+ "line-blur"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<number> | undefined;
89
+ "line-dasharray"?: import("maplibre-gl").PropertyValueSpecification<number[]> | undefined;
90
+ "line-pattern"?: import("maplibre-gl").DataDrivenPropertyValueSpecification<string> | undefined;
91
+ "line-gradient"?: import("maplibre-gl").ExpressionSpecification | undefined;
92
+ } | undefined;
93
+ } | undefined;
94
+ onHover?: import("maplibre-gl").MapLayerMouseEvent | undefined;
95
+ onClick?: import("maplibre-gl").MapLayerMouseEvent | undefined;
96
+ onLeave?: import("maplibre-gl").MapLayerMouseEvent | undefined;
97
+ }) => JSX.Element;
98
+ argTypes: {};
99
+ decorators: ((Story: any) => JSX.Element)[];
100
+ };
1
101
  export default storyoptions;
2
- export const Linestring: any;
3
- export const Polygon: any;
4
- export const DefaultPaintOverrides: any;
5
- declare namespace storyoptions {
6
- export const title: string;
7
- export { MlGeoJsonLayer as component };
8
- export const argTypes: {};
9
- export { mapContextDecorator as decorators };
10
- }
11
- import MlGeoJsonLayer from "./MlGeoJsonLayer";
12
- import mapContextDecorator from "../../decorators/MapContextDecorator";
102
+ export declare const Linestring: any;
103
+ export declare const Polygon: any;
104
+ export declare const DefaultPaintOverrides: any;
@@ -0,0 +1,2 @@
1
+ export default LineStyler;
2
+ declare function LineStyler(props: any): JSX.Element;
@@ -0,0 +1,2 @@
1
+ export default PolygonStyler;
2
+ declare function PolygonStyler(props: any): JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { paintPropsType } from './LayerPropertyForm';
2
+ type Props = {
3
+ key: string;
4
+ value: string;
5
+ propKey: string;
6
+ setPaintProps: (paintProps: paintPropsType | ((current: paintPropsType) => paintPropsType)) => void;
7
+ };
8
+ export default function PaintPropsColorPicker({ propKey, value, setPaintProps }: Props): JSX.Element;
9
+ export {};
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ children: JSX.Element;
3
+ };
4
+ declare function LayerList({ children }: Props): JSX.Element;
5
+ export default LayerList;
@@ -0,0 +1,11 @@
1
+ type Props = {
2
+ layerComponent: JSX.Element;
3
+ visible: boolean;
4
+ configurable: boolean;
5
+ type?: 'background' | 'background-labels' | 'layer' | 'wms-layer' | 'vector-tile-layer';
6
+ name: string;
7
+ description?: string;
8
+ additionalButtons?: JSX.Element;
9
+ };
10
+ declare function LayerListItem({ layerComponent, visible, type, name, description, configurable, }: Props): JSX.Element;
11
+ export default LayerListItem;
@@ -0,0 +1,9 @@
1
+ import { CircleLayerSpecification, FillLayerSpecification, LineLayerSpecification } from 'maplibre-gl';
2
+ export type paintPropsType = CircleLayerSpecification['paint'] | FillLayerSpecification['paint'] | LineLayerSpecification['paint'];
3
+ type Props = {
4
+ paintProps: paintPropsType;
5
+ setPaintProps: (paintProps: paintPropsType | ((current: paintPropsType) => paintPropsType)) => void;
6
+ layerType: string;
7
+ };
8
+ export default function LayerPropertyForm({ paintProps, setPaintProps }: Props): JSX.Element;
9
+ export {};
@@ -0,0 +1,29 @@
1
+ import { SxProps } from '@mui/system/styleFunctionSx/styleFunctionSx';
2
+ interface MlSketchToolProps {
3
+ /**
4
+ * Id of the target MapLibre instance in mapContext
5
+ */
6
+ mapId?: string;
7
+ /**
8
+ * Id of an existing layer in the mapLibre instance to help specify the layer order
9
+ * This layer will be visually beneath the layer with the "insertBeforeLayer" id.
10
+ */
11
+ insertBeforeLayer?: string;
12
+ /**
13
+ * Style attribute for the button-style
14
+ * https://mui.com/system/getting-started/the-sx-prop/
15
+ */
16
+ buttonStyleOverride?: SxProps;
17
+ }
18
+ /**
19
+ * Component template
20
+ *
21
+ */
22
+ declare const MlSketchTool: {
23
+ (props: MlSketchToolProps): JSX.Element;
24
+ defaultProps: {
25
+ mapId: undefined;
26
+ buttonStyleOverride: {};
27
+ };
28
+ };
29
+ export default MlSketchTool;
@@ -0,0 +1,10 @@
1
+ export default storyoptions;
2
+ export const ExampleConfig: any;
3
+ declare namespace storyoptions {
4
+ export const title: string;
5
+ export { MlSketchTool as component };
6
+ export const argTypes: {};
7
+ export { mapContextDecorator as decorators };
8
+ }
9
+ import MlSketchTool from "./MlSketchTool";
10
+ import mapContextDecorator from "../../decorators/MapContextDecorator";
@@ -2,7 +2,7 @@ export default SimpleDataProvider;
2
2
  declare function SimpleDataProvider(props: any): JSX.Element;
3
3
  declare namespace SimpleDataProvider {
4
4
  namespace propTypes {
5
- const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
5
+ const children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
6
6
  }
7
7
  }
8
8
  import PropTypes from "prop-types";
@@ -7,7 +7,7 @@ declare module "*.js" {
7
7
  const content: any;
8
8
  export default content;
9
9
  }
10
- declare type MapContextType = {
10
+ type MapContextType = {
11
11
  mapIds: [string?];
12
12
  mapExists: Function;
13
13
  maps: [];
@@ -3,7 +3,7 @@ import { SourceSpecification, LayerSpecification } from 'maplibre-gl';
3
3
  import MapLibreGlWrapper from '../components/MapLibreMap/lib/MapLibreGlWrapper';
4
4
  import { MapLayerMouseEvent } from 'maplibre-gl';
5
5
  import { GeoJSONObject } from '@turf/turf';
6
- declare type useLayerType = {
6
+ type useLayerType = {
7
7
  map: MapLibreGlWrapper | undefined;
8
8
  layer: LayerSpecification;
9
9
  layerId: string;
@@ -1,5 +1,5 @@
1
1
  import MapLibreGlWrapper, { LayerState } from "../components/MapLibreMap/lib/MapLibreGlWrapper";
2
- declare type useMapType = {
2
+ type useMapType = {
3
3
  map: MapLibreGlWrapper | undefined;
4
4
  mapIsReady: boolean;
5
5
  componentId: string;