@mapcomponents/react-maplibre 0.1.62 → 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.
- package/.babelrc +21 -2
- package/.eslintrc.js +8 -1
- package/.storybook/main.js +0 -1
- package/.storybook/preview.js +0 -2
- package/CHANGELOG.md +18 -0
- package/coverage/clover.xml +232 -44
- package/coverage/coverage-final.json +11 -3
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +70 -25
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCenterPosition/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx.html +148 -0
- package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/index.html +22 -7
- package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +73 -40
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +15 -15
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.tsx.html +9 -3
- package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGPXViewer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +59 -29
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js.html +652 -0
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js.html +649 -0
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/index.html +131 -0
- package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/index.html +1 -1
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
- package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
- package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
- package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/ColorPicker.tsx.html +214 -0
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerList.tsx.html +121 -0
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerListItem.tsx.html +412 -0
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx.html +463 -0
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/index.html +161 -0
- package/coverage/lcov-report/src/components/MlSketchTool/MlSketchTool.tsx.html +898 -0
- package/coverage/lcov-report/src/components/MlSketchTool/index.html +116 -0
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +1 -1
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
- package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
- package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +1 -1
- package/coverage/lcov-report/src/contexts/MapContext.tsx.html +1 -1
- package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
- package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
- package/coverage/lcov-report/src/contexts/index.html +1 -1
- package/coverage/lcov-report/src/hooks/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useCameraFollowPath/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useCameraFollowPath/useCameraFollowPath.tsx.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/index.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/lib.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayer.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +1 -1
- package/coverage/lcov-report/src/hooks/useMap.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useMapState.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useSource.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useWms.js.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +1 -1
- package/coverage/lcov.info +514 -89
- package/cypress/support/commands.ts +37 -0
- package/cypress/support/component-index.html +12 -0
- package/cypress/support/component.ts +46 -0
- package/cypress.config.ts +101 -0
- package/dist/components/MapLibreMap/MapLibreMap.d.ts +1 -1
- package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +3 -3
- package/dist/components/MlCreatePdfForm/MlCreatePdfForm.cy.d.ts +1 -0
- package/dist/components/MlCreatePdfForm/lib/PdfPreview.d.ts +1 -1
- package/dist/components/MlFeatureEditor/MlFeatureEditor.d.ts +10 -4
- package/dist/components/MlFeatureEditor/lib/double_click_zoom.d.ts +0 -2
- package/dist/components/MlFeatureEditor/lib/theme.d.ts +1 -1
- package/dist/components/MlGPXViewer/util/GeoJsonContext.d.ts +1 -1
- package/dist/components/MlGPXViewer/util/MlGPXViewerInstructions.d.ts +1 -0
- package/dist/components/MlGPXViewer/util/SampleLayer.d.ts +0 -0
- package/dist/components/MlGPXViewer/util/demoViewer.d.ts +5 -0
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +4 -4
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +103 -11
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.d.ts +2 -0
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.d.ts +2 -0
- package/dist/components/MlSketchTool/LayerList/ColorPicker.d.ts +9 -0
- package/dist/components/MlSketchTool/LayerList/LayerList.d.ts +5 -0
- package/dist/components/MlSketchTool/LayerList/LayerListItem.d.ts +11 -0
- package/dist/components/MlSketchTool/LayerList/LayerPropertyForm.d.ts +9 -0
- package/dist/components/MlSketchTool/MlSketchTool.d.ts +29 -0
- package/dist/components/MlSketchTool/MlSketchTool.stories.d.ts +10 -0
- package/dist/contexts/SimpleDataProvider.d.ts +1 -1
- package/dist/custom.d.d.ts +1 -1
- package/dist/hooks/useLayer.d.ts +1 -1
- package/dist/hooks/useMap.d.ts +1 -1
- package/dist/hooks/useMapState.d.ts +3 -3
- package/dist/hooks/useSource.d.ts +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +2736 -3557
- package/dist/index.esm.js.map +1 -1
- package/dist/ui_components/LoadingOverlayContext.d.ts +1 -1
- package/dist/ui_components/Sidebar.d.ts +9 -1
- package/dist/ui_components/TopToolbar.d.ts +6 -1
- package/package.json +21 -15
- package/public/assets/sample1.gpx +3003 -0
- package/public/assets/sample2.gpx +1264 -0
- package/public/assets/sample3.gpx +912 -0
- package/public/index.html +0 -4
- package/public/thumbnails/MlSketchTool.png +0 -0
- package/public/thumbnails/useCameraFollowPath.png +0 -0
- package/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx +21 -0
- package/src/components/MlCreatePdfForm/MlCreatePdfForm.stories.tsx +1 -3
- package/src/components/MlCreatePdfForm/lib/PdfForm.tsx +1 -1
- package/src/components/MlFeatureEditor/MlFeatureEditor.meta.json +1 -1
- package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +39 -28
- package/src/components/MlGPXViewer/MlGPXViewer.stories.js +75 -15
- package/src/components/MlGPXViewer/MlGPXViewer.tsx +3 -1
- package/src/components/MlGPXViewer/util/MlGPXViewerInstructions.js +145 -0
- package/src/components/MlGPXViewer/util/SampleLayer.js +2 -0
- package/src/components/MlGPXViewer/util/demoViewer.js +254 -0
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.tsx +102 -0
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx +33 -23
- package/src/components/MlGeoJsonLayer/assets/sample_1.json +138 -24
- package/src/components/MlGeoJsonLayer/assets/sample_2.json +140 -20
- package/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js +189 -0
- package/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js +188 -0
- package/src/components/MlSketchTool/LayerList/ColorPicker.tsx +43 -0
- package/src/components/MlSketchTool/LayerList/LayerList.tsx +12 -0
- package/src/components/MlSketchTool/LayerList/LayerListItem.tsx +109 -0
- package/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx +126 -0
- package/src/components/MlSketchTool/MlSketchTool.doc.de.md +3 -0
- package/src/components/MlSketchTool/MlSketchTool.meta.json +15 -0
- package/src/components/MlSketchTool/MlSketchTool.stories.js +26 -0
- package/src/components/MlSketchTool/MlSketchTool.tsx +271 -0
- package/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.meta.json +2 -2
- package/src/ui_components/Sidebar.tsx +80 -0
- package/src/ui_components/TopToolbar.tsx +24 -0
- package/tsconfig.json +39 -58
- package/config/getHttpsConfig.js +0 -66
- package/config/modules.js +0 -134
- package/config/pnpTs.js +0 -35
- package/config/webpack.config.js +0 -757
- package/config/webpackDevServer.config.js +0 -130
- package/scripts/start.js +0 -166
- package/src/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.js +0 -66
- package/src/ui_components/Sidebar.js +0 -100
- package/src/ui_components/TopToolbar.js +0 -29
|
@@ -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
|
-
|
|
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
|
-
|
|
4
|
-
|
|
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
|
-
|
|
10
|
+
type ViewportState = {
|
|
11
11
|
center: {
|
|
12
12
|
lng: number;
|
|
13
13
|
lat: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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?:
|
|
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?:
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function MlGPXViewerInstructions(props: any): JSX.Element;
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Feature, FeatureCollection } from
|
|
2
|
-
import { LineLayerSpecification, CircleLayerSpecification, FillLayerSpecification, MapLayerMouseEvent } from
|
|
3
|
-
|
|
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?:
|
|
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,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,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<
|
|
5
|
+
const children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
import PropTypes from "prop-types";
|
package/dist/custom.d.d.ts
CHANGED
package/dist/hooks/useLayer.d.ts
CHANGED
|
@@ -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
|
-
|
|
6
|
+
type useLayerType = {
|
|
7
7
|
map: MapLibreGlWrapper | undefined;
|
|
8
8
|
layer: LayerSpecification;
|
|
9
9
|
layerId: string;
|
package/dist/hooks/useMap.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PropTypes from "prop-types";
|
|
2
2
|
import { LayerState, ViewportState } from "../components/MapLibreMap/lib/MapLibreGlWrapper";
|
|
3
|
-
|
|
3
|
+
type useMapStateType = {
|
|
4
4
|
layers: (LayerState | undefined)[];
|
|
5
5
|
viewport: ViewportState | undefined;
|
|
6
6
|
};
|
|
@@ -54,8 +54,8 @@ declare namespace useMapState {
|
|
|
54
54
|
*/
|
|
55
55
|
filter: PropTypes.Requireable<PropTypes.InferProps<{
|
|
56
56
|
includeBaseLayers: PropTypes.Requireable<boolean>;
|
|
57
|
-
matchLayerIds: PropTypes.Requireable<string | RegExp
|
|
58
|
-
matchSourceIds: PropTypes.Requireable<string | RegExp
|
|
57
|
+
matchLayerIds: PropTypes.Requireable<NonNullable<string | RegExp | null | undefined>>;
|
|
58
|
+
matchSourceIds: PropTypes.Requireable<NonNullable<string | RegExp | null | undefined>>;
|
|
59
59
|
}>>;
|
|
60
60
|
};
|
|
61
61
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMapType } from "./useMap";
|
|
2
2
|
import MapLibreGlWrapper from "../components/MapLibreMap/lib/MapLibreGlWrapper";
|
|
3
3
|
import { SourceSpecification } from "maplibre-gl";
|
|
4
|
-
|
|
4
|
+
type useSourceType = {
|
|
5
5
|
map: MapLibreGlWrapper | undefined;
|
|
6
6
|
source: SourceSpecification;
|
|
7
7
|
componentId: string;
|