@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.
- package/.babelrc +21 -2
- package/.eslintrc.js +8 -1
- package/.storybook/main.js +0 -1
- package/.storybook/preview.js +0 -2
- package/CHANGELOG.md +23 -0
- package/coverage/clover.xml +265 -89
- package/coverage/coverage-final.json +14 -6
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +84 -39
- 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 +2 -8
- 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 +11 -11
- 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 +14 -14
- package/coverage/lcov-report/src/hooks/useExportMap/index.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/lib.ts.html +21 -108
- package/coverage/lcov-report/src/hooks/useLayer.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +9 -9
- 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 +5 -2
- package/coverage/lcov.info +564 -161
- 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/MlCreatePdfForm.stories.d.ts +1 -0
- package/dist/components/MlCreatePdfForm/lib/PdfContext.d.ts +3 -16
- package/dist/components/MlCreatePdfForm/lib/PdfPreview.d.ts +19 -6
- package/dist/components/MlCreatePdfForm/lib/_PdfPreview.d.ts +13 -0
- 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.d.ts +1 -0
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +3473 -4386
- 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 +22 -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 +14 -1
- package/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx +0 -2
- package/src/components/MlCreatePdfForm/lib/PdfContext.tsx +16 -18
- package/src/components/MlCreatePdfForm/lib/PdfForm.tsx +79 -6
- package/src/components/MlCreatePdfForm/lib/PdfPreview.tsx +285 -357
- package/src/components/MlCreatePdfForm/lib/_PdfPreview.tsx +399 -0
- package/src/components/MlCreatePdfForm/lib/pdfContext.d.ts +24 -0
- package/src/components/MlCreatePdfForm/lib/preview.css +114 -0
- 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/hooks/useExportMap/lib.ts +14 -43
- package/src/index.ts +1 -0
- 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,271 @@
|
|
|
1
|
+
import React, { useState, useCallback } from 'react';
|
|
2
|
+
import PanoramaFishEyeIcon from '@mui/icons-material/PanoramaFishEye';
|
|
3
|
+
import ShowChartIcon from '@mui/icons-material/ShowChart';
|
|
4
|
+
import PentagonIcon from '@mui/icons-material/Pentagon';
|
|
5
|
+
import { Box } from '@mui/system';
|
|
6
|
+
//import useMediaQuery from '@mui/material/useMediaQuery';
|
|
7
|
+
import MlFeatureEditor from '../MlFeatureEditor/MlFeatureEditor';
|
|
8
|
+
import List from '@mui/material/List';
|
|
9
|
+
import EditIcon from '@mui/icons-material/Edit';
|
|
10
|
+
import SettingsIcon from '@mui/icons-material/Settings';
|
|
11
|
+
import MlGeoJsonLayer from '../MlGeoJsonLayer/MlGeoJsonLayer';
|
|
12
|
+
import useMap from '../../hooks/useMap';
|
|
13
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
14
|
+
import * as turf from '@turf/turf';
|
|
15
|
+
import ButtonGroup from '@mui/material/ButtonGroup';
|
|
16
|
+
import IconButton from '@mui/material/IconButton';
|
|
17
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
18
|
+
import LayerListItem from './LayerList/LayerListItem';
|
|
19
|
+
import GpsFixedIcon from '@mui/icons-material/GpsFixed';
|
|
20
|
+
import { Feature } from '@turf/turf';
|
|
21
|
+
import { LngLatLike } from '!maplibre-gl';
|
|
22
|
+
import { SxProps } from '@mui/system/styleFunctionSx/styleFunctionSx';
|
|
23
|
+
|
|
24
|
+
interface MlSketchToolProps {
|
|
25
|
+
/**
|
|
26
|
+
* Id of the target MapLibre instance in mapContext
|
|
27
|
+
*/
|
|
28
|
+
mapId?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Id of an existing layer in the mapLibre instance to help specify the layer order
|
|
31
|
+
* This layer will be visually beneath the layer with the "insertBeforeLayer" id.
|
|
32
|
+
*/
|
|
33
|
+
insertBeforeLayer?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Style attribute for the button-style
|
|
36
|
+
* https://mui.com/system/getting-started/the-sx-prop/
|
|
37
|
+
*/
|
|
38
|
+
buttonStyleOverride?: SxProps;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Component template
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
const MlSketchTool = (props: MlSketchToolProps) => {
|
|
47
|
+
type SketchStateType = {
|
|
48
|
+
selectedGeoJson: Feature | undefined;
|
|
49
|
+
activeGeometryIndex: number;
|
|
50
|
+
geometries: Feature[];
|
|
51
|
+
drawMode: string;
|
|
52
|
+
};
|
|
53
|
+
const mapHook = useMap({
|
|
54
|
+
mapId: props.mapId,
|
|
55
|
+
waitForLayer: props.insertBeforeLayer,
|
|
56
|
+
});
|
|
57
|
+
//const mediaIsMobile = useMediaQuery('(max-width:900px)');
|
|
58
|
+
const [hoveredGeometry, setHoveredGeometry] = useState<Feature>();
|
|
59
|
+
const [sketchState, setSketchState] = useState<SketchStateType>({
|
|
60
|
+
activeGeometryIndex: 0,
|
|
61
|
+
selectedGeoJson: undefined,
|
|
62
|
+
geometries: [],
|
|
63
|
+
drawMode: '',
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const buttonStyle = {
|
|
67
|
+
...props.buttonStyleOverride,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const buttonClickHandler = useCallback(
|
|
71
|
+
(buttonDrawMode: string) => {
|
|
72
|
+
console.log(buttonDrawMode);
|
|
73
|
+
sketchState.drawMode !== buttonDrawMode
|
|
74
|
+
? setSketchState((_sketchTool) => ({
|
|
75
|
+
drawMode: buttonDrawMode,
|
|
76
|
+
geometries: _sketchTool.geometries,
|
|
77
|
+
activeGeometryIndex: 0,
|
|
78
|
+
selectedGeoJson: undefined,
|
|
79
|
+
}))
|
|
80
|
+
: setSketchState((_sketchTool) => ({
|
|
81
|
+
drawMode: '',
|
|
82
|
+
geometries: _sketchTool.geometries,
|
|
83
|
+
activeGeometryIndex: 0,
|
|
84
|
+
selectedGeoJson: undefined,
|
|
85
|
+
}));
|
|
86
|
+
},
|
|
87
|
+
[sketchState]
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const removeGeoJson = (geoJson: Feature): void => {
|
|
91
|
+
setSketchState((_sketchState) => {
|
|
92
|
+
const tempGeometries = [..._sketchState.geometries];
|
|
93
|
+
tempGeometries.splice(tempGeometries.indexOf(geoJson), 1);
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
..._sketchState,
|
|
97
|
+
geometries: tempGeometries,
|
|
98
|
+
activeGeometryIndex: _sketchState.activeGeometryIndex - 1,
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<>
|
|
105
|
+
<Box
|
|
106
|
+
sx={{
|
|
107
|
+
zIndex: 104,
|
|
108
|
+
}}
|
|
109
|
+
>
|
|
110
|
+
<ButtonGroup>
|
|
111
|
+
<Tooltip title={'point'}>
|
|
112
|
+
<IconButton sx={buttonStyle} onClick={() => buttonClickHandler('draw_point')}>
|
|
113
|
+
<PanoramaFishEyeIcon />
|
|
114
|
+
</IconButton>
|
|
115
|
+
</Tooltip>
|
|
116
|
+
<Tooltip title={'Line'}>
|
|
117
|
+
<IconButton sx={buttonStyle} onClick={() => buttonClickHandler('draw_line_string')}>
|
|
118
|
+
<ShowChartIcon />
|
|
119
|
+
</IconButton>
|
|
120
|
+
</Tooltip>
|
|
121
|
+
<Tooltip title={'Polygon'}>
|
|
122
|
+
<IconButton sx={buttonStyle} onClick={() => buttonClickHandler('custom_polygon')}>
|
|
123
|
+
<PentagonIcon />
|
|
124
|
+
</IconButton>
|
|
125
|
+
</Tooltip>
|
|
126
|
+
</ButtonGroup>
|
|
127
|
+
</Box>
|
|
128
|
+
|
|
129
|
+
{sketchState.drawMode && (
|
|
130
|
+
<MlFeatureEditor
|
|
131
|
+
mode={
|
|
132
|
+
sketchState.drawMode === 'edit'
|
|
133
|
+
? sketchState.selectedGeoJson?.geometry?.type === 'LineString'
|
|
134
|
+
? 'simple_select'
|
|
135
|
+
: 'custom_select'
|
|
136
|
+
: sketchState.drawMode
|
|
137
|
+
}
|
|
138
|
+
geojson={sketchState.drawMode === 'edit' ? sketchState.selectedGeoJson : undefined}
|
|
139
|
+
onChange={(feature: object) => {
|
|
140
|
+
setSketchState((_sketchState) => {
|
|
141
|
+
const _geometries = [...sketchState.geometries];
|
|
142
|
+
if (sketchState.drawMode === 'edit' && sketchState.selectedGeoJson) {
|
|
143
|
+
_geometries[_geometries.indexOf(sketchState.selectedGeoJson)] = feature[0];
|
|
144
|
+
} else {
|
|
145
|
+
if (!sketchState.activeGeometryIndex) {
|
|
146
|
+
const tempFeature = feature[0];
|
|
147
|
+
tempFeature.properties.id = tempFeature.id;
|
|
148
|
+
|
|
149
|
+
_geometries.push(tempFeature);
|
|
150
|
+
} else {
|
|
151
|
+
_geometries[sketchState.activeGeometryIndex] = feature[0];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
..._sketchState,
|
|
156
|
+
activeGeometryIndex:
|
|
157
|
+
_sketchState.drawMode !== 'edit' && feature[0].geometry.type !== 'Point'
|
|
158
|
+
? _geometries.length - 1
|
|
159
|
+
: _sketchState.activeGeometryIndex,
|
|
160
|
+
geometries: _geometries,
|
|
161
|
+
};
|
|
162
|
+
});
|
|
163
|
+
}}
|
|
164
|
+
onFinish={() => {
|
|
165
|
+
setSketchState((_sketchState) => ({
|
|
166
|
+
..._sketchState,
|
|
167
|
+
drawMode: '',
|
|
168
|
+
activeGeometryIndex:
|
|
169
|
+
_sketchState.drawMode !== 'draw_point' ? 0 : _sketchState.activeGeometryIndex,
|
|
170
|
+
selectedGeoJson:
|
|
171
|
+
_sketchState.drawMode !== 'draw_point' ? undefined : _sketchState.selectedGeoJson,
|
|
172
|
+
}));
|
|
173
|
+
}}
|
|
174
|
+
/>
|
|
175
|
+
)}
|
|
176
|
+
|
|
177
|
+
<List sx={{ zIndex: 105 }}>
|
|
178
|
+
{sketchState.geometries.map((el) => (
|
|
179
|
+
<>
|
|
180
|
+
<Box key={el.id} sx={{ display: 'flex', flexDirection: 'column' }}>
|
|
181
|
+
<br />
|
|
182
|
+
<Box
|
|
183
|
+
flexDirection={'row'}
|
|
184
|
+
sx={{
|
|
185
|
+
'&:hover': {
|
|
186
|
+
backgroundColor: 'rgb(177, 177, 177, 0.2)',
|
|
187
|
+
},
|
|
188
|
+
}}
|
|
189
|
+
onMouseOver={() => {
|
|
190
|
+
setHoveredGeometry(el);
|
|
191
|
+
}}
|
|
192
|
+
onMouseLeave={() => {
|
|
193
|
+
setHoveredGeometry(undefined);
|
|
194
|
+
}}
|
|
195
|
+
>
|
|
196
|
+
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
|
|
197
|
+
{/* @ts-ignore-next-line */}
|
|
198
|
+
<LayerListItem
|
|
199
|
+
sx={buttonStyle}
|
|
200
|
+
visible={true}
|
|
201
|
+
configurable={true}
|
|
202
|
+
layerComponent={
|
|
203
|
+
<MlGeoJsonLayer mapId={props.mapId} geojson={el} layerId={String(el.id)} />
|
|
204
|
+
}
|
|
205
|
+
type={'layer'}
|
|
206
|
+
name={String(el.id)}
|
|
207
|
+
description={el.geometry.type}
|
|
208
|
+
>
|
|
209
|
+
<SettingsIcon />
|
|
210
|
+
</LayerListItem>
|
|
211
|
+
<IconButton
|
|
212
|
+
onClick={() => {
|
|
213
|
+
mapHook?.map?.map.setCenter(
|
|
214
|
+
el.geometry.type === 'Point'
|
|
215
|
+
? (el.geometry.coordinates as LngLatLike)
|
|
216
|
+
: (turf.centerOfMass(el).geometry.coordinates as LngLatLike)
|
|
217
|
+
);
|
|
218
|
+
}}
|
|
219
|
+
>
|
|
220
|
+
<GpsFixedIcon />
|
|
221
|
+
</IconButton>
|
|
222
|
+
<IconButton
|
|
223
|
+
sx={buttonStyle}
|
|
224
|
+
onClick={() => {
|
|
225
|
+
setSketchState((_sketchState) => ({
|
|
226
|
+
..._sketchState,
|
|
227
|
+
selectedGeoJson: el,
|
|
228
|
+
drawMode: 'edit',
|
|
229
|
+
}));
|
|
230
|
+
}}
|
|
231
|
+
>
|
|
232
|
+
<EditIcon />
|
|
233
|
+
</IconButton>
|
|
234
|
+
<IconButton
|
|
235
|
+
sx={buttonStyle}
|
|
236
|
+
onClick={() => {
|
|
237
|
+
removeGeoJson(el);
|
|
238
|
+
}}
|
|
239
|
+
>
|
|
240
|
+
<DeleteIcon />
|
|
241
|
+
</IconButton>
|
|
242
|
+
</Box>
|
|
243
|
+
</Box>
|
|
244
|
+
</>
|
|
245
|
+
))}
|
|
246
|
+
{hoveredGeometry && (
|
|
247
|
+
<MlGeoJsonLayer
|
|
248
|
+
mapId={props.mapId}
|
|
249
|
+
geojson={{ type: 'FeatureCollection', features: [hoveredGeometry] }}
|
|
250
|
+
type={'line'}
|
|
251
|
+
layerId={'highlightBorder'}
|
|
252
|
+
paint={{
|
|
253
|
+
'line-color': '#dd9900',
|
|
254
|
+
'line-opacity': 0.4,
|
|
255
|
+
'line-width': 10,
|
|
256
|
+
}}
|
|
257
|
+
/>
|
|
258
|
+
)}
|
|
259
|
+
</List>
|
|
260
|
+
{sketchState.drawMode === 'edit' && (
|
|
261
|
+
<Box>Edit {sketchState.selectedGeoJson?.geometry?.type}</Box>
|
|
262
|
+
)}
|
|
263
|
+
</>
|
|
264
|
+
);
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
MlSketchTool.defaultProps = {
|
|
268
|
+
mapId: undefined,
|
|
269
|
+
buttonStyleOverride: {},
|
|
270
|
+
};
|
|
271
|
+
export default MlSketchTool;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Map } from '!maplibre-gl';
|
|
2
2
|
import jsPDF from 'jspdf';
|
|
3
3
|
import MapLibreGlWrapper from '../../components/MapLibreMap/lib/MapLibreGlWrapper';
|
|
4
4
|
|
|
5
|
-
import * as turf from '@turf/turf';
|
|
6
5
|
import { BBox } from '@turf/turf';
|
|
7
6
|
|
|
8
7
|
interface createExportOptions {
|
|
@@ -59,54 +58,26 @@ const createExport = (options: createExportOptions) => {
|
|
|
59
58
|
style: style,
|
|
60
59
|
});
|
|
61
60
|
|
|
62
|
-
let _previewGeojson = turf.bboxPolygon([
|
|
63
|
-
options.bbox[0],
|
|
64
|
-
options.bbox[1],
|
|
65
|
-
options.bbox[2],
|
|
66
|
-
options.bbox[3],
|
|
67
|
-
]);
|
|
68
|
-
_previewGeojson = turf.transformRotate(_previewGeojson, options.bearing);
|
|
69
|
-
|
|
70
|
-
// use original unrotated bbox and bearing 0 to calculate the correct zoom value as the function always adds a padding if used on the rotated feature coordinates
|
|
71
61
|
const bboxCamera = renderMap._cameraForBoxAndBearing(
|
|
72
62
|
[options.bboxUnrotated[0], options.bboxUnrotated[1]],
|
|
73
63
|
[options.bboxUnrotated[2], options.bboxUnrotated[3]],
|
|
74
|
-
|
|
75
|
-
);
|
|
76
|
-
const geometryCamera = renderMap._cameraForBoxAndBearing(
|
|
77
|
-
_previewGeojson.geometry.coordinates[0][0] as LngLatLike,
|
|
78
|
-
_previewGeojson.geometry.coordinates[0][2] as LngLatLike,
|
|
79
|
-
options.bearing
|
|
64
|
+
options.bearing+options.map.map.getBearing()
|
|
80
65
|
);
|
|
81
|
-
geometryCamera.zoom = bboxCamera.zoom;
|
|
82
66
|
|
|
83
|
-
renderMap._fitInternal(
|
|
67
|
+
renderMap._fitInternal(bboxCamera);
|
|
84
68
|
return new Promise<createExportResolverParams>((resolve) => {
|
|
85
|
-
|
|
86
|
-
if (renderMap.getLayer('pdfPreviewGeojsonOutline')) {
|
|
87
|
-
renderMap.setLayoutProperty('pdfPreviewGeojsonOutline', 'visibility', 'none');
|
|
88
|
-
}
|
|
89
|
-
if (renderMap.getLayer('pdfPreviewGeojson')) {
|
|
90
|
-
renderMap.setLayoutProperty('pdfPreviewGeojson', 'visibility', 'none');
|
|
91
|
-
}
|
|
92
|
-
if (renderMap.getLayer('pdfPreviewGeojsonResizeHandle')) {
|
|
93
|
-
renderMap.setLayoutProperty('pdfPreviewGeojsonResizeHandle', 'visibility', 'none');
|
|
94
|
-
}
|
|
95
|
-
if (renderMap.getLayer('pdfPreviewGeojsonRotationHandle')) {
|
|
96
|
-
renderMap.setLayoutProperty('pdfPreviewGeojsonRotationHandle', 'visibility', 'none');
|
|
97
|
-
}
|
|
69
|
+
console.log('before idle');
|
|
98
70
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
});
|
|
71
|
+
renderMap.once('idle', function () {
|
|
72
|
+
const params: createExportResolverParams = {
|
|
73
|
+
...options,
|
|
74
|
+
renderMap,
|
|
75
|
+
hiddenContainer,
|
|
76
|
+
createPdf: (_options?: createJsPdfOptions) =>
|
|
77
|
+
createJsPdf({ ...options, renderMap, hiddenContainer, ..._options }),
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
resolve(params);
|
|
110
81
|
});
|
|
111
82
|
});
|
|
112
83
|
};
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { default as MapLibreMap } from "./components/MapLibreMap/MapLibreMap";
|
|
|
2
2
|
export { default as MlComponentTemplate } from "./components/MlComponentTemplate/MlComponentTemplate";
|
|
3
3
|
export { default as MlCreatePdfButton } from "./components/MlCreatePdfButton/MlCreatePdfButton";
|
|
4
4
|
export { default as MlCreatePdfForm } from "./components/MlCreatePdfForm/MlCreatePdfForm";
|
|
5
|
+
export { default as MlPdfPreview } from "./components/MlCreatePdfForm/lib/PdfPreview";
|
|
5
6
|
export { default as MlFeatureEditor } from "./components/MlFeatureEditor/MlFeatureEditor";
|
|
6
7
|
export { default as MlFillExtrusionLayer } from "./components/MlFillExtrusionLayer/MlFillExtrusionLayer";
|
|
7
8
|
export { default as MlFollowGps } from "./components/MlFollowGps/MlFollowGps";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import Drawer from '@mui/material/Drawer';
|
|
4
|
+
import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
|
|
5
|
+
import MenuIcon from '@mui/icons-material/Menu';
|
|
6
|
+
import { IconButton, PaperProps } from '@mui/material';
|
|
7
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
8
|
+
import Box from '@mui/material/Box';
|
|
9
|
+
import { JsxChildren } from 'typedoc/dist/lib/utils/jsx.elements';
|
|
10
|
+
|
|
11
|
+
const DrawerHeader = styled('div')(() => ({
|
|
12
|
+
display: 'flex',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
interface SidebarProps {
|
|
17
|
+
drawerPaperProps: PaperProps;
|
|
18
|
+
drawerHeaderProps: Headers;
|
|
19
|
+
children: JsxChildren;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default function Sidebar({ drawerPaperProps, drawerHeaderProps, ...props }: SidebarProps) {
|
|
23
|
+
const mediaIsMobile = useMediaQuery('(max-width:900px)');
|
|
24
|
+
|
|
25
|
+
const [drawerOpen, setDrawerOpen] = useState(true);
|
|
26
|
+
|
|
27
|
+
const handleDrawerOpen = () => {
|
|
28
|
+
setDrawerOpen(true);
|
|
29
|
+
};
|
|
30
|
+
const handleDrawerClose = () => {
|
|
31
|
+
setDrawerOpen(false);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
<IconButton
|
|
37
|
+
onClick={handleDrawerOpen}
|
|
38
|
+
style={{
|
|
39
|
+
zIndex: 101,
|
|
40
|
+
position: 'relative',
|
|
41
|
+
padding: '20px',
|
|
42
|
+
}}
|
|
43
|
+
>
|
|
44
|
+
<MenuIcon />
|
|
45
|
+
</IconButton>
|
|
46
|
+
<Drawer
|
|
47
|
+
transitionDuration={0}
|
|
48
|
+
variant="persistent"
|
|
49
|
+
anchor="left"
|
|
50
|
+
open={drawerOpen}
|
|
51
|
+
PaperProps={{
|
|
52
|
+
sx: {
|
|
53
|
+
maxWidth: '20%',
|
|
54
|
+
padding: '40px',
|
|
55
|
+
},
|
|
56
|
+
...drawerPaperProps,
|
|
57
|
+
}}
|
|
58
|
+
sx={{
|
|
59
|
+
flexGrow: 1,
|
|
60
|
+
zIndex: 105,
|
|
61
|
+
position: 'absolute',
|
|
62
|
+
top: 0,
|
|
63
|
+
backgroundColor: '#fafafa',
|
|
64
|
+
display: 'flex',
|
|
65
|
+
flexDirection: 'column',
|
|
66
|
+
maxWidth: mediaIsMobile ? '90vw' : '20vw',
|
|
67
|
+
...(drawerOpen ? {} : { left: mediaIsMobile ? '-90vw' : '-20vw' }),
|
|
68
|
+
}}
|
|
69
|
+
{...props}
|
|
70
|
+
>
|
|
71
|
+
<DrawerHeader {...drawerHeaderProps}>
|
|
72
|
+
<IconButton onClick={handleDrawerClose}>
|
|
73
|
+
<ChevronLeftIcon />
|
|
74
|
+
</IconButton>
|
|
75
|
+
</DrawerHeader>
|
|
76
|
+
<Box>{props.children}</Box>
|
|
77
|
+
</Drawer>
|
|
78
|
+
</>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import AppBar from '@mui/material/AppBar';
|
|
3
|
+
import { Toolbar, AppBarProps, ToolbarProps } from '@mui/material';
|
|
4
|
+
|
|
5
|
+
interface TopToolbarProps extends AppBarProps {
|
|
6
|
+
toolbarProps: ToolbarProps;
|
|
7
|
+
}
|
|
8
|
+
export default function TopToolbar({ toolbarProps, ...props }: TopToolbarProps) {
|
|
9
|
+
return (
|
|
10
|
+
<AppBar
|
|
11
|
+
sx={{
|
|
12
|
+
minHeight: '62px',
|
|
13
|
+
backgroundColor: '#f1f1f1',
|
|
14
|
+
position: 'absolute',
|
|
15
|
+
zIndex: 120,
|
|
16
|
+
}}
|
|
17
|
+
color="primary"
|
|
18
|
+
position="static"
|
|
19
|
+
{...props}
|
|
20
|
+
>
|
|
21
|
+
<Toolbar {...toolbarProps}>{props.children}</Toolbar>
|
|
22
|
+
</AppBar>
|
|
23
|
+
);
|
|
24
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,59 +1,40 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"node_modules/maplibre-gl"
|
|
42
|
-
] // This mapping is relative to "baseUrl"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"include": [
|
|
46
|
-
"src",
|
|
47
|
-
"src/custom.d.tsx"
|
|
48
|
-
],
|
|
49
|
-
"exclude": [
|
|
50
|
-
"node_modules",
|
|
51
|
-
"lib"
|
|
52
|
-
],
|
|
53
|
-
"typedocOptions": {
|
|
54
|
-
"entryPoints": [
|
|
55
|
-
"src/index.ts"
|
|
56
|
-
],
|
|
57
|
-
"out": "docs",
|
|
58
|
-
}
|
|
59
|
-
}
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"checkJs": false,
|
|
4
|
+
"esModuleInterop": true,
|
|
5
|
+
"importHelpers": false,
|
|
6
|
+
"isolatedModules": true,
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"strict": false,
|
|
11
|
+
"types": ["node", "jest", "geojson", "cypress", "./support"],
|
|
12
|
+
"outDir": "build/esm",
|
|
13
|
+
"module": "esnext",
|
|
14
|
+
"target": "es5",
|
|
15
|
+
"lib": ["es6", "dom", "es2016", "es2017"],
|
|
16
|
+
"jsx": "react",
|
|
17
|
+
"declaration": true,
|
|
18
|
+
"declarationDir": "./dist",
|
|
19
|
+
"moduleResolution": "node",
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": true,
|
|
22
|
+
"noImplicitReturns": true,
|
|
23
|
+
"noImplicitThis": true,
|
|
24
|
+
"noImplicitAny": true,
|
|
25
|
+
"strictNullChecks": true,
|
|
26
|
+
"suppressImplicitAnyIndexErrors": true,
|
|
27
|
+
"allowSyntheticDefaultImports": true,
|
|
28
|
+
"allowJs": true,
|
|
29
|
+
"baseUrl": ".",
|
|
30
|
+
"paths": {
|
|
31
|
+
"!maplibre-gl": ["node_modules/maplibre-gl"] // This mapping is relative to "baseUrl"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"include": ["src", "src/custom.d.tsx"],
|
|
35
|
+
"exclude": ["node_modules", "lib"],
|
|
36
|
+
"typedocOptions": {
|
|
37
|
+
"entryPoints": ["src/index.ts"],
|
|
38
|
+
"out": "docs"
|
|
39
|
+
}
|
|
40
|
+
}
|
package/config/getHttpsConfig.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const crypto = require('crypto');
|
|
6
|
-
const chalk = require('react-dev-utils/chalk');
|
|
7
|
-
const paths = require('./paths');
|
|
8
|
-
|
|
9
|
-
// Ensure the certificate and key provided are valid and if not
|
|
10
|
-
// throw an easy to debug error
|
|
11
|
-
function validateKeyAndCerts({ cert, key, keyFile, crtFile }) {
|
|
12
|
-
let encrypted;
|
|
13
|
-
try {
|
|
14
|
-
// publicEncrypt will throw an error with an invalid cert
|
|
15
|
-
encrypted = crypto.publicEncrypt(cert, Buffer.from('test'));
|
|
16
|
-
} catch (err) {
|
|
17
|
-
throw new Error(
|
|
18
|
-
`The certificate "${chalk.yellow(crtFile)}" is invalid.\n${err.message}`
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
// privateDecrypt will throw an error with an invalid key
|
|
24
|
-
crypto.privateDecrypt(key, encrypted);
|
|
25
|
-
} catch (err) {
|
|
26
|
-
throw new Error(
|
|
27
|
-
`The certificate key "${chalk.yellow(keyFile)}" is invalid.\n${
|
|
28
|
-
err.message
|
|
29
|
-
}`
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Read file and throw an error if it doesn't exist
|
|
35
|
-
function readEnvFile(file, type) {
|
|
36
|
-
if (!fs.existsSync(file)) {
|
|
37
|
-
throw new Error(
|
|
38
|
-
`You specified ${chalk.cyan(
|
|
39
|
-
type
|
|
40
|
-
)} in your env, but the file "${chalk.yellow(file)}" can't be found.`
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
return fs.readFileSync(file);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Get the https config
|
|
47
|
-
// Return cert files if provided in env, otherwise just true or false
|
|
48
|
-
function getHttpsConfig() {
|
|
49
|
-
const { SSL_CRT_FILE, SSL_KEY_FILE, HTTPS } = process.env;
|
|
50
|
-
const isHttps = HTTPS === 'true';
|
|
51
|
-
|
|
52
|
-
if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {
|
|
53
|
-
const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
|
|
54
|
-
const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
|
|
55
|
-
const config = {
|
|
56
|
-
cert: readEnvFile(crtFile, 'SSL_CRT_FILE'),
|
|
57
|
-
key: readEnvFile(keyFile, 'SSL_KEY_FILE'),
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
validateKeyAndCerts({ ...config, keyFile, crtFile });
|
|
61
|
-
return config;
|
|
62
|
-
}
|
|
63
|
-
return isHttps;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
module.exports = getHttpsConfig;
|