@opengeoweb/core 19.2.0 → 19.4.0
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/dist/index.esm.js +232 -86
- package/dist/src/lib/components/LayerManager/LayerContainerRow/LayerRow/Menubutton/MenuButton.d.ts +3 -2
- package/dist/src/lib/components/LayerManager/LayerContainerRow/LayerRow/Menubutton/MenuButtonConnect.d.ts +2 -2
- package/dist/src/lib/components/LayerManager/LayerContainerRow/LayerRow/SelectableFeaturesCheckbox/SelectableFeaturesCheckbox.d.ts +1 -0
- package/dist/src/lib/components/LayerManager/LayerContainerRow/LayerRow/SelectableFeaturesCheckbox/SelectableFeaturesCheckboxConnect.d.ts +1 -0
- package/package.json +1 -2
package/dist/index.esm.js
CHANGED
|
@@ -4,8 +4,8 @@ import React, { useMemo, useState, useCallback, useEffect, useContext } from 're
|
|
|
4
4
|
import { safelyInitI18nForTestsAndStories, sharedTranslations, SHARED_NAMESPACE, TooltipSelect, CustomIconButton, CustomDialog, CustomTooltip, ToggleMenu, AlertIcon, useConfirmationDialog, useScrollingInIsolation, sliderHeaderStyle, CustomSlider, tooltipContainerStyles, renderCounter, AlertBanner, CustomAccordion, PROJECTION, calculateStartSize, useWheelStopPropagation, ToolContainerDraggable, dateUtils, sessionStorageProvider, useDebounce, usePrevious } from '@opengeoweb/shared';
|
|
5
5
|
import { webmapUtils, queryWMSLayersTree, invalidateWMSGetCapabilities, LayerType, WMDefaultStyleName, WMJSMAP_LONLAT_EPSGCODE, queryWMSServiceInfo, queryWMSLayers, getWMSServiceId, handleDateUtilsISOString, generateLayerId, WMJSDimension, getWMLayerById, getMapDimURL, WMLayer } from '@opengeoweb/webmap';
|
|
6
6
|
import _, { isEqual, isArray, range, zip, throttle } from 'lodash';
|
|
7
|
-
import { useDispatch, useSelector, connect, useStore, Provider } from 'react-redux';
|
|
8
|
-
import { mapSelectors, layerSelectors, layerActions, layerTypes, filterLayers, mapActions, mapEnums, loadingIndicatorSelectors, layerUtils, serviceSelectors, serviceActions, uiSelectors, uiTypes, useSetupDialog, getUserAddedServices, uiActions, genericActions, drawingToolSelectors, syncGroupsSelectors, syncConstants, getViewObjectForSyncGroup, getViewObjectForMapId, loadingIndicatorActions, genericSelectors, defaultLayers, getSingularDrawtoolDrawLayerId, syncGroupsSelector, syncGroupsActions, routerUtils, mapUtils } from '@opengeoweb/store';
|
|
7
|
+
import { useDispatch, useSelector, connect, useStore, shallowEqual, Provider } from 'react-redux';
|
|
8
|
+
import { mapSelectors, layerSelectors, layerActions, layerTypes, filterLayers, mapActions, mapEnums, loadingIndicatorSelectors, layerUtils, serviceSelectors, serviceActions, uiSelectors, uiTypes, useSetupDialog, getUserAddedServices, uiActions, genericActions, drawingToolSelectors, syncGroupsSelectors, syncConstants, getViewObjectForSyncGroup, getViewObjectForMapId, loadingIndicatorActions, genericSelectors, PUBLIC_WARNING_DRAW_TOOL_ID, defaultLayers, getSingularDrawtoolDrawLayerId, syncGroupsSelector, syncGroupsActions, routerUtils, mapUtils } from '@opengeoweb/store';
|
|
9
9
|
import i18n from 'i18next';
|
|
10
10
|
import { useTranslation, Trans, I18nextProvider } from 'react-i18next';
|
|
11
11
|
import { TIME_SLIDER_NAMESPACE, timesliderTranslations, defaultTimeSpan, AnimationLengthButton, AnimationLength, AutoUpdateButton, BackwardForwardStepButton, NowButton, handleSetNowEvent, PlayButton, defaultTimeStep, SpeedButton, TimeSpanButton, secondsPerPxFromCanvasWidth, getNewCenterOfFixedPointZoom, TimeStepButton, OptionsMenuButton, TimeSliderButtons, TimeSliderCurrentTimeBox, TimeSliderLegend, onsetNewDateDebounced, getFilteredTime, defaultSecondsPerPx, moveSelectedTimePx, TimeSlider } from '@opengeoweb/time-slider';
|
|
@@ -14,7 +14,7 @@ import { Cached, Add, MapAdd, CollapseSmall, CollapseMedium, CollapseLarge, Coll
|
|
|
14
14
|
import { ReactSortable } from 'react-sortablejs';
|
|
15
15
|
import Sortable from 'sortablejs';
|
|
16
16
|
import { Box as Box$1, Stack } from '@mui/system';
|
|
17
|
-
import { transformExtent, toLonLat } from 'ol/proj';
|
|
17
|
+
import { transformExtent, toLonLat, fromLonLat } from 'ol/proj';
|
|
18
18
|
import { LayerSelectButtonConnect, LayerSelectConnect, DataExplorerButtonConnect } from '@opengeoweb/layer-select';
|
|
19
19
|
import { unByKey } from 'ol/Observable';
|
|
20
20
|
import { useQuery, QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
@@ -23,7 +23,6 @@ import { bbox } from '@turf/turf';
|
|
|
23
23
|
import proj4 from 'proj4';
|
|
24
24
|
import { getIntersection } from 'ol/extent';
|
|
25
25
|
import GeoJSON from 'ol/format/GeoJSON';
|
|
26
|
-
import axios from 'axios';
|
|
27
26
|
import { ImageWMS } from 'ol/source';
|
|
28
27
|
import DOMPurify from 'dompurify';
|
|
29
28
|
import { snackbarTypes, snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
|
|
@@ -2944,6 +2943,9 @@ var DeleteLayerConnect = function DeleteLayerConnect(_ref) {
|
|
|
2944
2943
|
var layerType = useSelector(function (store) {
|
|
2945
2944
|
return layerSelectors.getLayerType(store, layerId);
|
|
2946
2945
|
});
|
|
2946
|
+
var isFeatureSyncLayer = useSelector(function (store) {
|
|
2947
|
+
return layerSelectors.getIsFeatureSyncLayer(store, layerId);
|
|
2948
|
+
});
|
|
2947
2949
|
var isLayerEnabled = useSelector(function (store) {
|
|
2948
2950
|
return layerSelectors.getLayerEnabled(store, layerId);
|
|
2949
2951
|
});
|
|
@@ -2960,6 +2962,9 @@ var DeleteLayerConnect = function DeleteLayerConnect(_ref) {
|
|
|
2960
2962
|
var onDelete = React.useCallback(function (_ref3) {
|
|
2961
2963
|
var mapId = _ref3.mapId,
|
|
2962
2964
|
layerId = _ref3.layerId;
|
|
2965
|
+
if (isFeatureSyncLayer) {
|
|
2966
|
+
return;
|
|
2967
|
+
}
|
|
2963
2968
|
if (layerType === LayerType.edrFeatureLayer) {
|
|
2964
2969
|
void confirmationDialog({
|
|
2965
2970
|
title: t('delete-dialog-title'),
|
|
@@ -2978,16 +2983,17 @@ var DeleteLayerConnect = function DeleteLayerConnect(_ref) {
|
|
|
2978
2983
|
layerId: layerId
|
|
2979
2984
|
});
|
|
2980
2985
|
}
|
|
2981
|
-
}, [layerType, confirmationDialog, t, layerDelete]);
|
|
2986
|
+
}, [isFeatureSyncLayer, layerType, confirmationDialog, t, layerDelete]);
|
|
2982
2987
|
return jsx(CustomIconButton, {
|
|
2983
2988
|
"data-testid": "deleteButton",
|
|
2989
|
+
disabled: isFeatureSyncLayer,
|
|
2984
2990
|
onClick: function onClick() {
|
|
2985
2991
|
return onDelete({
|
|
2986
2992
|
mapId: mapId,
|
|
2987
2993
|
layerId: layerId
|
|
2988
2994
|
});
|
|
2989
2995
|
},
|
|
2990
|
-
shouldShowAsDisabled: !isLayerEnabled,
|
|
2996
|
+
shouldShowAsDisabled: !isLayerEnabled || isFeatureSyncLayer,
|
|
2991
2997
|
tooltipTitle: nonEmptyTooltipTitle,
|
|
2992
2998
|
children: icon
|
|
2993
2999
|
});
|
|
@@ -3277,10 +3283,15 @@ var useLoadDurationLabel = function useLoadDurationLabel(mapId, layerId) {
|
|
|
3277
3283
|
var SelectableFeatures = function SelectableFeatures(_ref) {
|
|
3278
3284
|
var layerId = _ref.layerId,
|
|
3279
3285
|
isSelectable = _ref.isSelectable,
|
|
3280
|
-
onToggleSelectable = _ref.onToggleSelectable
|
|
3286
|
+
onToggleSelectable = _ref.onToggleSelectable,
|
|
3287
|
+
_ref$disabled = _ref.disabled,
|
|
3288
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
3281
3289
|
var _useCoreTranslation = useCoreTranslation(),
|
|
3282
3290
|
t = _useCoreTranslation.t;
|
|
3283
3291
|
var onClickCheckbox = function onClickCheckbox() {
|
|
3292
|
+
if (disabled) {
|
|
3293
|
+
return;
|
|
3294
|
+
}
|
|
3284
3295
|
onToggleSelectable();
|
|
3285
3296
|
};
|
|
3286
3297
|
return jsx(ListItem, {
|
|
@@ -3291,7 +3302,9 @@ var SelectableFeatures = function SelectableFeatures(_ref) {
|
|
|
3291
3302
|
borderBottom: '1px solid #E0E0E0'
|
|
3292
3303
|
},
|
|
3293
3304
|
children: jsxs(ListItemButton, {
|
|
3305
|
+
"data-testid": "selectablefeatures-checkbox-" + layerId,
|
|
3294
3306
|
disableGutters: true,
|
|
3307
|
+
disabled: disabled,
|
|
3295
3308
|
onClick: function onClick() {
|
|
3296
3309
|
return onClickCheckbox();
|
|
3297
3310
|
},
|
|
@@ -3316,8 +3329,8 @@ var SelectableFeatures = function SelectableFeatures(_ref) {
|
|
|
3316
3329
|
},
|
|
3317
3330
|
children: jsx(Checkbox, {
|
|
3318
3331
|
checked: isSelectable,
|
|
3319
|
-
"data-testid": "selectablefeatures-checkbox-" + layerId,
|
|
3320
3332
|
disableRipple: true,
|
|
3333
|
+
disabled: disabled,
|
|
3321
3334
|
name: "selectablefeatures-checkbox-" + layerId,
|
|
3322
3335
|
tabIndex: -1
|
|
3323
3336
|
})
|
|
@@ -3327,7 +3340,8 @@ var SelectableFeatures = function SelectableFeatures(_ref) {
|
|
|
3327
3340
|
};
|
|
3328
3341
|
|
|
3329
3342
|
var SelectableFeaturesCheckboxConnect = function SelectableFeaturesCheckboxConnect(_ref) {
|
|
3330
|
-
var layerId = _ref.layerId
|
|
3343
|
+
var layerId = _ref.layerId,
|
|
3344
|
+
disabled = _ref.disabled;
|
|
3331
3345
|
var dispatch = useDispatch();
|
|
3332
3346
|
var isSelectable = useSelector(function (store) {
|
|
3333
3347
|
return layerSelectors.getIsLayerSelectable(store, layerId);
|
|
@@ -3338,6 +3352,7 @@ var SelectableFeaturesCheckboxConnect = function SelectableFeaturesCheckboxConne
|
|
|
3338
3352
|
}));
|
|
3339
3353
|
}, [dispatch, layerId]);
|
|
3340
3354
|
return jsx(SelectableFeatures, {
|
|
3355
|
+
disabled: disabled,
|
|
3341
3356
|
isSelectable: isSelectable,
|
|
3342
3357
|
layerId: layerId,
|
|
3343
3358
|
onToggleSelectable: toggleSelectable
|
|
@@ -3349,6 +3364,8 @@ var LayerManagerMenuButton = function LayerManagerMenuButton(_ref) {
|
|
|
3349
3364
|
layerId = _ref.layerId,
|
|
3350
3365
|
_ref$isFeatureLayer = _ref.isFeatureLayer,
|
|
3351
3366
|
isFeatureLayer = _ref$isFeatureLayer === void 0 ? false : _ref$isFeatureLayer,
|
|
3367
|
+
_ref$isFeatureSyncLay = _ref.isFeatureSyncLayer,
|
|
3368
|
+
isFeatureSyncLayer = _ref$isFeatureSyncLay === void 0 ? false : _ref$isFeatureSyncLay,
|
|
3352
3369
|
onLayerDuplicate = _ref.onLayerDuplicate,
|
|
3353
3370
|
onLayerCopyToOtherMaps = _ref.onLayerCopyToOtherMaps,
|
|
3354
3371
|
onLayerRemoveFromOtherMaps = _ref.onLayerRemoveFromOtherMaps,
|
|
@@ -3388,15 +3405,18 @@ var LayerManagerMenuButton = function LayerManagerMenuButton(_ref) {
|
|
|
3388
3405
|
menuItems: [{
|
|
3389
3406
|
text: t('layermanager-layer-duplicate'),
|
|
3390
3407
|
action: onClickDuplicate,
|
|
3391
|
-
icon: jsx(Copy, {})
|
|
3408
|
+
icon: jsx(Copy, {}),
|
|
3409
|
+
isDisabled: isFeatureSyncLayer
|
|
3392
3410
|
}, {
|
|
3393
3411
|
text: t('layermanager-layer-duplicate-to-other-maps'),
|
|
3394
3412
|
action: onClickCopyToOtherMaps,
|
|
3395
|
-
icon: jsx(Copy, {})
|
|
3413
|
+
icon: jsx(Copy, {}),
|
|
3414
|
+
isDisabled: isFeatureSyncLayer
|
|
3396
3415
|
}, {
|
|
3397
3416
|
text: t('layermanager-layer-remove-from-other-maps'),
|
|
3398
3417
|
action: onClickRemoveFromOtherMaps,
|
|
3399
|
-
icon: jsx(Delete, {})
|
|
3418
|
+
icon: jsx(Delete, {}),
|
|
3419
|
+
isDisabled: isFeatureSyncLayer
|
|
3400
3420
|
}, {
|
|
3401
3421
|
text: t('layermanager-layer-zoom-to-extent'),
|
|
3402
3422
|
action: onClickZoomToExtent,
|
|
@@ -3406,6 +3426,7 @@ var LayerManagerMenuButton = function LayerManagerMenuButton(_ref) {
|
|
|
3406
3426
|
menuPosition: "bottom",
|
|
3407
3427
|
tooltipTitle: nonEmptyTooltipTitle,
|
|
3408
3428
|
children: !!isFeatureLayer && jsx(SelectableFeaturesCheckboxConnect, {
|
|
3429
|
+
disabled: isFeatureSyncLayer,
|
|
3409
3430
|
layerId: layerId
|
|
3410
3431
|
})
|
|
3411
3432
|
});
|
|
@@ -4320,6 +4341,9 @@ var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref)
|
|
|
4320
4341
|
var layerType = useSelector(function (store) {
|
|
4321
4342
|
return layerSelectors.getLayerType(store, layerId);
|
|
4322
4343
|
});
|
|
4344
|
+
var isFeatureSyncLayer = useSelector(function (store) {
|
|
4345
|
+
return layerSelectors.getIsFeatureSyncLayer(store, layerId);
|
|
4346
|
+
});
|
|
4323
4347
|
var isFeatureLayer = layerType === LayerType.featureLayer;
|
|
4324
4348
|
var mapSrs = useSelector(function (store) {
|
|
4325
4349
|
return mapSelectors.getSrs(store, mapId);
|
|
@@ -4428,6 +4452,7 @@ var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref)
|
|
|
4428
4452
|
canZoomToLayerExtent: canZoomToLayerExtent,
|
|
4429
4453
|
icon: icon,
|
|
4430
4454
|
isFeatureLayer: isFeatureLayer,
|
|
4455
|
+
isFeatureSyncLayer: isFeatureSyncLayer,
|
|
4431
4456
|
layerId: layerId,
|
|
4432
4457
|
mapId: mapId,
|
|
4433
4458
|
onLayerCopyToOtherMaps: copyLayerToOtherMaps,
|
|
@@ -5977,24 +6002,30 @@ var useFetchServices = function useFetchServices(dialogType, preloadedServices,
|
|
|
5977
6002
|
shouldDisableFetch = false;
|
|
5978
6003
|
}
|
|
5979
6004
|
var dispatch = useDispatch();
|
|
6005
|
+
var store = useStore();
|
|
5980
6006
|
var isOpenInStore = useSelector(function (store) {
|
|
5981
6007
|
return uiSelectors.getisDialogOpen(store, dialogType);
|
|
5982
6008
|
});
|
|
5983
|
-
var services = useSelector(function (store) {
|
|
5984
|
-
return serviceSelectors.getServiceIds(store);
|
|
5985
|
-
});
|
|
5986
6009
|
var fetchInitialServices = useCallback(function (services) {
|
|
5987
6010
|
dispatch(serviceActions.fetchInitialServices({
|
|
5988
6011
|
services: services
|
|
5989
6012
|
}));
|
|
5990
6013
|
}, [dispatch]);
|
|
5991
6014
|
useEffect(function () {
|
|
5992
|
-
if (!shouldDisableFetch && isOpenInStore && preloadedServices && preloadedServices.length > 0
|
|
6015
|
+
if (!shouldDisableFetch && isOpenInStore && preloadedServices && preloadedServices.length > 0) {
|
|
5993
6016
|
var allServicesToLoad = mergePresetsAndUserAddedServices(preloadedServices, getUserAddedServices());
|
|
5994
|
-
void getServicesToLoad(allServicesToLoad).then(
|
|
6017
|
+
void getServicesToLoad(allServicesToLoad).then(function (servicesToLoad) {
|
|
6018
|
+
var currentServiceIds = serviceSelectors.getServiceIds(store.getState());
|
|
6019
|
+
var missingServices = servicesToLoad.filter(function (service) {
|
|
6020
|
+
return !currentServiceIds.includes(service.id);
|
|
6021
|
+
});
|
|
6022
|
+
if (missingServices.length > 0) {
|
|
6023
|
+
fetchInitialServices(missingServices);
|
|
6024
|
+
}
|
|
6025
|
+
});
|
|
5995
6026
|
}
|
|
5996
6027
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5997
|
-
}, [isOpenInStore
|
|
6028
|
+
}, [isOpenInStore]);
|
|
5998
6029
|
};
|
|
5999
6030
|
var mergePresetsAndUserAddedServices = function mergePresetsAndUserAddedServices(presets, userAddedServices) {
|
|
6000
6031
|
return Object.values(Object.assign({}, presets.reduce(function (byUrl, preset) {
|
|
@@ -7874,7 +7905,9 @@ var createLinkedFeatureCollection = function createLinkedFeatureCollection(linke
|
|
|
7874
7905
|
var isSelected = selectedFeatureIds == null ? void 0 : selectedFeatureIds.has((_getGeoFeatureSelecti = getGeoFeatureSelectionKey(geoFeature)) != null ? _getGeoFeatureSelecti : '');
|
|
7875
7906
|
var existingProperties = geoFeature.properties && typeof geoFeature.properties === 'object' ? geoFeature.properties : {};
|
|
7876
7907
|
return Object.assign({}, geoFeature, {
|
|
7877
|
-
properties: Object.assign({}, existingProperties,
|
|
7908
|
+
properties: Object.assign({}, existingProperties, {
|
|
7909
|
+
sourceLayerId: featureLayer.id
|
|
7910
|
+
}, isSelected ? {
|
|
7878
7911
|
highlightSelectedFeature: true
|
|
7879
7912
|
} : undefined, featureLayer.originalId ? {
|
|
7880
7913
|
originalId: featureLayer.originalId
|
|
@@ -8372,6 +8405,7 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8372
8405
|
} : undefined,
|
|
8373
8406
|
featureCollection: !layer.isInEditMode ? displayGeojson : undefined,
|
|
8374
8407
|
hoverSelect: hoverSelect,
|
|
8408
|
+
layerId: layerId,
|
|
8375
8409
|
opacity: layer.opacity,
|
|
8376
8410
|
style: style,
|
|
8377
8411
|
visible: layer.enabled,
|
|
@@ -8518,6 +8552,64 @@ var getTitle = function getTitle(layerId) {
|
|
|
8518
8552
|
var wmjsLayer = webmapUtils.getWMLayerById(layerId);
|
|
8519
8553
|
return wmjsLayer ? wmjsLayer.title || wmjsLayer.name : layerId;
|
|
8520
8554
|
};
|
|
8555
|
+
var getWmtsFeatureInfoUrl = function getWmtsFeatureInfoUrl(wmjsLayer, layer, mapPinLocation) {
|
|
8556
|
+
var _layer$dimensions;
|
|
8557
|
+
(_layer$dimensions = layer.dimensions) == null || _layer$dimensions.forEach(function (dim) {
|
|
8558
|
+
var wmDim = wmjsLayer == null ? void 0 : wmjsLayer.getDimension(dim.name);
|
|
8559
|
+
if (wmDim && wmDim.getValue() !== dim.currentValue) {
|
|
8560
|
+
wmDim.setValue(dim.currentValue);
|
|
8561
|
+
}
|
|
8562
|
+
});
|
|
8563
|
+
var wmtsSource = wmjsLayer == null ? void 0 : wmjsLayer.olSource;
|
|
8564
|
+
if (!wmtsSource || !(wmjsLayer != null && wmjsLayer.getfeatureinfoURL)) {
|
|
8565
|
+
return '';
|
|
8566
|
+
}
|
|
8567
|
+
var tileGrid = wmtsSource.getTileGrid();
|
|
8568
|
+
var tileCoord = tileGrid.getTileCoordForCoordAndResolution([mapPinLocation.projectionX, mapPinLocation.projectionY], mapPinLocation.resolution);
|
|
8569
|
+
if (!tileCoord) {
|
|
8570
|
+
return '';
|
|
8571
|
+
}
|
|
8572
|
+
var z = tileCoord[0],
|
|
8573
|
+
tileCol = tileCoord[1],
|
|
8574
|
+
tileRow = tileCoord[2];
|
|
8575
|
+
var tileExtent = tileGrid.getTileCoordExtent(tileCoord);
|
|
8576
|
+
var tileResolution = tileGrid.getResolution(z);
|
|
8577
|
+
var tileSize = tileGrid.getTileSize(z);
|
|
8578
|
+
var tileWidth = Array.isArray(tileSize) ? tileSize[0] : tileSize;
|
|
8579
|
+
var tileHeight = Array.isArray(tileSize) ? tileSize[1] : tileSize;
|
|
8580
|
+
if (!tileResolution || !tileWidth || !tileHeight) {
|
|
8581
|
+
return '';
|
|
8582
|
+
}
|
|
8583
|
+
var i = Math.min(Math.max(Math.floor((mapPinLocation.projectionX - tileExtent[0]) / tileResolution), 0), tileWidth - 1);
|
|
8584
|
+
var pixelJ = Math.min(Math.max(Math.floor((tileExtent[3] - mapPinLocation.projectionY) / tileResolution), 0), tileHeight - 1);
|
|
8585
|
+
var matrixIds = (tileGrid.getMatrixIds == null ? void 0 : tileGrid.getMatrixIds()) || [];
|
|
8586
|
+
var tileMatrix = matrixIds[z] || "" + z;
|
|
8587
|
+
var params = new URLSearchParams();
|
|
8588
|
+
params.set('SERVICE', 'WMTS');
|
|
8589
|
+
params.set('REQUEST', 'GetFeatureInfo');
|
|
8590
|
+
params.set('VERSION', '1.0.0');
|
|
8591
|
+
params.set('LAYER', wmjsLayer.getLayerName());
|
|
8592
|
+
params.set('STYLE', wmjsLayer.getStyle() || 'default');
|
|
8593
|
+
params.set('TILEMATRIXSET', wmjsLayer.wmtsTileMatrixSet || 'EPSG:3857');
|
|
8594
|
+
params.set('TILEMATRIX', tileMatrix);
|
|
8595
|
+
params.set('TILEROW', "" + tileRow);
|
|
8596
|
+
params.set('TILECOL', "" + tileCol);
|
|
8597
|
+
params.set('I', "" + i);
|
|
8598
|
+
params.set('J', "" + pixelJ);
|
|
8599
|
+
params.set('INFOFORMAT', wmjsLayer.wmtsInfoFormat || 'text/html');
|
|
8600
|
+
var mapDimURL = getMapDimURL(wmjsLayer).toString();
|
|
8601
|
+
if (mapDimURL) {
|
|
8602
|
+
var dimParams = new URLSearchParams(mapDimURL);
|
|
8603
|
+
dimParams.forEach(function (value, key) {
|
|
8604
|
+
params.set(key.toUpperCase(), value);
|
|
8605
|
+
});
|
|
8606
|
+
}
|
|
8607
|
+
var featureInfoUrl = new URL(wmjsLayer.getfeatureinfoURL);
|
|
8608
|
+
params.forEach(function (value, key) {
|
|
8609
|
+
featureInfoUrl.searchParams.set(key, value);
|
|
8610
|
+
});
|
|
8611
|
+
return featureInfoUrl.toString();
|
|
8612
|
+
};
|
|
8521
8613
|
var getFeatureInfoUrl = function getFeatureInfoUrl(layer, mapPinLocation) {
|
|
8522
8614
|
/*
|
|
8523
8615
|
We need a wmjsLayer to build the getfeatureinfo url (getWMSGetFeatureInfoRequestURL function).
|
|
@@ -8525,13 +8617,13 @@ var getFeatureInfoUrl = function getFeatureInfoUrl(layer, mapPinLocation) {
|
|
|
8525
8617
|
Therefore make a clone of this layer and set its dimensions based on the layer object.
|
|
8526
8618
|
Otherwise we risk making a getfeatureinfo call with outdated dimension values.
|
|
8527
8619
|
*/
|
|
8528
|
-
var
|
|
8529
|
-
|
|
8530
|
-
// WMTS Layers do not support GetFeatureInfo
|
|
8531
|
-
return '';
|
|
8532
|
-
}
|
|
8620
|
+
var originalWmjsLayer = webmapUtils.getWMLayerById(layer.id);
|
|
8621
|
+
var wmjsLayer = originalWmjsLayer.cloneLayer();
|
|
8533
8622
|
if (mapPinLocation) {
|
|
8534
|
-
var _layer$
|
|
8623
|
+
var _layer$dimensions2;
|
|
8624
|
+
if (wmjsLayer.layerType === LayerType.wmtsMapLayer) {
|
|
8625
|
+
return getWmtsFeatureInfoUrl(wmjsLayer, layer, mapPinLocation);
|
|
8626
|
+
}
|
|
8535
8627
|
// OpenLayers WMS version
|
|
8536
8628
|
var source = new ImageWMS({
|
|
8537
8629
|
url: wmjsLayer.getmapURL,
|
|
@@ -8539,7 +8631,7 @@ var getFeatureInfoUrl = function getFeatureInfoUrl(layer, mapPinLocation) {
|
|
|
8539
8631
|
LAYERS: wmjsLayer.getLayerName()
|
|
8540
8632
|
}
|
|
8541
8633
|
});
|
|
8542
|
-
(_layer$
|
|
8634
|
+
(_layer$dimensions2 = layer.dimensions) == null || _layer$dimensions2.forEach(function (dim) {
|
|
8543
8635
|
var wmDim = wmjsLayer.getDimension(dim.name);
|
|
8544
8636
|
if (wmDim && wmDim.getValue() !== dim.currentValue) {
|
|
8545
8637
|
wmDim.setValue(dim.currentValue);
|
|
@@ -8599,6 +8691,32 @@ var sanitizeHTML = function sanitizeHTML(htmlToBeSanitized) {
|
|
|
8599
8691
|
};
|
|
8600
8692
|
};
|
|
8601
8693
|
|
|
8694
|
+
var getMapPinLocation = function getMapPinLocation(mapPinLocation, map) {
|
|
8695
|
+
if (!mapPinLocation) {
|
|
8696
|
+
return undefined;
|
|
8697
|
+
}
|
|
8698
|
+
if (mapPinLocation.projectionX !== undefined && mapPinLocation.projectionY !== undefined && mapPinLocation.resolution !== undefined && mapPinLocation.srs) {
|
|
8699
|
+
return mapPinLocation;
|
|
8700
|
+
}
|
|
8701
|
+
if (!map) {
|
|
8702
|
+
return mapPinLocation;
|
|
8703
|
+
}
|
|
8704
|
+
var view = map.getView();
|
|
8705
|
+
var projection = view == null ? void 0 : view.getProjection();
|
|
8706
|
+
var resolution = view == null ? void 0 : view.getResolution();
|
|
8707
|
+
if (!projection || resolution === undefined) {
|
|
8708
|
+
return mapPinLocation;
|
|
8709
|
+
}
|
|
8710
|
+
var _fromLonLat = fromLonLat([mapPinLocation.lon, mapPinLocation.lat], projection),
|
|
8711
|
+
projectionX = _fromLonLat[0],
|
|
8712
|
+
projectionY = _fromLonLat[1];
|
|
8713
|
+
return Object.assign({}, mapPinLocation, {
|
|
8714
|
+
projectionX: projectionX,
|
|
8715
|
+
projectionY: projectionY,
|
|
8716
|
+
resolution: resolution,
|
|
8717
|
+
srs: projection.getCode()
|
|
8718
|
+
});
|
|
8719
|
+
};
|
|
8602
8720
|
var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
8603
8721
|
var layers = _ref.layers,
|
|
8604
8722
|
isOpen = _ref.isOpen,
|
|
@@ -8615,8 +8733,10 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
8615
8733
|
mapPinLocation = _ref.mapPinLocation;
|
|
8616
8734
|
var _useCoreTranslation = useCoreTranslation(),
|
|
8617
8735
|
t = _useCoreTranslation.t;
|
|
8736
|
+
var _React$useContext = React.useContext(MapContext),
|
|
8737
|
+
map = _React$useContext.map;
|
|
8618
8738
|
/* Ref, state and update function for results per layer map */
|
|
8619
|
-
var gfiResultMap = React.useRef(new Map()).current;
|
|
8739
|
+
var gfiResultMap = React.useRef(new globalThis.Map()).current;
|
|
8620
8740
|
// eslint-disable-next-line react/hook-use-state
|
|
8621
8741
|
var _React$useState = React.useState(),
|
|
8622
8742
|
triggerRerender = _React$useState[1];
|
|
@@ -8631,7 +8751,10 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
8631
8751
|
triggerRerender("" + layerId + isLoading);
|
|
8632
8752
|
};
|
|
8633
8753
|
/* Build a layerlist array with a set of arguments per layer to do the query for */
|
|
8634
|
-
var
|
|
8754
|
+
var mapPinLocationCoordinates = React.useMemo(function () {
|
|
8755
|
+
return getMapPinLocation(mapPinLocation, map);
|
|
8756
|
+
}, [map, mapPinLocation]);
|
|
8757
|
+
var layerToUpdateList = isOpen && mapPinLocationCoordinates ? getLayersToUpdate(mapPinLocationCoordinates, layers) : [];
|
|
8635
8758
|
/*
|
|
8636
8759
|
Build a string based on the GFI urls. If this changes for whatever reason we need to update.
|
|
8637
8760
|
These strings can change very often, therefore they need to be debounced and only use the most recent result must be used.
|
|
@@ -8642,7 +8765,7 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
8642
8765
|
/* Do a GFI call to the server and use the updateLayerResult to provide the results. */
|
|
8643
8766
|
var fetchLayerInfo = /*#__PURE__*/function () {
|
|
8644
8767
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(url, layerId) {
|
|
8645
|
-
var
|
|
8768
|
+
var response, data, errorMessage, _t;
|
|
8646
8769
|
return _regenerator().w(function (_context) {
|
|
8647
8770
|
while (1) switch (_context.p = _context.n) {
|
|
8648
8771
|
case 0:
|
|
@@ -8664,19 +8787,28 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
8664
8787
|
isLoading: true
|
|
8665
8788
|
});
|
|
8666
8789
|
_context.n = 2;
|
|
8667
|
-
return
|
|
8790
|
+
return fetch(url);
|
|
8668
8791
|
case 2:
|
|
8669
|
-
|
|
8670
|
-
|
|
8792
|
+
response = _context.v;
|
|
8793
|
+
if (response.ok) {
|
|
8794
|
+
_context.n = 3;
|
|
8795
|
+
break;
|
|
8796
|
+
}
|
|
8797
|
+
throw new Error("GetFeatureInfo request failed (" + response.status + ")");
|
|
8798
|
+
case 3:
|
|
8799
|
+
_context.n = 4;
|
|
8800
|
+
return response.text();
|
|
8801
|
+
case 4:
|
|
8802
|
+
data = _context.v;
|
|
8671
8803
|
updateLayerResult({
|
|
8672
8804
|
layerId: layerId,
|
|
8673
8805
|
data: data,
|
|
8674
8806
|
isLoading: false
|
|
8675
8807
|
});
|
|
8676
|
-
_context.n =
|
|
8808
|
+
_context.n = 6;
|
|
8677
8809
|
break;
|
|
8678
|
-
case
|
|
8679
|
-
_context.p =
|
|
8810
|
+
case 5:
|
|
8811
|
+
_context.p = 5;
|
|
8680
8812
|
_t = _context.v;
|
|
8681
8813
|
errorMessage = _t instanceof Error ? _t.message : 'fetchLayerInfo failed';
|
|
8682
8814
|
updateLayerResult({
|
|
@@ -8684,10 +8816,10 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
8684
8816
|
data: errorMessage,
|
|
8685
8817
|
isLoading: false
|
|
8686
8818
|
});
|
|
8687
|
-
case
|
|
8819
|
+
case 6:
|
|
8688
8820
|
return _context.a(2);
|
|
8689
8821
|
}
|
|
8690
|
-
}, _callee, null, [[1,
|
|
8822
|
+
}, _callee, null, [[1, 5]]);
|
|
8691
8823
|
}));
|
|
8692
8824
|
return function fetchLayerInfo(_x, _x2) {
|
|
8693
8825
|
return _ref3.apply(this, arguments);
|
|
@@ -8695,7 +8827,7 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
8695
8827
|
}();
|
|
8696
8828
|
/* For each changed getfeature url string, load new data using WMS GetFeatureInfo */
|
|
8697
8829
|
React.useEffect(function () {
|
|
8698
|
-
if (
|
|
8830
|
+
if (mapPinLocationCoordinates && isOpen) {
|
|
8699
8831
|
layerToUpdateList.forEach(function (_ref4) {
|
|
8700
8832
|
var url = _ref4.url,
|
|
8701
8833
|
layerId = _ref4.layerId;
|
|
@@ -8725,7 +8857,7 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
8725
8857
|
sx: {
|
|
8726
8858
|
padding: 0
|
|
8727
8859
|
},
|
|
8728
|
-
children: [!!isOpen && !!hasLayers && !!
|
|
8860
|
+
children: [!!isOpen && !!hasLayers && !!mapPinLocationCoordinates && jsx(Box, {
|
|
8729
8861
|
"data-testid": "GetFeatureInfoList",
|
|
8730
8862
|
ref: stopWheelEventPropagationRef,
|
|
8731
8863
|
children: layerToUpdateList.map(function (layer) {
|
|
@@ -8778,7 +8910,7 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
8778
8910
|
})]
|
|
8779
8911
|
}, layerId);
|
|
8780
8912
|
})
|
|
8781
|
-
}), !!hasLayers && !
|
|
8913
|
+
}), !!hasLayers && !mapPinLocationCoordinates && jsx(Typography, {
|
|
8782
8914
|
"data-testid": "click-on-map-for-info",
|
|
8783
8915
|
sx: {
|
|
8784
8916
|
padding: '10px'
|
|
@@ -9050,12 +9182,24 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9050
9182
|
});
|
|
9051
9183
|
return visibilityById;
|
|
9052
9184
|
}, [layersState]);
|
|
9053
|
-
var
|
|
9185
|
+
var allWarningDialogFeatureLayers = useSelector(function (state) {
|
|
9054
9186
|
return genericSelectors.selectFeatureSyncLayersForPanel(state, 'warning-dialog');
|
|
9055
9187
|
});
|
|
9188
|
+
var warningDialogFeatureLayers = React.useMemo(function () {
|
|
9189
|
+
return allWarningDialogFeatureLayers.filter(function (layer) {
|
|
9190
|
+
return layer.mapId === mapId;
|
|
9191
|
+
});
|
|
9192
|
+
}, [allWarningDialogFeatureLayers, mapId]);
|
|
9056
9193
|
var warningDialogFeatures = React.useMemo(function () {
|
|
9057
9194
|
return createWarningDialogFeatureLayers(warningDialogFeatureLayers);
|
|
9058
9195
|
}, [warningDialogFeatureLayers]);
|
|
9196
|
+
var hasPublicWarningDrawLayer = featureLayers.some(function (layer) {
|
|
9197
|
+
var _layer$id;
|
|
9198
|
+
return (_layer$id = layer.id) == null ? void 0 : _layer$id.startsWith("drawLayer-" + PUBLIC_WARNING_DRAW_TOOL_ID + "-");
|
|
9199
|
+
});
|
|
9200
|
+
var warningDialogFeaturesForHighlight = React.useMemo(function () {
|
|
9201
|
+
return hasPublicWarningDrawLayer ? [] : warningDialogFeatures;
|
|
9202
|
+
}, [hasPublicWarningDrawLayer, warningDialogFeatures]);
|
|
9059
9203
|
var warningDialogFeatureKeys = React.useMemo(function () {
|
|
9060
9204
|
return createWarningDialogFeatureKeys(warningDialogFeatures);
|
|
9061
9205
|
}, [warningDialogFeatures]);
|
|
@@ -9064,11 +9208,6 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9064
9208
|
var linkedFeaturesFromState = useSelector(function (store) {
|
|
9065
9209
|
return genericSelectors.selectLinkedFeatureLayersForMap(store, mapId);
|
|
9066
9210
|
});
|
|
9067
|
-
// Form-specific features (draft/edit geometries) from linked panels.
|
|
9068
|
-
// Kept separate from linkedFeatures so edit-mode filtering can be applied.
|
|
9069
|
-
var linkedFormFeaturesFromState = useSelector(function (store) {
|
|
9070
|
-
return genericSelectors.selectLinkedFormFeaturesForMap(store, mapId);
|
|
9071
|
-
});
|
|
9072
9211
|
// Raw shared-data payload grouped per linked panel id.
|
|
9073
9212
|
// Needed for ownership lookup (feature key -> panel id(s)) when routing
|
|
9074
9213
|
// selection/hover updates back to the correct source panel(s).
|
|
@@ -9099,19 +9238,6 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9099
9238
|
return featureCollection.features.length > 0;
|
|
9100
9239
|
});
|
|
9101
9240
|
}, [featureSyncLayerVisibilityById, linkedFeaturesFromState, selectedFeatureIdsByLayerKey, warningDialogFeatureKeys]);
|
|
9102
|
-
var linkedFormFeatures = React.useMemo(function () {
|
|
9103
|
-
return {
|
|
9104
|
-
type: 'FeatureCollection',
|
|
9105
|
-
features: linkedFormFeaturesFromState.flatMap(function (feature) {
|
|
9106
|
-
var _feature$geoJSON$feat;
|
|
9107
|
-
// Filter out any form features currently in Edit mode
|
|
9108
|
-
if ((_feature$geoJSON$feat = feature.geoJSON.features[0]) != null && (_feature$geoJSON$feat = _feature$geoJSON$feat.properties) != null && _feature$geoJSON$feat.inEditMode) {
|
|
9109
|
-
return [];
|
|
9110
|
-
}
|
|
9111
|
-
return feature.geoJSON.features;
|
|
9112
|
-
})
|
|
9113
|
-
};
|
|
9114
|
-
}, [linkedFormFeaturesFromState]);
|
|
9115
9241
|
var srs = useSelector(function (store) {
|
|
9116
9242
|
return mapSelectors.getSrs(store, mapId);
|
|
9117
9243
|
});
|
|
@@ -9200,20 +9326,43 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9200
9326
|
var disableMapPin = useSelector(function (store) {
|
|
9201
9327
|
return mapSelectors.getDisableMapPin(store, mapId);
|
|
9202
9328
|
});
|
|
9329
|
+
var isCurrentMapDrawToolActive = useSelector(function (state) {
|
|
9330
|
+
return drawingToolSelectors.selectAllDrawingTools(state).some(function (tool) {
|
|
9331
|
+
var _layerSelectors$getLa;
|
|
9332
|
+
if (!tool.activeDrawModeId) {
|
|
9333
|
+
return false;
|
|
9334
|
+
}
|
|
9335
|
+
return ((_layerSelectors$getLa = layerSelectors.getLayerById(state, tool.geoJSONLayerId)) == null ? void 0 : _layerSelectors$getLa.mapId) === mapId;
|
|
9336
|
+
});
|
|
9337
|
+
});
|
|
9338
|
+
var drawToolLayerIds = useSelector(function (state) {
|
|
9339
|
+
return drawingToolSelectors.selectAllDrawingTools(state).map(function (tool) {
|
|
9340
|
+
return tool.geoJSONLayerId;
|
|
9341
|
+
}).filter(function (layerId) {
|
|
9342
|
+
return Boolean(layerId);
|
|
9343
|
+
});
|
|
9344
|
+
}, shallowEqual);
|
|
9345
|
+
var shouldHandleMapPinClick = React.useCallback(function (event) {
|
|
9346
|
+
var clickedLayerIds = new Set();
|
|
9347
|
+
event.map.forEachFeatureAtPixel(event.pixel, function (_feature, layerAtPixel) {
|
|
9348
|
+
var layerId = layerAtPixel == null ? void 0 : layerAtPixel.get('layerId');
|
|
9349
|
+
if (typeof layerId === 'string') {
|
|
9350
|
+
clickedLayerIds.add(layerId);
|
|
9351
|
+
}
|
|
9352
|
+
});
|
|
9353
|
+
return !drawToolLayerIds.some(function (layerId) {
|
|
9354
|
+
return clickedLayerIds.has(layerId);
|
|
9355
|
+
});
|
|
9356
|
+
}, [drawToolLayerIds]);
|
|
9203
9357
|
var mapPinChangeLocation = React.useCallback(function (clickedLocation) {
|
|
9204
|
-
var _hoverLinkedFeature$g, _hoverLinkedFeature$g2;
|
|
9205
|
-
if (disableMapPin) {
|
|
9358
|
+
var _hoverLinkedFeature$g, _hoverLinkedFeature$g2, _hoverLinkedFeature$g3;
|
|
9359
|
+
if (disableMapPin || isCurrentMapDrawToolActive) {
|
|
9206
9360
|
return;
|
|
9207
9361
|
}
|
|
9208
9362
|
var mapPinLocation = getCenterOfLinkedFeature(hoverLinkedFeature, srs) || clickedLocation;
|
|
9209
9363
|
var selectedFeatureId = (hoverLinkedFeature == null || (_hoverLinkedFeature$g = hoverLinkedFeature.getId()) == null ? void 0 : _hoverLinkedFeature$g.toString()) || (hoverLinkedFeature == null || (_hoverLinkedFeature$g2 = hoverLinkedFeature.get('originalId')) == null ? void 0 : _hoverLinkedFeature$g2.toString()) || '';
|
|
9210
|
-
var
|
|
9211
|
-
|
|
9212
|
-
dispatch(layerActions.setSelectedFeatures({
|
|
9213
|
-
layerId: "drawlayer-" + mapId,
|
|
9214
|
-
selectedFeatureIds: selectedFeatureId ? [selectedFeatureId] : []
|
|
9215
|
-
}));
|
|
9216
|
-
}
|
|
9364
|
+
var hoveredFeatureSourceLayerId = hoverLinkedFeature == null || (_hoverLinkedFeature$g3 = hoverLinkedFeature.get('sourceLayerId')) == null ? void 0 : _hoverLinkedFeature$g3.toString();
|
|
9365
|
+
var isHoveredFeatureSyncLayer = hoveredFeatureSourceLayerId ? layerSelectors.getIsFeatureSyncLayer(store.getState(), hoveredFeatureSourceLayerId) : false;
|
|
9217
9366
|
var state = store.getState();
|
|
9218
9367
|
var directlyLinkedPanelIds = genericSelectors.selectLinkedPanelIdsForMap(state, mapId);
|
|
9219
9368
|
var connectedMapIds = new Set([mapId]);
|
|
@@ -9245,6 +9394,13 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9245
9394
|
});
|
|
9246
9395
|
var targetPanelIds = getFeatureSelectionTargetPanelIds(selectedFeatureId, featureOwnerPanelIdsById, directlyLinkedPanelIds);
|
|
9247
9396
|
var mapIdsToUpdate = directlyLinkedMapIds.size > 0 ? Array.from(directlyLinkedMapIds) : [mapId];
|
|
9397
|
+
var shouldMirrorSelectionToDrawLayer = hoverLinkedFeature && hoverLinkedFeature.get('isReadonly') !== true && !isHoveredFeatureSyncLayer && targetPanelIds.length === 0;
|
|
9398
|
+
if (shouldMirrorSelectionToDrawLayer) {
|
|
9399
|
+
dispatch(layerActions.setSelectedFeatures({
|
|
9400
|
+
layerId: "drawlayer-" + mapId,
|
|
9401
|
+
selectedFeatureIds: selectedFeatureId ? [selectedFeatureId] : []
|
|
9402
|
+
}));
|
|
9403
|
+
}
|
|
9248
9404
|
if (targetPanelIds.length > 0) {
|
|
9249
9405
|
directlyLinkedPanelIds.forEach(function (panelId) {
|
|
9250
9406
|
var featureIdForPanel = targetPanelIds.includes(panelId) ? selectedFeatureId : '';
|
|
@@ -9263,7 +9419,7 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9263
9419
|
mapPinLocation: mapPinLocation
|
|
9264
9420
|
}));
|
|
9265
9421
|
});
|
|
9266
|
-
}, [dispatch, featureOwnerPanelIdsById, disableMapPin, hoverLinkedFeature, mapId, setSelectedFeatureIdsForPanel, srs, store]);
|
|
9422
|
+
}, [dispatch, featureOwnerPanelIdsById, disableMapPin, hoverLinkedFeature, isCurrentMapDrawToolActive, mapId, setSelectedFeatureIdsForPanel, srs, store]);
|
|
9267
9423
|
var isActiveWindowId = useSelector(function (store) {
|
|
9268
9424
|
return uiSelectors.getIsActiveWindowId(store, mapId);
|
|
9269
9425
|
});
|
|
@@ -9312,8 +9468,8 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9312
9468
|
};
|
|
9313
9469
|
}, [view, mapId, srs, dispatch]);
|
|
9314
9470
|
var featureProperties = React.useMemo(function () {
|
|
9315
|
-
var _hoverLinkedFeature$
|
|
9316
|
-
return (_hoverLinkedFeature$
|
|
9471
|
+
var _hoverLinkedFeature$g4;
|
|
9472
|
+
return (_hoverLinkedFeature$g4 = hoverLinkedFeature == null || hoverLinkedFeature.getProperties == null ? void 0 : hoverLinkedFeature.getProperties()) != null ? _hoverLinkedFeature$g4 : {};
|
|
9317
9473
|
}, [hoverLinkedFeature]);
|
|
9318
9474
|
var hoverIdFromFeature = hoverLinkedFeature == null ? void 0 : hoverLinkedFeature.get('originalId');
|
|
9319
9475
|
var hoverId = typeof hoverIdFromFeature === 'string' && hoverIdFromFeature || (typeof (featureProperties == null ? void 0 : featureProperties.originalId) === 'string' ? featureProperties.originalId : undefined);
|
|
@@ -9462,7 +9618,7 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9462
9618
|
}, [isSearchDialogOpen]);
|
|
9463
9619
|
useFitAndHighlightWarningFeature({
|
|
9464
9620
|
view: view,
|
|
9465
|
-
warningDialogFeatures:
|
|
9621
|
+
warningDialogFeatures: warningDialogFeaturesForHighlight,
|
|
9466
9622
|
srs: srs,
|
|
9467
9623
|
mapId: mapId
|
|
9468
9624
|
});
|
|
@@ -9483,23 +9639,12 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9483
9639
|
})
|
|
9484
9640
|
};
|
|
9485
9641
|
}, [hoveredLinkedFeatureIds, linkedFeatureCollections]);
|
|
9486
|
-
var filteredLinkedFormFeatures = React.useMemo(function () {
|
|
9487
|
-
return {
|
|
9488
|
-
type: 'FeatureCollection',
|
|
9489
|
-
features: linkedFormFeatures.features.filter(function (feature) {
|
|
9490
|
-
var _feature$properties2;
|
|
9491
|
-
var featureId = feature.id !== undefined ? String(feature.id) : undefined;
|
|
9492
|
-
var originalId = typeof ((_feature$properties2 = feature.properties) == null ? void 0 : _feature$properties2.originalId) === 'string' ? feature.properties.originalId : undefined;
|
|
9493
|
-
return !(featureId && warningDialogFeatureKeys.has(featureId) || originalId && warningDialogFeatureKeys.has(originalId));
|
|
9494
|
-
})
|
|
9495
|
-
};
|
|
9496
|
-
}, [linkedFormFeatures, warningDialogFeatureKeys]);
|
|
9497
9642
|
var combinedLinkedFeatures = React.useMemo(function () {
|
|
9498
9643
|
return {
|
|
9499
9644
|
type: 'FeatureCollection',
|
|
9500
|
-
features:
|
|
9645
|
+
features: linkedFeatureCollectionsWithHover.features
|
|
9501
9646
|
};
|
|
9502
|
-
}, [linkedFeatureCollectionsWithHover
|
|
9647
|
+
}, [linkedFeatureCollectionsWithHover]);
|
|
9503
9648
|
return jsx(TimeContext.Provider, {
|
|
9504
9649
|
value: prefetchTimespan,
|
|
9505
9650
|
children: jsxs(OpenLayersMapView, {
|
|
@@ -9549,7 +9694,8 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9549
9694
|
disableMapPin: disableMapPin,
|
|
9550
9695
|
displayMapPin: displayMapPin,
|
|
9551
9696
|
mapPinLocation: mapPinLocation,
|
|
9552
|
-
selectLocation: mapPinChangeLocation
|
|
9697
|
+
selectLocation: mapPinChangeLocation,
|
|
9698
|
+
shouldHandleClick: shouldHandleMapPinClick
|
|
9553
9699
|
})]
|
|
9554
9700
|
}), jsxs(MapControls, {
|
|
9555
9701
|
"data-testid": "mapControls",
|
package/dist/src/lib/components/LayerManager/LayerContainerRow/LayerRow/Menubutton/MenuButton.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface
|
|
2
|
+
interface LayerManagerMenuButtonProps {
|
|
3
3
|
mapId: string;
|
|
4
4
|
layerId?: string;
|
|
5
5
|
isFeatureLayer?: boolean;
|
|
6
|
+
isFeatureSyncLayer?: boolean;
|
|
6
7
|
onLayerDuplicate?: (payload: {
|
|
7
8
|
mapId: string;
|
|
8
9
|
layerId: string;
|
|
@@ -14,5 +15,5 @@ interface LayerManagerButtonProps {
|
|
|
14
15
|
tooltipTitle?: string;
|
|
15
16
|
icon?: React.ReactNode;
|
|
16
17
|
}
|
|
17
|
-
declare const LayerManagerMenuButton: React.FC<
|
|
18
|
+
declare const LayerManagerMenuButton: React.FC<LayerManagerMenuButtonProps>;
|
|
18
19
|
export default LayerManagerMenuButton;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface
|
|
2
|
+
interface LayerManagerMenuButtonConnectProps {
|
|
3
3
|
mapId: string;
|
|
4
4
|
layerId?: string;
|
|
5
5
|
tooltipTitle?: string;
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
declare const LayerManagerMenuButtonConnect: React.FC<
|
|
8
|
+
declare const LayerManagerMenuButtonConnect: React.FC<LayerManagerMenuButtonConnectProps>;
|
|
9
9
|
export default LayerManagerMenuButtonConnect;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface SelectableFeaturesCheckboxConnectProps {
|
|
3
3
|
layerId: string;
|
|
4
|
+
disabled?: boolean;
|
|
4
5
|
}
|
|
5
6
|
declare const SelectableFeaturesCheckboxConnect: React.FC<SelectableFeaturesCheckboxConnectProps>;
|
|
6
7
|
export default SelectableFeaturesCheckboxConnect;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/core",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.4.0",
|
|
4
4
|
"description": "GeoWeb Core library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"@opengeoweb/webmap-react": "*",
|
|
29
29
|
"@opengeoweb/webmap": "*",
|
|
30
30
|
"@opengeoweb/theme": "*",
|
|
31
|
-
"axios": "^1.16.0",
|
|
32
31
|
"@opengeoweb/layer-select": "*",
|
|
33
32
|
"lodash": "^4.18.1",
|
|
34
33
|
"ol": "^10.4.0",
|