@mapcomponents/react-maplibre 1.0.7 → 1.0.9
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/CHANGELOG.md +16 -0
- package/dist/index.cjs.js +688 -52
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +682 -51
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/MlOgcApiFeatures/MlOgcApiFeatures.d.ts +45 -0
- package/dist/{components → src/components}/MlVectorTileLayer/MlVectorTileLayer.d.ts +4 -1
- package/dist/src/decorators/MapContextReduxStoreDecorator.d.ts +7 -0
- package/dist/{index.d.ts → src/index.d.ts} +38 -0
- package/dist/src/stores/map.store.d.ts +105 -0
- package/dist/{ui_components → src/ui_components}/ColorPicker/ColorPicker.d.ts +0 -2
- package/dist/{ui_components → src/ui_components}/LayerList/util/LayerListItemVectorLayer.d.ts +2 -4
- package/dist/src/ui_components/LayerTree/LayerOnMap.d.ts +7 -0
- package/dist/src/ui_components/LayerTree/LayerTree.d.ts +6 -0
- package/dist/src/ui_components/LayerTree/LayerTreeListItem.d.ts +18 -0
- package/dist/src/ui_components/LayerTree/util/LayerPropertyForm.d.ts +9 -0
- package/dist/src/ui_components/LayerTree/util/input/ColorPicker.d.ts +7 -0
- package/package.json +10 -6
- /package/dist/{components → src/components}/MapLibreMap/MapLibreMap.d.ts +0 -0
- /package/dist/{components → src/components}/MapLibreMap/lib/MapLibreGlWrapper.d.ts +0 -0
- /package/dist/{components → src/components}/MlCenterPosition/MlCenterPosition.d.ts +0 -0
- /package/dist/{components → src/components}/MlClientSearch/MlClientSearch.d.ts +0 -0
- /package/dist/{components → src/components}/MlClientSearch/lib/SearchContext.d.ts +0 -0
- /package/dist/{components → src/components}/MlClientSearch/lib/SearchForm.d.ts +0 -0
- /package/dist/{components → src/components}/MlClientSearch/lib/createGeojsonFeature.d.ts +0 -0
- /package/dist/{components → src/components}/MlComponentTemplate/MlComponentTemplate.d.ts +0 -0
- /package/dist/{components → src/components}/MlCreatePdfButton/MlCreatePdfButton.d.ts +0 -0
- /package/dist/{components → src/components}/MlCreatePdfForm/MlCreatePdfForm.d.ts +0 -0
- /package/dist/{components → src/components}/MlCreatePdfForm/lib/PdfContext.d.ts +0 -0
- /package/dist/{components → src/components}/MlCreatePdfForm/lib/PdfForm.d.ts +0 -0
- /package/dist/{components → src/components}/MlCreatePdfForm/lib/PdfPreview.d.ts +0 -0
- /package/dist/{components → src/components}/MlCreatePdfForm/lib/pdf.templates.d.ts +0 -0
- /package/dist/{components → src/components}/MlCreatePngButton/MlCreatePngButton.d.ts +0 -0
- /package/dist/{components → src/components}/MlFeatureEditor/MlFeatureEditor.d.ts +0 -0
- /package/dist/{components → src/components}/MlFillExtrusionLayer/MlFillExtrusionLayer.d.ts +0 -0
- /package/dist/{components → src/components}/MlFollowGps/MlFollowGps.d.ts +0 -0
- /package/dist/{components → src/components}/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +0 -0
- /package/dist/{components → src/components}/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.d.ts +0 -0
- /package/dist/{components → src/components}/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.d.ts +0 -0
- /package/dist/{components → src/components}/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.d.ts +0 -0
- /package/dist/{components → src/components}/MlGeoJsonLayer/util/getDefaultPaintPropsByType.d.ts +0 -0
- /package/dist/{components → src/components}/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.d.ts +0 -0
- /package/dist/{components → src/components}/MlGpxViewer/MlGpxViewer.d.ts +0 -0
- /package/dist/{components → src/components}/MlGpxViewer/util/GeoJsonContext.d.ts +0 -0
- /package/dist/{components → src/components}/MlGpxViewer/util/GeoJsonProvider.d.ts +0 -0
- /package/dist/{components → src/components}/MlGpxViewer/util/Metadata.d.ts +0 -0
- /package/dist/{components → src/components}/MlGpxViewer/util/MlGpxDemoLoader.d.ts +0 -0
- /package/dist/{components → src/components}/MlGpxViewer/util/MlGpxViewerInstructions.d.ts +0 -0
- /package/dist/{components → src/components}/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +0 -0
- /package/dist/{components → src/components}/MlLayer/MlLayer.d.ts +0 -0
- /package/dist/{components → src/components}/MlLayerMagnify/MlLayerMagnify.d.ts +0 -0
- /package/dist/{components → src/components}/MlLayerSwipe/MlLayerSwipe.d.ts +0 -0
- /package/dist/{components → src/components}/MlLayerSwitcher/MlLayerSwitcher.d.ts +0 -0
- /package/dist/{components → src/components}/MlLayerSwitcher/components/LayerBox.d.ts +0 -0
- /package/dist/{components → src/components}/MlMarker/MlMarker.d.ts +0 -0
- /package/dist/{components → src/components}/MlMeasureTool/MlMeasureTool.d.ts +0 -0
- /package/dist/{components → src/components}/MlMultiMeasureTool/MlMultiMeasureTool.d.ts +0 -0
- /package/dist/{components → src/components}/MlNavigationCompass/MlNavigationCompass.d.ts +0 -0
- /package/dist/{components → src/components}/MlNavigationTools/MlNavigationTools.d.ts +0 -0
- /package/dist/{components → src/components}/MlOrderLayers/MlOrderLayers.d.ts +0 -0
- /package/dist/{components → src/components}/MlScaleReference/MlScaleReference.d.ts +0 -0
- /package/dist/{components → src/components}/MlShareMapState/MlShareMapState.d.ts +0 -0
- /package/dist/{components → src/components}/MlSketchTool/MlSketchTool.d.ts +0 -0
- /package/dist/{components → src/components}/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +0 -0
- /package/dist/{components → src/components}/MlSpatialElevationProfile/util/getElevationData.d.ts +0 -0
- /package/dist/{components → src/components}/MlTemporalController/MlTemporalController.d.ts +0 -0
- /package/dist/{components → src/components}/MlTemporalController/utils/MlTemporalControllerLabels.d.ts +0 -0
- /package/dist/{components → src/components}/MlTemporalController/utils/TemporalControllerPlayer.d.ts +0 -0
- /package/dist/{components → src/components}/MlTemporalController/utils/paintPicker.d.ts +0 -0
- /package/dist/{components → src/components}/MlTemporalController/utils/useFilterData.d.ts +0 -0
- /package/dist/{components → src/components}/MlTerrainLayer/MlTerrainLayer.d.ts +0 -0
- /package/dist/{components → src/components}/MlThreeJsLayer/MlThreeJsLayer.d.ts +0 -0
- /package/dist/{components → src/components}/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +0 -0
- /package/dist/{components → src/components}/MlUseMapDebugger/MlUseMapDebugger.d.ts +0 -0
- /package/dist/{components → src/components}/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.d.ts +0 -0
- /package/dist/{components → src/components}/MlWmsLayer/MlWmsLayer.d.ts +0 -0
- /package/dist/{components → src/components}/MlWmsLoader/MlWmsLoader.d.ts +0 -0
- /package/dist/{components → src/components}/MlWmsLoader/utils/MlWmsLoaderInstructions.d.ts +0 -0
- /package/dist/{components → src/components}/MlWmsLoader/utils/WMSLinks.d.ts +0 -0
- /package/dist/{contexts → src/contexts}/LayerContext.d.ts +0 -0
- /package/dist/{contexts → src/contexts}/MapContext.d.ts +0 -0
- /package/dist/{contexts → src/contexts}/SimpleDataContext.d.ts +0 -0
- /package/dist/{contexts → src/contexts}/SimpleDataProvider.d.ts +0 -0
- /package/dist/{decorators → src/decorators}/EmptyMapDecorator.d.ts +0 -0
- /package/dist/{decorators → src/decorators}/GeoJsonMapDecorator.d.ts +0 -0
- /package/dist/{decorators → src/decorators}/LowZoomDecorator.d.ts +0 -0
- /package/dist/{decorators → src/decorators}/MapContextDecorator.d.ts +0 -0
- /package/dist/{decorators → src/decorators}/MapContextDecoratorHooks.d.ts +0 -0
- /package/dist/{decorators → src/decorators}/MultiMapContextDecorator.d.ts +0 -0
- /package/dist/{decorators → src/decorators}/NoNavToolsDecorator.d.ts +0 -0
- /package/dist/{decorators → src/decorators}/ThemeDecorator.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useAddImage/useAddImage.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useAddProtocol/useAddProtocol.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useCameraFollowPath/useCameraFollowPath.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useExportMap/index.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useExportMap/lib.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useFeatureEditor/useFeatureEditor.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useFeatureEditor/utils/FeatureEditorStyle.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useFitLayerBounds.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useGpx/useGpx.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useLayer.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useLayerContext.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useLayerFilter/useLayerFilter.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useLayerHoverPopup/LayerHoverPopup.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useMap.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useMapState.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useSource.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useWms.d.ts +0 -0
- /package/dist/{omt_styles → src/omt_styles}/bright.d.ts +0 -0
- /package/dist/{omt_styles → src/omt_styles}/config.d.ts +0 -0
- /package/dist/{omt_styles → src/omt_styles}/gruvbox.d.ts +0 -0
- /package/dist/{omt_styles → src/omt_styles}/medieval_kingdom.d.ts +0 -0
- /package/dist/{omt_styles → src/omt_styles}/monokai.d.ts +0 -0
- /package/dist/{omt_styles → src/omt_styles}/oceanic_next.d.ts +0 -0
- /package/dist/{omt_styles → src/omt_styles}/solarized.d.ts +0 -0
- /package/dist/{protocol_handlers → src/protocol_handlers}/csv.d.ts +0 -0
- /package/dist/{protocol_handlers → src/protocol_handlers}/mbtiles.d.ts +0 -0
- /package/dist/{protocol_handlers → src/protocol_handlers}/osm.d.ts +0 -0
- /package/dist/{protocol_handlers → src/protocol_handlers}/topojson.d.ts +0 -0
- /package/dist/{protocol_handlers → src/protocol_handlers}/utils/getProtocolData.d.ts +0 -0
- /package/dist/{protocol_handlers → src/protocol_handlers}/utils/protocolPathParser.d.ts +0 -0
- /package/dist/{protocol_handlers → src/protocol_handlers}/xml.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/AddLayerButton/AddLayerButton.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/AddLayerButton/AddLayerPopup.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/AddLayerButton/LayerConfigForms/GeoJsonLayerForm.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/AddLayerButton/LayerConfigForms/LayerTypeForm.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/AddLayerButton/LayerConfigForms/MbtilesLayerForm.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/AddLayerButton/LayerConfigForms/ProtocolHandlerLayerForm.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/AddLayerButton/LayerConfigForms/WmsLayerForm.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/AddLayerButton/LayerConfigForms/utils/CSVOptionsFomular.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/AddLayerButton/LayerConfigForms/utils/MbtilesLayerPropFormular.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/AddLayerButton/LayerConfigForms/utils/OsmOptionsFomular.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/ColorPicker/transformers.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/ConfirmDialog.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/DemoDescriptions.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/Dropzone.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/ImageLoader.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/LayerList/LayerList.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/LayerList/LayerListFolder.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/LayerList/LayerListItem.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/LayerList/LayerListItemFactory.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/LayerList/util/LayerPropertyForm.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/LayerList/util/SortableContainer.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/LayerList/util/input/ColorPicker.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/LoadingOverlayContext.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/MapcomponentsTheme.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/SelectStyleButton/SelectStyleButton.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/SelectStyleButton/SelectStylePopup.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/Sidebar.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/SpeedDial/SpeedDial.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/TopToolbar.d.ts +0 -0
- /package/dist/{ui_components → src/ui_components}/UploadButton.d.ts +0 -0
- /package/dist/{util → src/util}/BubbleForInstructions.d.ts +0 -0
- /package/dist/{util → src/util}/Instructions.d.ts +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -84,6 +84,8 @@ var SpeedDialAction = require('@mui/material/SpeedDialAction');
|
|
|
84
84
|
var LayersIcon = require('@mui/icons-material/Layers');
|
|
85
85
|
var DesignServicesIcon = require('@mui/icons-material/DesignServices');
|
|
86
86
|
var PictureAsPdfIcon = require('@mui/icons-material/PictureAsPdf');
|
|
87
|
+
var reactRedux = require('react-redux');
|
|
88
|
+
var toolkit = require('@reduxjs/toolkit');
|
|
87
89
|
|
|
88
90
|
function _interopNamespaceDefault(e) {
|
|
89
91
|
var n = Object.create(null);
|
|
@@ -3068,23 +3070,23 @@ MlMeasureTool.defaultProps = {
|
|
|
3068
3070
|
unit: 'kilometers',
|
|
3069
3071
|
};
|
|
3070
3072
|
|
|
3071
|
-
var ListStyled$
|
|
3073
|
+
var ListStyled$3 = material.styled(material.List)({
|
|
3072
3074
|
marginTop: '15px',
|
|
3073
3075
|
});
|
|
3074
3076
|
function LayerList(props) {
|
|
3075
|
-
return React.createElement(ListStyled$
|
|
3077
|
+
return React.createElement(ListStyled$3, null, props === null || props === void 0 ? void 0 : props.children);
|
|
3076
3078
|
}
|
|
3077
3079
|
|
|
3078
|
-
var ListItemStyled$
|
|
3080
|
+
var ListItemStyled$2 = system.styled(material.ListItem)({
|
|
3079
3081
|
paddingRight: 0,
|
|
3080
3082
|
paddingLeft: 0,
|
|
3081
3083
|
paddingTop: 0,
|
|
3082
3084
|
paddingBottom: '4px',
|
|
3083
3085
|
});
|
|
3084
|
-
var ListItemIconStyled = system.styled(material.ListItemIcon)({
|
|
3086
|
+
var ListItemIconStyled$1 = system.styled(material.ListItemIcon)({
|
|
3085
3087
|
minWidth: '30px',
|
|
3086
3088
|
});
|
|
3087
|
-
var IconButtonStyled$
|
|
3089
|
+
var IconButtonStyled$2 = system.styled(material.IconButton)({
|
|
3088
3090
|
marginRight: '0px',
|
|
3089
3091
|
padding: '0px',
|
|
3090
3092
|
});
|
|
@@ -3092,13 +3094,13 @@ var CheckboxStyled$1 = system.styled(material.Checkbox)({
|
|
|
3092
3094
|
padding: 0,
|
|
3093
3095
|
marginRight: '5px',
|
|
3094
3096
|
});
|
|
3095
|
-
var BoxStyled$
|
|
3097
|
+
var BoxStyled$4 = system.styled(system.Box)(function (_a) {
|
|
3096
3098
|
var open = _a.open;
|
|
3097
3099
|
return ({
|
|
3098
3100
|
display: open ? 'block' : 'none',
|
|
3099
3101
|
});
|
|
3100
3102
|
});
|
|
3101
|
-
var ListStyled = system.styled(material.List)({
|
|
3103
|
+
var ListStyled$2 = system.styled(material.List)({
|
|
3102
3104
|
marginLeft: '50px',
|
|
3103
3105
|
});
|
|
3104
3106
|
function LayerListFolder(_a) {
|
|
@@ -3127,9 +3129,9 @@ function LayerListFolder(_a) {
|
|
|
3127
3129
|
return React.createElement(React.Fragment, null);
|
|
3128
3130
|
}, [_visible]);
|
|
3129
3131
|
return (React.createElement(React.Fragment, null,
|
|
3130
|
-
React.createElement(ListItemStyled$
|
|
3131
|
-
React.createElement(ListItemIconStyled, null,
|
|
3132
|
-
React.createElement(IconButtonStyled$
|
|
3132
|
+
React.createElement(ListItemStyled$2, null,
|
|
3133
|
+
React.createElement(ListItemIconStyled$1, null,
|
|
3134
|
+
React.createElement(IconButtonStyled$2, { edge: "end", "aria-label": "open", onClick: function () { return setOpen(!open); } }, open ? React.createElement(iconsMaterial.ExpandMore, null) : React.createElement(iconsMaterial.KeyboardArrowRight, null)),
|
|
3133
3135
|
React.createElement(CheckboxStyled$1, { disabled: setVisible ? false : !visible, checked: setVisible ? visible : localVisible, onClick: function () {
|
|
3134
3136
|
if (setVisible) {
|
|
3135
3137
|
setVisible(function (val) { return !val; });
|
|
@@ -3139,8 +3141,8 @@ function LayerListFolder(_a) {
|
|
|
3139
3141
|
}
|
|
3140
3142
|
} })),
|
|
3141
3143
|
React.createElement(material.ListItemText, { primary: name, variant: "layerlist" })),
|
|
3142
|
-
React.createElement(BoxStyled$
|
|
3143
|
-
React.createElement(ListStyled, { disablePadding: true }, _children))));
|
|
3144
|
+
React.createElement(BoxStyled$4, { open: open },
|
|
3145
|
+
React.createElement(ListStyled$2, { disablePadding: true }, _children))));
|
|
3144
3146
|
}
|
|
3145
3147
|
|
|
3146
3148
|
var converters = {
|
|
@@ -3154,7 +3156,7 @@ var converters = {
|
|
|
3154
3156
|
var ColorPicker = function (_a) {
|
|
3155
3157
|
var convert = _a.convert, props = __rest(_a, ["convert"]);
|
|
3156
3158
|
var _b = React.useState(false), showPicker = _b[0], setShowPicker = _b[1];
|
|
3157
|
-
var
|
|
3159
|
+
var value = (props === null || props === void 0 ? void 0 : props.value) || '';
|
|
3158
3160
|
return (React.createElement(React.Fragment, null,
|
|
3159
3161
|
React.createElement(material.Grid, { container: true, sx: { flexWrap: 'nowrap' } },
|
|
3160
3162
|
React.createElement(material.Grid, { xs: 12, item: true },
|
|
@@ -3181,7 +3183,6 @@ var ColorPicker = function (_a) {
|
|
|
3181
3183
|
React.createElement(reactColor.ChromePicker, { color: value, onChange: function (c) {
|
|
3182
3184
|
var _a;
|
|
3183
3185
|
var newValue = converters[convert](c);
|
|
3184
|
-
setValue(newValue);
|
|
3185
3186
|
(_a = props === null || props === void 0 ? void 0 : props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, newValue);
|
|
3186
3187
|
} }))))));
|
|
3187
3188
|
};
|
|
@@ -3191,7 +3192,7 @@ ColorPicker.defaultProps = {
|
|
|
3191
3192
|
name: 'color',
|
|
3192
3193
|
};
|
|
3193
3194
|
|
|
3194
|
-
function PaintPropsColorPicker(_a) {
|
|
3195
|
+
function PaintPropsColorPicker$1(_a) {
|
|
3195
3196
|
var propKey = _a.propKey, value = _a.value, setPaintProps = _a.setPaintProps;
|
|
3196
3197
|
return (React.createElement(ColorPicker, { value: value, label: "Color", onChange: function (value) {
|
|
3197
3198
|
setPaintProps(function (current) {
|
|
@@ -3202,7 +3203,7 @@ function PaintPropsColorPicker(_a) {
|
|
|
3202
3203
|
} }));
|
|
3203
3204
|
}
|
|
3204
3205
|
|
|
3205
|
-
var PaperStyled = material.styled(material.Paper)({
|
|
3206
|
+
var PaperStyled$1 = material.styled(material.Paper)({
|
|
3206
3207
|
marginLeft: '-100px',
|
|
3207
3208
|
marginRight: '-21px',
|
|
3208
3209
|
paddingLeft: '53px',
|
|
@@ -3210,10 +3211,10 @@ var PaperStyled = material.styled(material.Paper)({
|
|
|
3210
3211
|
boxShadow: 'none',
|
|
3211
3212
|
backgroundColor: 'rgb(0, 0, 0, 0)',
|
|
3212
3213
|
});
|
|
3213
|
-
var BoxStyled$
|
|
3214
|
+
var BoxStyled$3 = material.styled(material.Box)({
|
|
3214
3215
|
marginLeft: '61px',
|
|
3215
3216
|
});
|
|
3216
|
-
var mapPropKeyToFormInputType = {
|
|
3217
|
+
var mapPropKeyToFormInputType$1 = {
|
|
3217
3218
|
'circle-color': 'colorpicker',
|
|
3218
3219
|
'circle-radius': 'slider',
|
|
3219
3220
|
'circle-stroke-color': 'colorpicker',
|
|
@@ -3224,8 +3225,8 @@ var mapPropKeyToFormInputType = {
|
|
|
3224
3225
|
'line-width': 'slider',
|
|
3225
3226
|
'line-blur': 'slider',
|
|
3226
3227
|
};
|
|
3227
|
-
var mapPropKeyToFormInputTypeKeys = Object.keys(mapPropKeyToFormInputType);
|
|
3228
|
-
var inputPropsByPropKey = {
|
|
3228
|
+
var mapPropKeyToFormInputTypeKeys$1 = Object.keys(mapPropKeyToFormInputType$1);
|
|
3229
|
+
var inputPropsByPropKey$1 = {
|
|
3229
3230
|
'circle-stroke-width': {
|
|
3230
3231
|
step: 1,
|
|
3231
3232
|
min: 1,
|
|
@@ -3247,18 +3248,18 @@ var inputPropsByPropKey = {
|
|
|
3247
3248
|
max: 100,
|
|
3248
3249
|
},
|
|
3249
3250
|
};
|
|
3250
|
-
function LayerPropertyForm(_a) {
|
|
3251
|
+
function LayerPropertyForm$1(_a) {
|
|
3251
3252
|
var _b = _a.paintProps, paintProps = _b === void 0 ? {} : _b, setPaintProps = _a.setPaintProps;
|
|
3252
3253
|
var key = React.useRef(Math.round(Math.random() * 10000000000));
|
|
3253
3254
|
var getFormInputByType = React.useCallback(function (key) {
|
|
3254
|
-
if (mapPropKeyToFormInputTypeKeys.indexOf(key) !== -1 &&
|
|
3255
|
+
if (mapPropKeyToFormInputTypeKeys$1.indexOf(key) !== -1 &&
|
|
3255
3256
|
(typeof paintProps[key] === 'number' || typeof paintProps[key] === 'string')) {
|
|
3256
3257
|
var label = (React.createElement(material.Typography, { id: key + '_label', gutterBottom: true }, key));
|
|
3257
|
-
switch (mapPropKeyToFormInputType[key]) {
|
|
3258
|
+
switch (mapPropKeyToFormInputType$1[key]) {
|
|
3258
3259
|
case 'slider':
|
|
3259
3260
|
return (React.createElement(React.Fragment, { key: key },
|
|
3260
3261
|
label,
|
|
3261
|
-
React.createElement(material.Slider, __assign({}, inputPropsByPropKey[key], { inputProps: { inputMode: 'decimal', pattern: '[0-9]*' }, value: paintProps[key], valueLabelDisplay: "auto", onChange: function (_ev, value) {
|
|
3262
|
+
React.createElement(material.Slider, __assign({}, inputPropsByPropKey$1[key], { inputProps: { inputMode: 'decimal', pattern: '[0-9]*' }, value: paintProps[key], valueLabelDisplay: "auto", onChange: function (_ev, value) {
|
|
3262
3263
|
if (value) {
|
|
3263
3264
|
setPaintProps(function (current) {
|
|
3264
3265
|
var _a;
|
|
@@ -3282,24 +3283,24 @@ function LayerPropertyForm(_a) {
|
|
|
3282
3283
|
return (React.createElement(React.Fragment, { key: key },
|
|
3283
3284
|
label,
|
|
3284
3285
|
React.createElement(material.Box, { sx: { '& > div': { width: 'initial !important' } } },
|
|
3285
|
-
React.createElement(PaintPropsColorPicker, { key: key, value: paintProps[key], propKey: key, setPaintProps: setPaintProps }))));
|
|
3286
|
+
React.createElement(PaintPropsColorPicker$1, { key: key, value: paintProps[key], propKey: key, setPaintProps: setPaintProps }))));
|
|
3286
3287
|
}
|
|
3287
3288
|
}
|
|
3288
3289
|
return null;
|
|
3289
3290
|
}, [paintProps]);
|
|
3290
3291
|
return (React.createElement(React.Fragment, null,
|
|
3291
|
-
React.createElement(PaperStyled, null,
|
|
3292
|
+
React.createElement(PaperStyled$1, null,
|
|
3292
3293
|
React.createElement(material.ListItem, { key: key + '_paintPropForm' },
|
|
3293
|
-
React.createElement(BoxStyled$
|
|
3294
|
+
React.createElement(BoxStyled$3, null, Object.keys(paintProps).map(function (el) { return getFormInputByType(el); }))))));
|
|
3294
3295
|
}
|
|
3295
3296
|
|
|
3296
|
-
var ListItemStyled = material.styled(material.ListItem)(function (configurable) { return ({
|
|
3297
|
+
var ListItemStyled$1 = material.styled(material.ListItem)(function (configurable) { return ({
|
|
3297
3298
|
paddingRight: configurable ? '56px' : 0,
|
|
3298
3299
|
paddingLeft: 0,
|
|
3299
3300
|
paddingTop: 0,
|
|
3300
3301
|
paddingBottom: '4px',
|
|
3301
3302
|
}); });
|
|
3302
|
-
var TuneIconButton$
|
|
3303
|
+
var TuneIconButton$2 = material.styled(material.IconButton)({
|
|
3303
3304
|
padding: '4px',
|
|
3304
3305
|
marginTop: '-3px',
|
|
3305
3306
|
});
|
|
@@ -3344,7 +3345,7 @@ function LayerListItemVectorLayer(_a) {
|
|
|
3344
3345
|
}
|
|
3345
3346
|
}, [paintProps, id, setVtProps, vtProps]);
|
|
3346
3347
|
return (React.createElement(React.Fragment, null,
|
|
3347
|
-
React.createElement(ListItemStyled, { key: id, secondaryAction: configurable ? (React.createElement(TuneIconButton$
|
|
3348
|
+
React.createElement(ListItemStyled$1, { key: id, secondaryAction: configurable ? (React.createElement(TuneIconButton$2, { edge: "end", "aria-label": "comments", onClick: function () {
|
|
3348
3349
|
setPaintPropsFormVisible(function (current) {
|
|
3349
3350
|
return !current;
|
|
3350
3351
|
});
|
|
@@ -3355,7 +3356,7 @@ function LayerListItemVectorLayer(_a) {
|
|
|
3355
3356
|
setVisible(function (val) { return !val; });
|
|
3356
3357
|
} })),
|
|
3357
3358
|
React.createElement(material.ListItemText, { primary: vtProps.layers[id].id, variant: "layerlist" })),
|
|
3358
|
-
configurable && paintPropsFormVisible && (React.createElement(LayerPropertyForm, { paintProps: paintProps, setPaintProps: setPaintProps, layerType: vtProps.layers[id].type }))));
|
|
3359
|
+
configurable && paintPropsFormVisible && (React.createElement(LayerPropertyForm$1, { paintProps: paintProps, setPaintProps: setPaintProps, layerType: vtProps.layers[id].type }))));
|
|
3359
3360
|
}
|
|
3360
3361
|
LayerListItemVectorLayer.defaultProps = {
|
|
3361
3362
|
configurable: true,
|
|
@@ -3387,11 +3388,11 @@ function SortableContainer(_a) {
|
|
|
3387
3388
|
return (React.createElement("li", __assign({ ref: setNodeRef, style: style }, attributes, listeners), children));
|
|
3388
3389
|
}
|
|
3389
3390
|
|
|
3390
|
-
var TuneIconButton = material.styled(material.IconButton)({
|
|
3391
|
+
var TuneIconButton$1 = material.styled(material.IconButton)({
|
|
3391
3392
|
padding: '4px',
|
|
3392
3393
|
marginTop: '-3px',
|
|
3393
3394
|
});
|
|
3394
|
-
var DeleteIconButton = material.styled(material.IconButton)({
|
|
3395
|
+
var DeleteIconButton$1 = material.styled(material.IconButton)({
|
|
3395
3396
|
marginLeft: '20px',
|
|
3396
3397
|
});
|
|
3397
3398
|
function LayerListItem(_a) {
|
|
@@ -3448,7 +3449,7 @@ function LayerListItem(_a) {
|
|
|
3448
3449
|
var _layerComponent = React.useMemo(function () {
|
|
3449
3450
|
var _a;
|
|
3450
3451
|
if (layerComponent && type === 'layer') {
|
|
3451
|
-
switch (layerComponent.type.
|
|
3452
|
+
switch (layerComponent.type.displayName) {
|
|
3452
3453
|
case 'MlWmsLayer':
|
|
3453
3454
|
return React.cloneElement(layerComponent, __assign(__assign({}, layerComponent === null || layerComponent === void 0 ? void 0 : layerComponent.props), { visible: _visible }));
|
|
3454
3455
|
case 'MlVectorTileLayer':
|
|
@@ -3476,9 +3477,9 @@ function LayerListItem(_a) {
|
|
|
3476
3477
|
}
|
|
3477
3478
|
return undefined;
|
|
3478
3479
|
}, [layerComponent]);
|
|
3479
|
-
var listContent = (React.createElement(ListItemStyled, { sx: __assign({}, props.listItemSx), secondaryAction: configurable && ((_h = Object.keys(paintProps)) === null || _h === void 0 ? void 0 : _h.length) > 0 ? (React.createElement(React.Fragment, null, props === null || props === void 0 ? void 0 :
|
|
3480
|
+
var listContent = (React.createElement(ListItemStyled$1, { sx: __assign({}, props.listItemSx), secondaryAction: configurable && ((_h = Object.keys(paintProps)) === null || _h === void 0 ? void 0 : _h.length) > 0 ? (React.createElement(React.Fragment, null, props === null || props === void 0 ? void 0 :
|
|
3480
3481
|
props.buttons,
|
|
3481
|
-
React.createElement(TuneIconButton, { edge: 'end', "aria-label": "settings", onClick: function () {
|
|
3482
|
+
React.createElement(TuneIconButton$1, { edge: 'end', "aria-label": "settings", onClick: function () {
|
|
3482
3483
|
setPaintPropsFormVisible(function (current) {
|
|
3483
3484
|
return !current;
|
|
3484
3485
|
});
|
|
@@ -3498,7 +3499,7 @@ function LayerListItem(_a) {
|
|
|
3498
3499
|
configurable &&
|
|
3499
3500
|
paintPropsFormVisible && (React.createElement(React.Fragment, null,
|
|
3500
3501
|
props.showDeleteButton && (React.createElement(React.Fragment, null,
|
|
3501
|
-
React.createElement(DeleteIconButton, { edge: "end", "aria-label": "delete", onClick: function () {
|
|
3502
|
+
React.createElement(DeleteIconButton$1, { edge: "end", "aria-label": "delete", onClick: function () {
|
|
3502
3503
|
if (typeof setLayerState === 'function') {
|
|
3503
3504
|
setShowDeletionConfirmationDialog(true);
|
|
3504
3505
|
}
|
|
@@ -3513,7 +3514,7 @@ function LayerListItem(_a) {
|
|
|
3513
3514
|
}, onCancel: function () {
|
|
3514
3515
|
setShowDeletionConfirmationDialog(false);
|
|
3515
3516
|
}, title: "Delete layer", text: "Are you sure you want to delete this layer?" })))),
|
|
3516
|
-
React.createElement(LayerPropertyForm, { paintProps: paintProps, setPaintProps: setPaintProps, layerType: layerType }))),
|
|
3517
|
+
React.createElement(LayerPropertyForm$1, { paintProps: paintProps, setPaintProps: setPaintProps, layerType: layerType }))),
|
|
3517
3518
|
((_m = layerComponent === null || layerComponent === void 0 ? void 0 : layerComponent.props) === null || _m === void 0 ? void 0 : _m.layers) && (React.createElement(LayerListFolder, { visible: localVisible, setVisible: setLocalVisible, name: name }, (_q = (_p = (_o = layerComponent === null || layerComponent === void 0 ? void 0 : layerComponent.props) === null || _o === void 0 ? void 0 : _o.layers) === null || _p === void 0 ? void 0 : _p.map) === null || _q === void 0 ? void 0 : _q.call(_p, function (_el, idx) { return (React.createElement(LayerListItemVectorLayer, { vtProps: layerComponent === null || layerComponent === void 0 ? void 0 : layerComponent.props, setVtProps: setLayerState, id: '' + idx, key: '' + idx, visibleMaster: _visible })); })))));
|
|
3518
3519
|
}
|
|
3519
3520
|
LayerListItem.defaultProps = {
|
|
@@ -3821,7 +3822,7 @@ var SvgCompassBackground = function SvgCompassBackground(props) {
|
|
|
3821
3822
|
})));
|
|
3822
3823
|
};
|
|
3823
3824
|
|
|
3824
|
-
var BoxStyled = material.styled(material.Box)(function (_a) {
|
|
3825
|
+
var BoxStyled$2 = material.styled(material.Box)(function (_a) {
|
|
3825
3826
|
var _b;
|
|
3826
3827
|
var theme = _a.theme;
|
|
3827
3828
|
return (_b = {
|
|
@@ -3922,7 +3923,7 @@ var MlNavigationCompass = function (props) {
|
|
|
3922
3923
|
}
|
|
3923
3924
|
};
|
|
3924
3925
|
return (React.createElement(React.Fragment, null,
|
|
3925
|
-
React.createElement(BoxStyled, { sx: __assign({}, props.style) },
|
|
3926
|
+
React.createElement(BoxStyled$2, { sx: __assign({}, props.style) },
|
|
3926
3927
|
React.createElement(CompassBox, { onClick: rotate, sx: __assign({}, props.backgroundStyle) },
|
|
3927
3928
|
React.createElement(SvgCompassBackground, { style: { position: 'absolute', top: 0, left: 0 } }),
|
|
3928
3929
|
React.createElement(NeedleBox, { onClick: rotate, sx: __assign({}, props.needleStyle) },
|
|
@@ -5775,6 +5776,75 @@ var MlVectorTileLayer = function (props) {
|
|
|
5775
5776
|
return React.createElement(React.Fragment, null);
|
|
5776
5777
|
};
|
|
5777
5778
|
|
|
5779
|
+
var MlOgcApiFeatures = function (props) {
|
|
5780
|
+
var _a;
|
|
5781
|
+
var _b = React.useState(), geojson = _b[0], setGeojson = _b[1];
|
|
5782
|
+
var mapHook = useMap({ mapId: props.mapId });
|
|
5783
|
+
var layerId = React.useRef(((_a = props.mlGeoJsonLayerProps) === null || _a === void 0 ? void 0 : _a.layerId) || 'MlOgcApiFeature-' + mapHook.componentId);
|
|
5784
|
+
var buildOgcApiUrl = function () {
|
|
5785
|
+
var _a, _b;
|
|
5786
|
+
var url = new URL(props.ogcApiUrl);
|
|
5787
|
+
if (props.ogcApiFeatureParams) {
|
|
5788
|
+
Object.entries(props.ogcApiFeatureParams).forEach(function (_a) {
|
|
5789
|
+
var key = _a[0], value = _a[1];
|
|
5790
|
+
if (value !== undefined && value !== null) {
|
|
5791
|
+
url.searchParams.append(key, value.toString());
|
|
5792
|
+
}
|
|
5793
|
+
});
|
|
5794
|
+
}
|
|
5795
|
+
if (props.reloadFeaturesOnMapMove) {
|
|
5796
|
+
var southWest = (_a = mapHook === null || mapHook === void 0 ? void 0 : mapHook.map) === null || _a === void 0 ? void 0 : _a.getBounds().getSouthWest();
|
|
5797
|
+
var northEast = (_b = mapHook === null || mapHook === void 0 ? void 0 : mapHook.map) === null || _b === void 0 ? void 0 : _b.getBounds().getNorthEast();
|
|
5798
|
+
var bbox = "".concat(southWest === null || southWest === void 0 ? void 0 : southWest.lng, ",").concat(southWest === null || southWest === void 0 ? void 0 : southWest.lat, ",").concat(northEast === null || northEast === void 0 ? void 0 : northEast.lng, ",").concat(northEast === null || northEast === void 0 ? void 0 : northEast.lat);
|
|
5799
|
+
url.searchParams.append('bbox', bbox);
|
|
5800
|
+
}
|
|
5801
|
+
return url.toString();
|
|
5802
|
+
};
|
|
5803
|
+
React.useEffect(function () {
|
|
5804
|
+
if (!mapHook.map)
|
|
5805
|
+
return;
|
|
5806
|
+
var getDataHandler = function () {
|
|
5807
|
+
var generatedOgcApiUrl = buildOgcApiUrl();
|
|
5808
|
+
fetch(generatedOgcApiUrl)
|
|
5809
|
+
.then(function (res) {
|
|
5810
|
+
if (!res.ok)
|
|
5811
|
+
throw new Error('Error fetching OGC features');
|
|
5812
|
+
return res.json();
|
|
5813
|
+
})
|
|
5814
|
+
.then(function (data) {
|
|
5815
|
+
setGeojson(data);
|
|
5816
|
+
})
|
|
5817
|
+
.catch(function (error) {
|
|
5818
|
+
console.log(error);
|
|
5819
|
+
setGeojson(undefined);
|
|
5820
|
+
});
|
|
5821
|
+
};
|
|
5822
|
+
getDataHandler();
|
|
5823
|
+
if (props.reloadFeaturesOnMapMove) {
|
|
5824
|
+
mapHook.map.on('moveend', getDataHandler);
|
|
5825
|
+
}
|
|
5826
|
+
return function () {
|
|
5827
|
+
var _a;
|
|
5828
|
+
if ((_a = mapHook === null || mapHook === void 0 ? void 0 : mapHook.map) === null || _a === void 0 ? void 0 : _a.off) {
|
|
5829
|
+
mapHook.map.off('moveend', getDataHandler);
|
|
5830
|
+
}
|
|
5831
|
+
};
|
|
5832
|
+
}, [mapHook.map, props.ogcApiFeatureParams, props.ogcApiUrl]);
|
|
5833
|
+
React.useEffect(function () {
|
|
5834
|
+
// if layer is not yet on map return
|
|
5835
|
+
if (!mapHook.map || !mapHook.map.map.style.getLayer(layerId.current))
|
|
5836
|
+
return;
|
|
5837
|
+
// if layer is already on map: toggle layer visibility by changing the layout object's visibility property
|
|
5838
|
+
if (props.visible) {
|
|
5839
|
+
mapHook.map.map.setLayoutProperty(layerId.current, 'visibility', 'visible');
|
|
5840
|
+
}
|
|
5841
|
+
else {
|
|
5842
|
+
mapHook.map.map.setLayoutProperty(layerId.current, 'visibility', 'none');
|
|
5843
|
+
}
|
|
5844
|
+
}, [props.visible, mapHook.map]);
|
|
5845
|
+
return (React.createElement(React.Fragment, null, geojson && (React.createElement(MlGeoJsonLayer, __assign({ geojson: geojson, layerId: layerId.current }, props.mlGeoJsonLayerProps)))));
|
|
5846
|
+
};
|
|
5847
|
+
|
|
5778
5848
|
/**
|
|
5779
5849
|
* TODO: Add short & useful description
|
|
5780
5850
|
*
|
|
@@ -7663,7 +7733,7 @@ SimpleDataProvider.propTypes = {
|
|
|
7663
7733
|
children: PropTypes.node.isRequired,
|
|
7664
7734
|
};
|
|
7665
7735
|
|
|
7666
|
-
var IconButtonStyled = material.styled(material.IconButton)({
|
|
7736
|
+
var IconButtonStyled$1 = material.styled(material.IconButton)({
|
|
7667
7737
|
padding: '4px',
|
|
7668
7738
|
marginTop: '-3px',
|
|
7669
7739
|
background: 'none',
|
|
@@ -7766,15 +7836,15 @@ function LayerListItemFactory(props) {
|
|
|
7766
7836
|
switch (layer.type) {
|
|
7767
7837
|
case 'geojson':
|
|
7768
7838
|
return (React.createElement(LayerListItem, { key: layer.id, layerId: layer.id, sortable: props.sortable, name: (layer === null || layer === void 0 ? void 0 : layer.name) || ((_a = layer === null || layer === void 0 ? void 0 : layer.config) === null || _a === void 0 ? void 0 : _a.type) + ' layer' || 'unnamed layer', layerComponent: React.createElement(MlGeoJsonLayer, __assign({}, layer.config, { mapId: props === null || props === void 0 ? void 0 : props.mapId, layerId: layer.id, insertBeforeLayer: 'content_order_' + (layers.length - 1 - idx) })), buttons: React.createElement(React.Fragment, null,
|
|
7769
|
-
React.createElement(IconButtonStyled, { disabled: idx === layers.length - 1, onClick: function () {
|
|
7839
|
+
React.createElement(IconButtonStyled$1, { disabled: idx === layers.length - 1, onClick: function () {
|
|
7770
7840
|
layerContext.moveDown(layer.id || '');
|
|
7771
7841
|
} },
|
|
7772
7842
|
React.createElement(iconsMaterial.ArrowCircleDown, null)),
|
|
7773
|
-
React.createElement(IconButtonStyled, { disabled: idx === 0, onClick: function () {
|
|
7843
|
+
React.createElement(IconButtonStyled$1, { disabled: idx === 0, onClick: function () {
|
|
7774
7844
|
layerContext.moveUp(layer.id || '');
|
|
7775
7845
|
} },
|
|
7776
7846
|
React.createElement(iconsMaterial.ArrowCircleUp, null)),
|
|
7777
|
-
React.createElement(IconButtonStyled, { onClick: function () { return fitLayer(layer); } },
|
|
7847
|
+
React.createElement(IconButtonStyled$1, { onClick: function () { return fitLayer(layer); } },
|
|
7778
7848
|
React.createElement(iconsMaterial.CenterFocusWeak, null))), setLayerState: function (layerConfig) {
|
|
7779
7849
|
return setLayers === null || setLayers === void 0 ? void 0 : setLayers(function (current) {
|
|
7780
7850
|
var _layers = __spreadArray([], current, true);
|
|
@@ -7812,28 +7882,28 @@ function LayerListItemFactory(props) {
|
|
|
7812
7882
|
return _layers;
|
|
7813
7883
|
});
|
|
7814
7884
|
}, showDeleteButton: true, buttons: React.createElement(React.Fragment, null,
|
|
7815
|
-
React.createElement(IconButtonStyled, { disabled: idx === layers.length - 1, onClick: function () {
|
|
7885
|
+
React.createElement(IconButtonStyled$1, { disabled: idx === layers.length - 1, onClick: function () {
|
|
7816
7886
|
layerContext.moveDown(layer.id || '');
|
|
7817
7887
|
} },
|
|
7818
7888
|
React.createElement(iconsMaterial.ArrowCircleDown, null)),
|
|
7819
|
-
React.createElement(IconButtonStyled, { disabled: idx === 0, onClick: function () {
|
|
7889
|
+
React.createElement(IconButtonStyled$1, { disabled: idx === 0, onClick: function () {
|
|
7820
7890
|
layerContext.moveUp(layer.id || '');
|
|
7821
7891
|
} },
|
|
7822
7892
|
React.createElement(iconsMaterial.ArrowCircleUp, null)),
|
|
7823
|
-
React.createElement(IconButtonStyled, { onClick: function () { return fitLayer(layer); } },
|
|
7893
|
+
React.createElement(IconButtonStyled$1, { onClick: function () { return fitLayer(layer); } },
|
|
7824
7894
|
React.createElement(iconsMaterial.CenterFocusWeak, null))) }))));
|
|
7825
7895
|
case 'vt':
|
|
7826
7896
|
return (React.createElement(React.Fragment, { key: (layer === null || layer === void 0 ? void 0 : layer.id) + '_listItem' },
|
|
7827
7897
|
React.createElement(LayerListItem, { key: layer.id, name: (layer === null || layer === void 0 ? void 0 : layer.name) || (layer === null || layer === void 0 ? void 0 : layer.type) + ' layer' || 'unnamed layer', layerComponent: React.createElement(MlVectorTileLayer, { layers: ((_c = layer === null || layer === void 0 ? void 0 : layer.config) === null || _c === void 0 ? void 0 : _c.layers) || [], key: layer.id, mapId: layer === null || layer === void 0 ? void 0 : layer.config.mapId, sourceOptions: (_d = layer === null || layer === void 0 ? void 0 : layer.config) === null || _d === void 0 ? void 0 : _d.sourceOptions, layerId: layer.id, url: (_e = layer === null || layer === void 0 ? void 0 : layer.config) === null || _e === void 0 ? void 0 : _e.url }), buttons: React.createElement(React.Fragment, null,
|
|
7828
|
-
React.createElement(IconButtonStyled, { key: layer.id + '_button1', disabled: idx === layers.length - 1, onClick: function () {
|
|
7898
|
+
React.createElement(IconButtonStyled$1, { key: layer.id + '_button1', disabled: idx === layers.length - 1, onClick: function () {
|
|
7829
7899
|
layerContext.moveDown(layer.id || '');
|
|
7830
7900
|
} },
|
|
7831
7901
|
React.createElement(iconsMaterial.ArrowCircleDown, null)),
|
|
7832
|
-
React.createElement(IconButtonStyled, { key: layer.id + '_button2', disabled: idx === 0, onClick: function () {
|
|
7902
|
+
React.createElement(IconButtonStyled$1, { key: layer.id + '_button2', disabled: idx === 0, onClick: function () {
|
|
7833
7903
|
layerContext.moveUp(layer.id || '');
|
|
7834
7904
|
} },
|
|
7835
7905
|
React.createElement(iconsMaterial.ArrowCircleUp, null)),
|
|
7836
|
-
React.createElement(IconButtonStyled, { onClick: function () { return fitLayer(layer); } },
|
|
7906
|
+
React.createElement(IconButtonStyled$1, { onClick: function () { return fitLayer(layer); } },
|
|
7837
7907
|
React.createElement(iconsMaterial.CenterFocusWeak, null))), setLayerState: function (layerConfig) {
|
|
7838
7908
|
return setLayers === null || setLayers === void 0 ? void 0 : setLayers(function (current) {
|
|
7839
7909
|
var _layers = __spreadArray([], current, true);
|
|
@@ -21184,10 +21254,571 @@ SpeedDial.defaultProps = {
|
|
|
21184
21254
|
mapId: undefined,
|
|
21185
21255
|
};
|
|
21186
21256
|
|
|
21257
|
+
var _a;
|
|
21258
|
+
function processLayerOrderItems(action, items, parent) {
|
|
21259
|
+
items.forEach(function (item) {
|
|
21260
|
+
action(item, parent);
|
|
21261
|
+
if (item.layers && item.layers.length > 0) {
|
|
21262
|
+
processLayerOrderItems(action, item.layers, item);
|
|
21263
|
+
}
|
|
21264
|
+
});
|
|
21265
|
+
}
|
|
21266
|
+
var initialState = {
|
|
21267
|
+
mapConfigs: {},
|
|
21268
|
+
};
|
|
21269
|
+
//@ts-ignore
|
|
21270
|
+
var mapConfigSlice = toolkit.createSlice({
|
|
21271
|
+
name: 'mapConfig',
|
|
21272
|
+
initialState: initialState,
|
|
21273
|
+
reducers: {
|
|
21274
|
+
// Add or update a MapConfig
|
|
21275
|
+
setMapConfig: function (state, action) {
|
|
21276
|
+
var mapConfig = action.payload.mapConfig;
|
|
21277
|
+
var key = action.payload.key;
|
|
21278
|
+
//@ts-ignore
|
|
21279
|
+
state.mapConfigs[key] = mapConfig;
|
|
21280
|
+
},
|
|
21281
|
+
// Remove a MapConfig by its uuid
|
|
21282
|
+
removeMapConfig: function (state, action) {
|
|
21283
|
+
delete state.mapConfigs[action.payload.key];
|
|
21284
|
+
},
|
|
21285
|
+
// Add or update a layer within a MapConfig
|
|
21286
|
+
setLayerInMapConfig: function (state, action) {
|
|
21287
|
+
var _a = action.payload, mapConfigKey = _a.mapConfigKey, updatedLayer = _a.layer;
|
|
21288
|
+
var mapConfig = state.mapConfigs[mapConfigKey];
|
|
21289
|
+
if (mapConfig) {
|
|
21290
|
+
for (var i = 0; i < mapConfig.layers.length; i++) {
|
|
21291
|
+
if (mapConfig.layers[i].uuid === updatedLayer.uuid) {
|
|
21292
|
+
mapConfig.layers[i] = updatedLayer;
|
|
21293
|
+
break;
|
|
21294
|
+
}
|
|
21295
|
+
}
|
|
21296
|
+
}
|
|
21297
|
+
},
|
|
21298
|
+
// Remove a layer from a MapConfig
|
|
21299
|
+
removeLayerFromMapConfig: function (state, action) {
|
|
21300
|
+
var _a = action.payload, mapConfigKey = _a.mapConfigKey, layerUuid = _a.layerUuid;
|
|
21301
|
+
var mapConfig = state.mapConfigs[mapConfigKey];
|
|
21302
|
+
if (mapConfig) {
|
|
21303
|
+
var targetLayerIndex = mapConfig.layers.findIndex(function (el) { return el.uuid === layerUuid; });
|
|
21304
|
+
if (targetLayerIndex !== -1) {
|
|
21305
|
+
delete mapConfig.layers[targetLayerIndex];
|
|
21306
|
+
processLayerOrderItems(function (_, parent) {
|
|
21307
|
+
if (parent && parent.layers) {
|
|
21308
|
+
parent.layers = parent.layers.filter(function (child) { return child.uuid !== layerUuid; });
|
|
21309
|
+
}
|
|
21310
|
+
}, mapConfig.layerOrder);
|
|
21311
|
+
}
|
|
21312
|
+
}
|
|
21313
|
+
},
|
|
21314
|
+
updateLayerOrder: function (state, action) {
|
|
21315
|
+
var _a = action.payload, mapConfigKey = _a.mapConfigKey, newOrder = _a.newOrder;
|
|
21316
|
+
var mapConfig = state.mapConfigs[mapConfigKey];
|
|
21317
|
+
if (mapConfig) {
|
|
21318
|
+
mapConfig.layerOrder = newOrder;
|
|
21319
|
+
}
|
|
21320
|
+
},
|
|
21321
|
+
// masterVisible property will be applied to all children of a folder that is set to be not visible
|
|
21322
|
+
// masterVisible will over rule the actual layer config if set to false
|
|
21323
|
+
// if masterVisible is true the actual layerConfig visibility setting is respected
|
|
21324
|
+
setMasterVisible: function (state, action) {
|
|
21325
|
+
var _a;
|
|
21326
|
+
var _b = action.payload, mapConfigKey = _b.mapConfigKey, layerId = _b.layerId, masterVisible = _b.masterVisible;
|
|
21327
|
+
var mapConfig = state.mapConfigs[mapConfigKey];
|
|
21328
|
+
if (mapConfig) {
|
|
21329
|
+
var targetLayerIndex = mapConfig.layers.findIndex(function (el) { return el.uuid === layerId; });
|
|
21330
|
+
if (targetLayerIndex !== -1) {
|
|
21331
|
+
var layerConfig = mapConfig.layers[targetLayerIndex];
|
|
21332
|
+
if (layerConfig) {
|
|
21333
|
+
var updatedLayers_1 = __spreadArray([], mapConfig.layers, true);
|
|
21334
|
+
if (layerConfig.type === 'folder') {
|
|
21335
|
+
mapConfig.layerOrder.forEach(function (folder) {
|
|
21336
|
+
var _a;
|
|
21337
|
+
if (folder.uuid === layerId) {
|
|
21338
|
+
(_a = folder.layers) === null || _a === void 0 ? void 0 : _a.forEach(function (childUuid) {
|
|
21339
|
+
var _a;
|
|
21340
|
+
var childLayerIndex = mapConfig.layers.findIndex(function (el) { return el.uuid === childUuid.uuid; });
|
|
21341
|
+
var childLayer = updatedLayers_1[childLayerIndex];
|
|
21342
|
+
updatedLayers_1[childLayerIndex] = __assign(__assign({}, childLayer), { masterVisible: masterVisible });
|
|
21343
|
+
if ((childLayer === null || childLayer === void 0 ? void 0 : childLayer.type) === 'vt' && ((_a = childLayer === null || childLayer === void 0 ? void 0 : childLayer.config) === null || _a === void 0 ? void 0 : _a.layers)) {
|
|
21344
|
+
childLayer.config.layers = childLayer.config.layers.map(function (layer) { return (__assign(__assign({}, layer), { masterVisible: masterVisible })); });
|
|
21345
|
+
}
|
|
21346
|
+
});
|
|
21347
|
+
}
|
|
21348
|
+
});
|
|
21349
|
+
}
|
|
21350
|
+
if (layerConfig.type === 'vt' && ((_a = layerConfig === null || layerConfig === void 0 ? void 0 : layerConfig.config) === null || _a === void 0 ? void 0 : _a.layers)) {
|
|
21351
|
+
layerConfig.config.layers = layerConfig.config.layers.map(function (layer) { return (__assign(__assign({}, layer), { masterVisible: masterVisible })); });
|
|
21352
|
+
}
|
|
21353
|
+
state.mapConfigs[mapConfigKey].layers = updatedLayers_1;
|
|
21354
|
+
}
|
|
21355
|
+
}
|
|
21356
|
+
}
|
|
21357
|
+
},
|
|
21358
|
+
},
|
|
21359
|
+
});
|
|
21360
|
+
var getLayerByUuid = function (state, uuid) {
|
|
21361
|
+
var mapConfigs = state.mapConfigs;
|
|
21362
|
+
for (var key in mapConfigs) {
|
|
21363
|
+
var mapConfig = mapConfigs[key];
|
|
21364
|
+
var targetLayerIndex = mapConfig.layers.findIndex(function (el) { return el.uuid === uuid; });
|
|
21365
|
+
var foundLayer = mapConfig.layers[targetLayerIndex];
|
|
21366
|
+
if (foundLayer)
|
|
21367
|
+
return foundLayer;
|
|
21368
|
+
}
|
|
21369
|
+
return null;
|
|
21370
|
+
};
|
|
21371
|
+
var extractUuidsFromLayerOrder = function (state, mapConfigKey) {
|
|
21372
|
+
var mapConfig = state.mapConfig.mapConfigs[mapConfigKey];
|
|
21373
|
+
if (!mapConfig) {
|
|
21374
|
+
return [];
|
|
21375
|
+
}
|
|
21376
|
+
var layerOrder = mapConfig.layerOrder;
|
|
21377
|
+
var uuids = [];
|
|
21378
|
+
function extractUuids(items) {
|
|
21379
|
+
items.forEach(function (item) {
|
|
21380
|
+
uuids.push(item.uuid);
|
|
21381
|
+
if (item.layers && item.layers.length > 0) {
|
|
21382
|
+
extractUuids(item.layers);
|
|
21383
|
+
}
|
|
21384
|
+
});
|
|
21385
|
+
}
|
|
21386
|
+
extractUuids(layerOrder);
|
|
21387
|
+
return uuids;
|
|
21388
|
+
};
|
|
21389
|
+
var store = toolkit.configureStore({
|
|
21390
|
+
reducer: {
|
|
21391
|
+
mapConfig: mapConfigSlice.reducer,
|
|
21392
|
+
},
|
|
21393
|
+
});
|
|
21394
|
+
var setMapConfig = (_a = mapConfigSlice.actions, _a.setMapConfig), removeMapConfig = _a.removeMapConfig, setLayerInMapConfig = _a.setLayerInMapConfig, removeLayerFromMapConfig = _a.removeLayerFromMapConfig, updateLayerOrder = _a.updateLayerOrder, setMasterVisible = _a.setMasterVisible;
|
|
21395
|
+
|
|
21396
|
+
function PaintPropsColorPicker(props) {
|
|
21397
|
+
return (React.createElement(ColorPicker, { value: props.value, label: "Color", onChange: function (value) {
|
|
21398
|
+
if (typeof props.onChange === 'function') {
|
|
21399
|
+
props.onChange(value);
|
|
21400
|
+
}
|
|
21401
|
+
} }));
|
|
21402
|
+
}
|
|
21403
|
+
|
|
21404
|
+
var PaperStyled = material.styled(material.Paper)({
|
|
21405
|
+
marginLeft: '-100px',
|
|
21406
|
+
marginRight: '-21px',
|
|
21407
|
+
paddingLeft: '53px',
|
|
21408
|
+
borderRadius: '0px',
|
|
21409
|
+
boxShadow: 'none',
|
|
21410
|
+
backgroundColor: 'rgb(0, 0, 0, 0)',
|
|
21411
|
+
});
|
|
21412
|
+
var BoxStyled$1 = material.styled(material.Box)({
|
|
21413
|
+
marginLeft: '61px',
|
|
21414
|
+
});
|
|
21415
|
+
var mapPropKeyToFormInputType = {
|
|
21416
|
+
'circle-color': 'colorpicker',
|
|
21417
|
+
'circle-radius': 'slider',
|
|
21418
|
+
'circle-stroke-color': 'colorpicker',
|
|
21419
|
+
'circle-stroke-width': 'slider',
|
|
21420
|
+
'fill-color': 'colorpicker',
|
|
21421
|
+
'fill-outline-color': 'colorpicker',
|
|
21422
|
+
'line-color': 'colorpicker',
|
|
21423
|
+
'line-width': 'slider',
|
|
21424
|
+
'line-blur': 'slider',
|
|
21425
|
+
};
|
|
21426
|
+
var mapPropKeyToFormInputTypeKeys = Object.keys(mapPropKeyToFormInputType);
|
|
21427
|
+
var inputPropsByPropKey = {
|
|
21428
|
+
'circle-stroke-width': {
|
|
21429
|
+
step: 1,
|
|
21430
|
+
min: 1,
|
|
21431
|
+
max: 20,
|
|
21432
|
+
},
|
|
21433
|
+
'circle-radius': {
|
|
21434
|
+
step: 1,
|
|
21435
|
+
min: 1,
|
|
21436
|
+
max: 100,
|
|
21437
|
+
},
|
|
21438
|
+
'line-blur': {
|
|
21439
|
+
step: 1,
|
|
21440
|
+
min: 1,
|
|
21441
|
+
max: 100,
|
|
21442
|
+
},
|
|
21443
|
+
'line-width': {
|
|
21444
|
+
step: 1,
|
|
21445
|
+
min: 1,
|
|
21446
|
+
max: 100,
|
|
21447
|
+
},
|
|
21448
|
+
};
|
|
21449
|
+
function LayerPropertyForm(props) {
|
|
21450
|
+
var _a, _b;
|
|
21451
|
+
var key = React.useRef(Math.round(Math.random() * 10000000000));
|
|
21452
|
+
var layer = getLayerByUuid(reactRedux.useSelector(function (state) { return state.mapConfig; }), props.layerUuid);
|
|
21453
|
+
var dispatch = reactRedux.useDispatch();
|
|
21454
|
+
var paintProps = React.useMemo(function () {
|
|
21455
|
+
var _a, _b, _c, _d;
|
|
21456
|
+
if ((_b = (_a = layer === null || layer === void 0 ? void 0 : layer.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.paint) {
|
|
21457
|
+
return (_d = (_c = layer === null || layer === void 0 ? void 0 : layer.config) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.paint;
|
|
21458
|
+
}
|
|
21459
|
+
return {};
|
|
21460
|
+
}, [(_b = (_a = layer === null || layer === void 0 ? void 0 : layer.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.paint]);
|
|
21461
|
+
var updatePaintProp = function (key, value) {
|
|
21462
|
+
var _a;
|
|
21463
|
+
var _b, _c, _d;
|
|
21464
|
+
var updatedLayer = __assign(__assign({}, layer), { config: __assign(__assign({}, layer === null || layer === void 0 ? void 0 : layer.config), { options: __assign(__assign({}, (_b = layer === null || layer === void 0 ? void 0 : layer.config) === null || _b === void 0 ? void 0 : _b.options), { paint: __assign(__assign({}, (_d = (_c = layer === null || layer === void 0 ? void 0 : layer.config) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.paint), (_a = {}, _a[key] = value, _a)) }) }) });
|
|
21465
|
+
dispatch(setLayerInMapConfig({
|
|
21466
|
+
mapConfigKey: props.mapConfigKey,
|
|
21467
|
+
layer: updatedLayer,
|
|
21468
|
+
}));
|
|
21469
|
+
};
|
|
21470
|
+
var getFormInputByType = React.useCallback(function (key) {
|
|
21471
|
+
if ((paintProps === null || paintProps === void 0 ? void 0 : paintProps[key]) &&
|
|
21472
|
+
mapPropKeyToFormInputTypeKeys.indexOf(key) !== -1 &&
|
|
21473
|
+
(typeof paintProps[key] === 'number' || typeof paintProps[key] === 'string')) {
|
|
21474
|
+
var label = (React.createElement(material.Typography, { id: key + '_label', gutterBottom: true }, key));
|
|
21475
|
+
switch (mapPropKeyToFormInputType[key]) {
|
|
21476
|
+
case 'slider':
|
|
21477
|
+
return (React.createElement(React.Fragment, { key: key },
|
|
21478
|
+
label,
|
|
21479
|
+
React.createElement(material.Slider, __assign({}, inputPropsByPropKey[key], { value: paintProps[key], valueLabelDisplay: "auto", onChange: function (_ev, value) {
|
|
21480
|
+
if (value) {
|
|
21481
|
+
updatePaintProp(key, value);
|
|
21482
|
+
}
|
|
21483
|
+
} }))));
|
|
21484
|
+
case 'numberfield':
|
|
21485
|
+
return (React.createElement(React.Fragment, { key: key },
|
|
21486
|
+
label,
|
|
21487
|
+
React.createElement(material.TextField, { inputProps: { inputMode: 'decimal', pattern: '[0-9]*' }, value: paintProps[key], onChange: function (ev) {
|
|
21488
|
+
var _a;
|
|
21489
|
+
if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.value) {
|
|
21490
|
+
updatePaintProp(key, parseInt(ev.target.value));
|
|
21491
|
+
}
|
|
21492
|
+
} })));
|
|
21493
|
+
case 'colorpicker':
|
|
21494
|
+
return (React.createElement(React.Fragment, { key: key },
|
|
21495
|
+
label,
|
|
21496
|
+
React.createElement(material.Box, { sx: { '& > div': { width: 'initial !important' } } },
|
|
21497
|
+
React.createElement(PaintPropsColorPicker, { key: key, value: paintProps[key], onChange: function (value) {
|
|
21498
|
+
updatePaintProp(key, value);
|
|
21499
|
+
} }))));
|
|
21500
|
+
}
|
|
21501
|
+
}
|
|
21502
|
+
return null;
|
|
21503
|
+
}, [paintProps]);
|
|
21504
|
+
return (React.createElement(React.Fragment, null,
|
|
21505
|
+
React.createElement(PaperStyled, null,
|
|
21506
|
+
React.createElement(material.ListItem, { key: key.current + '_paintPropForm' },
|
|
21507
|
+
React.createElement(BoxStyled$1, null, paintProps &&
|
|
21508
|
+
Object.keys(paintProps).map(function (el) { return getFormInputByType(el); }))))));
|
|
21509
|
+
}
|
|
21510
|
+
|
|
21511
|
+
var TuneIconButton = material.styled(material.IconButton)({
|
|
21512
|
+
padding: '4px',
|
|
21513
|
+
marginTop: '-3px',
|
|
21514
|
+
});
|
|
21515
|
+
var DeleteIconButton = material.styled(material.IconButton)({
|
|
21516
|
+
marginLeft: '20px',
|
|
21517
|
+
});
|
|
21518
|
+
var ListItemStyled = material.styled(material.ListItem)({
|
|
21519
|
+
paddingRight: 0,
|
|
21520
|
+
paddingLeft: 0,
|
|
21521
|
+
paddingTop: 0,
|
|
21522
|
+
paddingBottom: '4px',
|
|
21523
|
+
});
|
|
21524
|
+
var ListItemIconStyled = material.styled(material.ListItemIcon)({
|
|
21525
|
+
minWidth: '30px',
|
|
21526
|
+
});
|
|
21527
|
+
var IconButtonStyled = material.styled(material.IconButton)({
|
|
21528
|
+
marginRight: '0px',
|
|
21529
|
+
padding: '0px',
|
|
21530
|
+
});
|
|
21531
|
+
var BoxStyled = material.styled(material.Box)(function (_a) {
|
|
21532
|
+
var open = _a.open;
|
|
21533
|
+
return ({
|
|
21534
|
+
display: open ? 'block' : 'none',
|
|
21535
|
+
});
|
|
21536
|
+
});
|
|
21537
|
+
var ListStyled$1 = material.styled(material.List)({
|
|
21538
|
+
marginLeft: '50px',
|
|
21539
|
+
});
|
|
21540
|
+
function LayerTreeListItem(props) {
|
|
21541
|
+
var _a = React.useState(false), paintPropsFormVisible = _a[0], setPaintPropsFormVisible = _a[1];
|
|
21542
|
+
var _b = React.useState(false), showDeletionConfirmationDialog = _b[0], setShowDeletionConfirmationDialog = _b[1];
|
|
21543
|
+
var layer = getLayerByUuid(reactRedux.useSelector(function (state) { return state.mapConfig; }), props.layerOrderConfig.uuid);
|
|
21544
|
+
var _c = React.useState(false), open = _c[0], setOpen = _c[1];
|
|
21545
|
+
var dispatch = reactRedux.useDispatch();
|
|
21546
|
+
var mapConfig = reactRedux.useSelector(function (state) { return state.mapConfig.mapConfigs[props.mapConfigKey]; });
|
|
21547
|
+
function moveLayer(uuid, getNewPos) {
|
|
21548
|
+
var newLayerOrder = JSON.parse(JSON.stringify(mapConfig.layerOrder));
|
|
21549
|
+
var findAndMove = function (layers) {
|
|
21550
|
+
var found = false;
|
|
21551
|
+
layers.forEach(function (layer, index) {
|
|
21552
|
+
if (found)
|
|
21553
|
+
return;
|
|
21554
|
+
if (layer.uuid === uuid) {
|
|
21555
|
+
var newPos = getNewPos(index);
|
|
21556
|
+
if (newPos < 0 || newPos >= layers.length) {
|
|
21557
|
+
throw new Error('New position is out of bounds');
|
|
21558
|
+
}
|
|
21559
|
+
var item = layers.splice(index, 1)[0];
|
|
21560
|
+
layers.splice(newPos, 0, item);
|
|
21561
|
+
found = true;
|
|
21562
|
+
}
|
|
21563
|
+
else if (layer.layers) {
|
|
21564
|
+
if (findAndMove(layer.layers)) {
|
|
21565
|
+
found = true;
|
|
21566
|
+
}
|
|
21567
|
+
}
|
|
21568
|
+
});
|
|
21569
|
+
return found;
|
|
21570
|
+
};
|
|
21571
|
+
findAndMove(newLayerOrder);
|
|
21572
|
+
dispatch(updateLayerOrder({ mapConfigKey: props.mapConfigKey, newOrder: newLayerOrder }));
|
|
21573
|
+
}
|
|
21574
|
+
var moveDown = function (uuid) {
|
|
21575
|
+
moveLayer(uuid, function (idx) { return idx + 1; });
|
|
21576
|
+
};
|
|
21577
|
+
var moveUp = function (uuid) {
|
|
21578
|
+
moveLayer(uuid, function (idx) { return idx - 1; });
|
|
21579
|
+
};
|
|
21580
|
+
function handleToggleVisibility(visible, specificLayerId) {
|
|
21581
|
+
if (specificLayerId === void 0) { specificLayerId = ''; }
|
|
21582
|
+
var nextVisible = !visible;
|
|
21583
|
+
if (layer) {
|
|
21584
|
+
toggleVisible(layer, nextVisible, specificLayerId);
|
|
21585
|
+
if (layer.type === 'folder' || (layer.type === 'vt' && specificLayerId === '')) {
|
|
21586
|
+
dispatch(setMasterVisible({
|
|
21587
|
+
mapConfigKey: props.mapConfigKey,
|
|
21588
|
+
layerId: layer.uuid,
|
|
21589
|
+
masterVisible: nextVisible,
|
|
21590
|
+
}));
|
|
21591
|
+
}
|
|
21592
|
+
}
|
|
21593
|
+
}
|
|
21594
|
+
function toggleVisible(layer, nextVisible, specificLayerId) {
|
|
21595
|
+
var _a, _b, _c;
|
|
21596
|
+
//TODO: update layout for all layer types
|
|
21597
|
+
var updatedLayer = __assign({}, layer);
|
|
21598
|
+
if ((layer === null || layer === void 0 ? void 0 : layer.type) === 'folder') {
|
|
21599
|
+
updatedLayer = __assign(__assign({}, layer), { visible: !layer.visible });
|
|
21600
|
+
}
|
|
21601
|
+
else {
|
|
21602
|
+
switch (layer === null || layer === void 0 ? void 0 : layer.type) {
|
|
21603
|
+
case 'geojson': {
|
|
21604
|
+
updatedLayer = __assign(__assign({}, layer), { config: __assign(__assign({}, layer.config), { options: __assign(__assign({}, (_a = layer === null || layer === void 0 ? void 0 : layer.config) === null || _a === void 0 ? void 0 : _a.options), { layout: __assign(__assign({}, (_c = (_b = layer === null || layer === void 0 ? void 0 : layer.config) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.layout), { visibility: nextVisible ? 'visible' : 'none' }) }) }) });
|
|
21605
|
+
break;
|
|
21606
|
+
}
|
|
21607
|
+
case 'vt': {
|
|
21608
|
+
var updateSublayerOnly_1 = false;
|
|
21609
|
+
var updatedSubLayers = layer.config.layers.map(function (layer) {
|
|
21610
|
+
if (layer.id === specificLayerId) {
|
|
21611
|
+
updateSublayerOnly_1 = true;
|
|
21612
|
+
return __assign(__assign({}, layer), { layout: __assign(__assign({}, layer.layout), { visibility: nextVisible ? 'visible' : 'none' }) });
|
|
21613
|
+
}
|
|
21614
|
+
return layer;
|
|
21615
|
+
});
|
|
21616
|
+
if (updateSublayerOnly_1) {
|
|
21617
|
+
updatedLayer = __assign(__assign({}, layer), { config: __assign(__assign({}, layer.config), { layers: updatedSubLayers }) });
|
|
21618
|
+
}
|
|
21619
|
+
else {
|
|
21620
|
+
updatedLayer = __assign(__assign({}, layer), { visible: nextVisible, config: __assign(__assign({}, layer.config), { layers: updatedSubLayers }) });
|
|
21621
|
+
}
|
|
21622
|
+
break;
|
|
21623
|
+
}
|
|
21624
|
+
case 'wms': {
|
|
21625
|
+
updatedLayer = __assign(__assign({}, layer), { visible: nextVisible, config: __assign(__assign({}, layer.config), { visible: nextVisible }) });
|
|
21626
|
+
break;
|
|
21627
|
+
}
|
|
21628
|
+
}
|
|
21629
|
+
}
|
|
21630
|
+
dispatch(setLayerInMapConfig({
|
|
21631
|
+
mapConfigKey: props.mapConfigKey,
|
|
21632
|
+
layer: updatedLayer,
|
|
21633
|
+
}));
|
|
21634
|
+
return updatedLayer;
|
|
21635
|
+
}
|
|
21636
|
+
function renderLayerItem(layer) {
|
|
21637
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
21638
|
+
var visible = true;
|
|
21639
|
+
if ((layer === null || layer === void 0 ? void 0 : layer.type) === 'geojson') {
|
|
21640
|
+
visible = ((_c = (_b = (_a = layer === null || layer === void 0 ? void 0 : layer.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.visibility) !== 'none';
|
|
21641
|
+
return (React.createElement(React.Fragment, null,
|
|
21642
|
+
React.createElement(ListItemStyled, { key: layer.uuid, sx: __assign({}, props.listItemSx), secondaryAction: React.createElement(React.Fragment, null, props === null || props === void 0 ? void 0 :
|
|
21643
|
+
props.buttons,
|
|
21644
|
+
React.createElement(IconButtonStyled, { disabled: false, onClick: function () {
|
|
21645
|
+
moveDown(layer.uuid);
|
|
21646
|
+
} },
|
|
21647
|
+
React.createElement(iconsMaterial.ArrowCircleDown, null)),
|
|
21648
|
+
React.createElement(IconButtonStyled, { disabled: false, onClick: function () {
|
|
21649
|
+
moveUp(layer.uuid);
|
|
21650
|
+
} },
|
|
21651
|
+
React.createElement(iconsMaterial.ArrowCircleUp, null)),
|
|
21652
|
+
layer.configurable && (React.createElement(React.Fragment, null,
|
|
21653
|
+
React.createElement(TuneIconButton, { edge: 'end', "aria-label": "settings", onClick: function () {
|
|
21654
|
+
setPaintPropsFormVisible(function (current) {
|
|
21655
|
+
return !current;
|
|
21656
|
+
});
|
|
21657
|
+
} },
|
|
21658
|
+
React.createElement(iconsMaterial.Tune, null))))) },
|
|
21659
|
+
React.createElement(CheckboxListItemIcon, null,
|
|
21660
|
+
React.createElement(CheckboxStyled, { checked: visible, disabled: layer.masterVisible === false, onClick: function () { return handleToggleVisibility(visible); } })),
|
|
21661
|
+
React.createElement(material.ListItemText, { variant: "layerlist", primary: layer.name || '', secondary: props.description, primaryTypographyProps: { overflow: 'hidden' } }),
|
|
21662
|
+
props.buttons),
|
|
21663
|
+
layer.configurable && paintPropsFormVisible && (React.createElement(React.Fragment, null,
|
|
21664
|
+
props.showDeleteButton && (React.createElement(React.Fragment, null,
|
|
21665
|
+
React.createElement(DeleteIconButton, { edge: "end", "aria-label": "delete", onClick: function () { } },
|
|
21666
|
+
React.createElement(iconsMaterial.Delete, null)),
|
|
21667
|
+
showDeletionConfirmationDialog && (React.createElement(ConfirmDialog, { open: showDeletionConfirmationDialog, onConfirm: function () {
|
|
21668
|
+
setShowDeletionConfirmationDialog(false);
|
|
21669
|
+
}, onCancel: function () {
|
|
21670
|
+
setShowDeletionConfirmationDialog(false);
|
|
21671
|
+
}, title: "Delete layer", text: "Are you sure you want to delete this layer?" })))),
|
|
21672
|
+
React.createElement(LayerPropertyForm, { layerUuid: layer.uuid, mapConfigKey: props.mapConfigKey })))));
|
|
21673
|
+
}
|
|
21674
|
+
if ((layer === null || layer === void 0 ? void 0 : layer.type) === 'vt') {
|
|
21675
|
+
return (React.createElement(React.Fragment, null,
|
|
21676
|
+
React.createElement(ListItemStyled, { key: layer.uuid, sx: __assign({}, props.listItemSx), secondaryAction: undefined },
|
|
21677
|
+
React.createElement(ListItemIconStyled, null,
|
|
21678
|
+
React.createElement(IconButtonStyled, { edge: "end", "aria-label": "open", onClick: function () { return setOpen(!open); } }, open ? React.createElement(iconsMaterial.ExpandMore, null) : React.createElement(iconsMaterial.KeyboardArrowRight, null)),
|
|
21679
|
+
React.createElement(CheckboxListItemIcon, null,
|
|
21680
|
+
React.createElement(CheckboxStyled, { checked: layer.visible, disabled: layer.masterVisible === false, onClick: function () { var _a; return handleToggleVisibility((_a = layer.visible) !== null && _a !== void 0 ? _a : false); } }))),
|
|
21681
|
+
React.createElement(material.ListItemText, { primary: layer.name, secondary: props.description, primaryTypographyProps: { overflow: 'hidden' } })),
|
|
21682
|
+
React.createElement(BoxStyled, { key: layer.uuid + '_list', open: open },
|
|
21683
|
+
React.createElement(ListStyled$1, { disablePadding: true }, (_e = (_d = layer.config) === null || _d === void 0 ? void 0 : _d.layers) === null || _e === void 0 ? void 0 : _e.map(function (subLayer) {
|
|
21684
|
+
var _a, _b;
|
|
21685
|
+
return (React.createElement(ListItemStyled, { key: subLayer.id, sx: __assign({}, props.listItemSx), secondaryAction: undefined },
|
|
21686
|
+
' ',
|
|
21687
|
+
React.createElement(ListItemIconStyled, null,
|
|
21688
|
+
React.createElement(CheckboxListItemIcon, null,
|
|
21689
|
+
React.createElement(CheckboxStyled, { checked: ((_b = (_a = subLayer === null || subLayer === void 0 ? void 0 : subLayer.layout) === null || _a === void 0 ? void 0 : _a.visibility) !== null && _b !== void 0 ? _b : 'visible') === 'visible', disabled: (subLayer === null || subLayer === void 0 ? void 0 : subLayer.masterVisible) === false, onClick: function () {
|
|
21690
|
+
var _a;
|
|
21691
|
+
return handleToggleVisibility(((_a = subLayer === null || subLayer === void 0 ? void 0 : subLayer.layout) === null || _a === void 0 ? void 0 : _a.visibility) === 'visible', subLayer.id);
|
|
21692
|
+
} }))),
|
|
21693
|
+
React.createElement(material.ListItemText, { key: subLayer.id, variant: "layerlist", primary: subLayer['source-layer'], primaryTypographyProps: { overflow: 'hidden' } })));
|
|
21694
|
+
})))));
|
|
21695
|
+
}
|
|
21696
|
+
if ((layer === null || layer === void 0 ? void 0 : layer.type) === 'wms') {
|
|
21697
|
+
var visible_1 = (_g = (_f = layer.config) === null || _f === void 0 ? void 0 : _f.visible) !== null && _g !== void 0 ? _g : true;
|
|
21698
|
+
return (React.createElement(React.Fragment, null,
|
|
21699
|
+
React.createElement(ListItemStyled, { key: layer.uuid, sx: __assign({}, props.listItemSx), secondaryAction: undefined },
|
|
21700
|
+
React.createElement(CheckboxListItemIcon, null,
|
|
21701
|
+
React.createElement(CheckboxStyled, { checked: visible_1, disabled: layer.masterVisible === false, onClick: function () { return handleToggleVisibility(visible_1); } })),
|
|
21702
|
+
React.createElement(material.ListItemText, { primary: layer.name, secondary: props.description, primaryTypographyProps: { overflow: 'hidden' } }))));
|
|
21703
|
+
}
|
|
21704
|
+
if (layer.type === 'folder') {
|
|
21705
|
+
return (React.createElement(React.Fragment, null,
|
|
21706
|
+
React.createElement(ListItemStyled, { key: layer.uuid, sx: __assign({}, props.listItemSx) },
|
|
21707
|
+
React.createElement(ListItemIconStyled, null,
|
|
21708
|
+
React.createElement(IconButtonStyled, { edge: "end", "aria-label": "open", onClick: function () { return setOpen(!open); } }, open ? React.createElement(iconsMaterial.ExpandMore, null) : React.createElement(iconsMaterial.KeyboardArrowRight, null)),
|
|
21709
|
+
React.createElement(CheckboxListItemIcon, null,
|
|
21710
|
+
React.createElement(CheckboxStyled, { checked: layer.visible, disabled: layer.masterVisible, onClick: function () { return handleToggleVisibility(layer.visible ? layer.visible : false); } }))),
|
|
21711
|
+
React.createElement(material.ListItemText, { primary: layer.name, secondary: props.description, primaryTypographyProps: { overflow: 'hidden' } })),
|
|
21712
|
+
React.createElement(BoxStyled, { key: layer.uuid + '_list', open: open },
|
|
21713
|
+
React.createElement(ListStyled$1, { disablePadding: true }, (_j = (_h = props === null || props === void 0 ? void 0 : props.layerOrderConfig) === null || _h === void 0 ? void 0 : _h.layers) === null || _j === void 0 ? void 0 : _j.map(function (subLayer) { return (React.createElement(LayerTreeListItem, { layerOrderConfig: subLayer, key: subLayer.uuid, mapConfigKey: props.mapConfigKey })); })))));
|
|
21714
|
+
}
|
|
21715
|
+
else {
|
|
21716
|
+
return React.createElement(React.Fragment, null);
|
|
21717
|
+
}
|
|
21718
|
+
}
|
|
21719
|
+
return React.createElement(React.Fragment, null, layer && renderLayerItem(layer));
|
|
21720
|
+
}
|
|
21721
|
+
|
|
21722
|
+
var ListStyled = material.styled(material.List)({
|
|
21723
|
+
marginTop: '15px',
|
|
21724
|
+
});
|
|
21725
|
+
function LayerTree(props) {
|
|
21726
|
+
var _a;
|
|
21727
|
+
var layerOrder = reactRedux.useSelector(function (state) { var _a, _b; return (_b = (_a = state.mapConfig.mapConfigs) === null || _a === void 0 ? void 0 : _a[props.mapConfigKey]) === null || _b === void 0 ? void 0 : _b.layerOrder; });
|
|
21728
|
+
return (React.createElement(ListStyled, null, (_a = layerOrder === null || layerOrder === void 0 ? void 0 : layerOrder.map) === null || _a === void 0 ? void 0 : _a.call(layerOrder, function (el) { return (React.createElement(LayerTreeListItem, { key: el.uuid, layerOrderConfig: el, mapConfigKey: props.mapConfigKey })); })));
|
|
21729
|
+
}
|
|
21730
|
+
|
|
21731
|
+
function LayerOnMap(props) {
|
|
21732
|
+
var _a;
|
|
21733
|
+
var layers = reactRedux.useSelector(function (state) { var _a, _b; return (_b = (_a = state.mapConfig.mapConfigs) === null || _a === void 0 ? void 0 : _a[props.mapConfigKey]) === null || _b === void 0 ? void 0 : _b.layers; });
|
|
21734
|
+
var layerStoreOrder = reactRedux.useSelector(function (state) { var _a, _b; return (_b = (_a = state.mapConfig.mapConfigs) === null || _a === void 0 ? void 0 : _a[props.mapConfigKey]) === null || _b === void 0 ? void 0 : _b.layerOrder; });
|
|
21735
|
+
var mapHook = useMap({ mapId: props === null || props === void 0 ? void 0 : props.mapId });
|
|
21736
|
+
var layerStoreOrderIds = reactRedux.useSelector(function (state) {
|
|
21737
|
+
return extractUuidsFromLayerOrder(state, props.mapConfigKey);
|
|
21738
|
+
});
|
|
21739
|
+
var previousLayerStoreOrderRef = React.useRef([]);
|
|
21740
|
+
React.useEffect(function () {
|
|
21741
|
+
if (!mapHook.map || !layerStoreOrder)
|
|
21742
|
+
return;
|
|
21743
|
+
var adjustLayerOrderAtLevel = function (layers, previousLayers, map) {
|
|
21744
|
+
for (var i = 0; i < layers.length; i++) {
|
|
21745
|
+
var currentLayer = layers[i];
|
|
21746
|
+
var previousLayer = previousLayers ? previousLayers[i] : null;
|
|
21747
|
+
if (currentLayer.uuid !== (previousLayer === null || previousLayer === void 0 ? void 0 : previousLayer.uuid)) {
|
|
21748
|
+
if (map.getLayer(currentLayer.uuid)) {
|
|
21749
|
+
var beforeLayer = i > 0 ? layers[i - 1].uuid : undefined;
|
|
21750
|
+
map.moveLayer(currentLayer.uuid, beforeLayer);
|
|
21751
|
+
}
|
|
21752
|
+
}
|
|
21753
|
+
if (currentLayer.layers && currentLayer.layers.length > 0) {
|
|
21754
|
+
var previousSubLayers = (previousLayer === null || previousLayer === void 0 ? void 0 : previousLayer.layers) || [];
|
|
21755
|
+
adjustLayerOrderAtLevel(currentLayer.layers, previousSubLayers, map);
|
|
21756
|
+
}
|
|
21757
|
+
}
|
|
21758
|
+
};
|
|
21759
|
+
var previousLayerStoreOrder = previousLayerStoreOrderRef.current;
|
|
21760
|
+
adjustLayerOrderAtLevel(layerStoreOrder, previousLayerStoreOrder, mapHook.map);
|
|
21761
|
+
previousLayerStoreOrderRef.current = layerStoreOrder;
|
|
21762
|
+
}, [layerStoreOrder, mapHook.map]);
|
|
21763
|
+
var orderLayers = React.useMemo(function () {
|
|
21764
|
+
var layerIds = __spreadArray(__spreadArray([
|
|
21765
|
+
'order-background'
|
|
21766
|
+
], layerStoreOrderIds.map(function (el) { return 'layer_id_' + el; }), true), [
|
|
21767
|
+
'order-labels',
|
|
21768
|
+
], false);
|
|
21769
|
+
return layerIds;
|
|
21770
|
+
}, [layerStoreOrderIds]);
|
|
21771
|
+
function renderLayer(layer) {
|
|
21772
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
21773
|
+
var targetLayerIndex = layers.findIndex(function (el) { return el.uuid === layer.uuid; });
|
|
21774
|
+
var layerConfig = layers[targetLayerIndex];
|
|
21775
|
+
switch (layerConfig === null || layerConfig === void 0 ? void 0 : layerConfig.type) {
|
|
21776
|
+
case 'geojson':
|
|
21777
|
+
return (React.createElement(MlGeoJsonLayer, __assign({ key: layerConfig.uuid, layerId: layerConfig.uuid, insertBeforeLayer: 'layer_id_' + layerConfig.uuid }, layerConfig.config, { options: __assign(__assign({}, layerConfig.config.options), { layout: __assign(__assign({}, (_b = (_a = layerConfig === null || layerConfig === void 0 ? void 0 : layerConfig.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.layout), { visibility: layerConfig.masterVisible === false
|
|
21778
|
+
? 'none'
|
|
21779
|
+
: ((_e = (_d = (_c = layerConfig === null || layerConfig === void 0 ? void 0 : layerConfig.config) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.layout) === null || _e === void 0 ? void 0 : _e.visibility)
|
|
21780
|
+
? (_h = (_g = (_f = layerConfig === null || layerConfig === void 0 ? void 0 : layerConfig.config) === null || _f === void 0 ? void 0 : _f.options) === null || _g === void 0 ? void 0 : _g.layout) === null || _h === void 0 ? void 0 : _h.visibility
|
|
21781
|
+
: 'visible' }) }) })));
|
|
21782
|
+
case 'vt': {
|
|
21783
|
+
var l = layerConfig.config.layers.map(function (layer) {
|
|
21784
|
+
var _a;
|
|
21785
|
+
var newLayer = __assign({}, layer);
|
|
21786
|
+
if (newLayer.layout) {
|
|
21787
|
+
newLayer.layout = __assign(__assign({}, newLayer.layout), { visibility: newLayer.masterVisible === false ? 'none' : (_a = newLayer.layout.visibility) !== null && _a !== void 0 ? _a : 'visible' });
|
|
21788
|
+
}
|
|
21789
|
+
return newLayer;
|
|
21790
|
+
});
|
|
21791
|
+
return (React.createElement(MlVectorTileLayer, { key: layerConfig.uuid, layerId: layerConfig.uuid, insertBeforeLayer: 'layer_id_' + layerConfig.uuid, url: layerConfig.config.url, layers: l }));
|
|
21792
|
+
}
|
|
21793
|
+
case 'wms': {
|
|
21794
|
+
var visible = layerConfig.masterVisible === false ? false : (_j = layerConfig.config) === null || _j === void 0 ? void 0 : _j.visible;
|
|
21795
|
+
return (React.createElement(MlWmsLayer, { key: layerConfig.uuid, layerId: layerConfig.uuid, insertBeforeLayer: 'layer_id_' + layerConfig.uuid, url: ((_k = layerConfig.config) === null || _k === void 0 ? void 0 : _k.url) || '', urlParameters: (_l = layerConfig.config) === null || _l === void 0 ? void 0 : _l.urlParameters, visible: visible }));
|
|
21796
|
+
}
|
|
21797
|
+
case 'folder':
|
|
21798
|
+
return (layer === null || layer === void 0 ? void 0 : layer.layers) ? (layer.layers.map(function (subLayer) { return renderLayer(subLayer); })) : (React.createElement(React.Fragment, null));
|
|
21799
|
+
default:
|
|
21800
|
+
return null;
|
|
21801
|
+
}
|
|
21802
|
+
}
|
|
21803
|
+
return (React.createElement(React.Fragment, null,
|
|
21804
|
+
React.createElement(MlOrderLayers, { layerIds: orderLayers }), (_a = layerStoreOrder === null || layerStoreOrder === void 0 ? void 0 : layerStoreOrder.map) === null || _a === void 0 ? void 0 :
|
|
21805
|
+
_a.call(layerStoreOrder, function (layerOrderItem) { return renderLayer(layerOrderItem); })));
|
|
21806
|
+
}
|
|
21807
|
+
|
|
21808
|
+
var MapStore = {
|
|
21809
|
+
store: store,
|
|
21810
|
+
setMapConfig: setMapConfig,
|
|
21811
|
+
removeMapConfig: removeMapConfig,
|
|
21812
|
+
setLayerInMapConfig: setLayerInMapConfig,
|
|
21813
|
+
removeLayerFromMapConfig: removeLayerFromMapConfig,
|
|
21814
|
+
updateLayerOrder: updateLayerOrder,
|
|
21815
|
+
setMasterVisible: setMasterVisible,
|
|
21816
|
+
};
|
|
21817
|
+
|
|
21187
21818
|
exports.AddLayerButton = AddLayerButton;
|
|
21188
21819
|
exports.AddLayerPopup = AddLayerPopup;
|
|
21189
21820
|
exports.CSVProtocolHandler = CSVProtocolHandler;
|
|
21190
|
-
exports.ColorPicker = PaintPropsColorPicker;
|
|
21821
|
+
exports.ColorPicker = PaintPropsColorPicker$1;
|
|
21191
21822
|
exports.ConfirmDialog = ConfirmDialog;
|
|
21192
21823
|
exports.GeoJsonContext = GeoJsonContext;
|
|
21193
21824
|
exports.GeoJsonLayerForm = GeoJsonLayerForm;
|
|
@@ -21200,12 +21831,16 @@ exports.LayerListFolder = LayerListFolder;
|
|
|
21200
21831
|
exports.LayerListItem = LayerListItem;
|
|
21201
21832
|
exports.LayerListItemFactory = LayerListItemFactory;
|
|
21202
21833
|
exports.LayerListItemVectorLayer = LayerListItemVectorLayer;
|
|
21203
|
-
exports.
|
|
21834
|
+
exports.LayerOnMap = LayerOnMap;
|
|
21835
|
+
exports.LayerPropertyForm = LayerPropertyForm$1;
|
|
21836
|
+
exports.LayerTree = LayerTree;
|
|
21837
|
+
exports.LayerTreeListItem = LayerTreeListItem;
|
|
21204
21838
|
exports.LayerTypeForm = LayerTypeForm;
|
|
21205
21839
|
exports.MapComponentsProvider = MapComponentsProvider;
|
|
21206
21840
|
exports.MapContext = MapContext;
|
|
21207
21841
|
exports.MapLibreGlWrapper = MapLibreGlWrapper;
|
|
21208
21842
|
exports.MapLibreMap = MapLibreMap;
|
|
21843
|
+
exports.MapStore = MapStore;
|
|
21209
21844
|
exports.MedievalKingdomStyle = MedievalKingdomStyle;
|
|
21210
21845
|
exports.MlCenterPosition = MlCenterPosition;
|
|
21211
21846
|
exports.MlComponentTemplate = MlComponentTemplate;
|
|
@@ -21225,6 +21860,7 @@ exports.MlMeasureTool = MlMeasureTool;
|
|
|
21225
21860
|
exports.MlMultiMeasureTool = MlMultiMeasureTool;
|
|
21226
21861
|
exports.MlNavigationCompass = MlNavigationCompass;
|
|
21227
21862
|
exports.MlNavigationTools = MlNavigationTools;
|
|
21863
|
+
exports.MlOgcApiFeatures = MlOgcApiFeatures;
|
|
21228
21864
|
exports.MlOrderLayers = MlOrderLayers;
|
|
21229
21865
|
exports.MlPdfPreview = PdfPreview;
|
|
21230
21866
|
exports.MlScaleReference = MlScaleReference;
|