@opengeoweb/core 10.0.0 → 10.1.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/README.md +2 -2
- package/index.esm.js +736 -713
- package/package.json +1 -1
- package/src/lib/components/LayerManager/LayerContainerRow/LayerRow/LayerRow.d.ts +2 -3
- package/src/lib/components/MapViewConnect/MapViewConnect.d.ts +11 -3
- package/src/lib/components/SyncGroups/SimpleTimeSliderConnect.d.ts +2 -2
- package/src/lib/components/TimeSliderConnect/TimeSliderButtonsConnect/AutoUpdateButtonConnect.d.ts +2 -2
- package/src/lib/components/TimeSliderConnect/TimeSliderButtonsConnect/PlayButtonConnect.d.ts +4 -4
- package/src/lib/components/TimeSliderConnect/TimeSliderCurrentTimeBoxConnect.d.ts +1 -1
- package/src/lib/utils/defaultConfigurations.d.ts +3 -3
- package/src/lib/utils/testUtils.d.ts +2 -2
package/index.esm.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { useState, useCallback, useRef } from 'react';
|
|
3
|
+
import React__default, { useState, useCallback, useRef, useMemo } from 'react';
|
|
4
4
|
import { Grid2, Box, MenuItem, Typography, useTheme, Popper, Fade, Tooltip, styled, LinearProgress, FormControl, InputLabel, Paper, List, ListItemButton, ListItemText, CircularProgress, ListSubheader, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, InputAdornment, DialogActions, Button, circularProgressClasses, ListItemIcon, Checkbox, Switch, Select } from '@mui/material';
|
|
5
5
|
import { SHARED_NAMESPACE, sharedTranslations, CustomIconButton, CustomTooltip, TooltipSelect, AlertIcon, sliderHeaderStyle, CustomSlider, ToggleMenu, tooltipContainerStyles, renderCounter, AlertBanner, CustomAccordion, PROJECTION, calculateStartSize, useWheelStopPropagation, ToolContainerDraggable, useDebounce, dateUtils, ErrorBoundary } from '@opengeoweb/shared';
|
|
6
|
-
import { CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, LayersAdd, CloudLoading, ColumnCollapsed, ColumnCollapse, Copy, None, FastForward, AutoUpdateActive, Both, Visibility, VisibilityOff, Delete, DragHandle as DragHandle$1, Cached, Add, MapAdd, WorldMapProjection, Layers,
|
|
6
|
+
import { CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, LayersAdd, CloudLoading, ColumnCollapsed, ColumnCollapse, Copy, None, FastForward, AutoUpdateActive, Both, Visibility, VisibilityOff, Delete, DragHandle as DragHandle$1, Cached, Add, MapAdd, WorldMapProjection, Layers, Search, Exclamation, MyLocation, Close, ExitDomain, Info, ThemeWrapper, lightTheme, FlagBritain, FlagNetherlands, FlagFinland, FlagNorway } from '@opengeoweb/theme';
|
|
7
7
|
import i18n from 'i18next';
|
|
8
8
|
import { initReactI18next, useTranslation, I18nextProvider } from 'react-i18next';
|
|
9
9
|
import { TIMESLIDER_NAMESPACE, timesliderTranslations, defaultTimeSpan, TIME_SLIDER_LEGEND_HEIGHT, SpeedButton, TimeStepButton, AnimationLengthButton, AnimationLength, TimeSpanButton, secondsPerPxFromCanvasWidth, getNewCenterOfFixedPointZoom, OptionsMenuButton, PlayButton, defaultTimeStep, BackwardForwardStepButton, AutoUpdateButton, NowButton, handleSetNowEvent, TimeSliderButtons, TimeSliderCurrentTimeBox, TimeSliderLegend, TimeSlider, onsetNewDateDebounced, getFilteredTime, ControlButtons, OptionsMenu, TimeSliderClock } from '@opengeoweb/timeslider';
|
|
10
|
-
import { WEBMAP_REACT_NAMESPACE, webmapReactTranslations, WEBMAP_NAMESPACE, webmapTranslations, LayerInfoButton, LayerInfoDialog, MapControlButton, MapDimensionSelect, dimensionConfig, DimensionSelectDialog, DimensionSelectButton,
|
|
10
|
+
import { WEBMAP_REACT_NAMESPACE, webmapReactTranslations, WEBMAP_NAMESPACE, webmapTranslations, LayerInfoButton, LayerInfoDialog, MapControlButton, MapDimensionSelect, dimensionConfig, DimensionSelectDialog, DimensionSelectButton, registerDrawFunction, ZoomControls, LegendDialog, LegendButton, MapView, MapViewLayer, MapControls, emptyGeoJSON, publicLayers } from '@opengeoweb/webmap-react';
|
|
11
11
|
import { useDispatch, useSelector, connect, useStore, Provider } from 'react-redux';
|
|
12
12
|
import { ReactSortable } from 'react-sortablejs';
|
|
13
13
|
import Sortable from 'sortablejs';
|
|
14
|
-
import { layerTypes, layerUtils, mapSelectors, layerActions, layerSelectors, serviceSelectors, serviceActions, mapActions, mapEnums, uiSelectors, uiTypes, useSetupDialog, filterLayers, getUserAddedServices, uiActions, genericSelectors, genericActions, drawtoolSelectors, syncConstants, loadingIndicatorActions, syncGroupsSelectors, defaultLayers,
|
|
15
|
-
import
|
|
14
|
+
import { layerTypes, layerUtils, mapSelectors, layerActions, layerSelectors, serviceSelectors, serviceActions, mapActions, mapEnums, uiSelectors, uiTypes, useSetupDialog, filterLayers, getUserAddedServices, uiActions, genericSelectors, genericActions, drawtoolSelectors, syncConstants, loadingIndicatorActions, syncGroupsSelectors, defaultLayers, getSingularDrawtoolDrawLayerId, syncGroupsSelector, syncGroupsActions, routerUtils } from '@opengeoweb/store';
|
|
15
|
+
import _, { isArray, isEqual, debounce, range } from 'lodash';
|
|
16
|
+
import { webmapUtils, queryWMSServiceInfo, queryWMSLayers, queryWMSLayersTree, invalidateWMSGetCapabilities, LayerType, getWMSServiceId, getWMSGetFeatureInfoRequestURL, handleDateUtilsISOString, wmServiceListener, EVENT_GETCAPABILITIES_START, EVENT_GETCAPABILITIES_READY, WMLayer } from '@opengeoweb/webmap';
|
|
16
17
|
import { Box as Box$1, styled as styled$1 } from '@mui/system';
|
|
17
|
-
import _, { isEqual, debounce, range } from 'lodash';
|
|
18
18
|
import { LayerSelectButtonConnect, LayerSelectConnect } from '@opengeoweb/layer-select';
|
|
19
19
|
import axios from 'axios';
|
|
20
20
|
import DOMPurify from 'dompurify';
|
|
@@ -103,19 +103,19 @@ var fi = {
|
|
|
103
103
|
"add-layer-popup-available-services": "Käytettävissä olevat palvelut",
|
|
104
104
|
"add-layer-popup-available-layers": "Palvelusta {{serviceName}} saatavilla olevat karttatasot",
|
|
105
105
|
"add-layer-popup-reload-layers": "Lataa palvelun karttatasot uudelleen",
|
|
106
|
-
"layermanager-title": "
|
|
106
|
+
"layermanager-title": "Karttatasot",
|
|
107
107
|
"layermanager-baselayers-title": "Pohjakartta",
|
|
108
108
|
"layermanager-baselayers-no-available": "Palvelu ei käytettävissä",
|
|
109
109
|
"layermanager-acceptance-time": "Hyväksymisaika",
|
|
110
110
|
"layermanager-dimensions-total-values": "Dimension arvon ({{total_dimensions}} valinnat)",
|
|
111
111
|
"layermanager-dimensions-title": "Dimensiot",
|
|
112
112
|
"layermanager-dimension-title": "Dimensiot",
|
|
113
|
-
"layermanager-opacity-title": "
|
|
114
|
-
"layermanager-opacity-tooltip-prefix": "
|
|
113
|
+
"layermanager-opacity-title": "Peittävyys",
|
|
114
|
+
"layermanager-opacity-tooltip-prefix": "Peittävyys: ",
|
|
115
115
|
"layermanager-style-title": "Tyyli",
|
|
116
116
|
"layermanager-layer-error": "Karttatason lataaminen epäonnistui: tasoa ei löytynyt palvelimelta",
|
|
117
117
|
"layermanager-layer": "Karttataso",
|
|
118
|
-
"layermanager-layer-toggle": "
|
|
118
|
+
"layermanager-layer-toggle": "Karttatason näkyvyys",
|
|
119
119
|
"layermanager-layer-select": "Avaa karttataso valitsin",
|
|
120
120
|
"layermanager-layer-drag": "Raahaa",
|
|
121
121
|
"layermanager-layer-leading": "Johtava karttataso",
|
|
@@ -1660,7 +1660,7 @@ var OpacitySelect = function OpacitySelect(_ref) {
|
|
|
1660
1660
|
marks: marks,
|
|
1661
1661
|
onChange: function onChange(event, newValue) {
|
|
1662
1662
|
event.stopPropagation();
|
|
1663
|
-
onLayerChangeOpacity(newValue);
|
|
1663
|
+
onLayerChangeOpacity(isArray(newValue) ? newValue[0] : newValue);
|
|
1664
1664
|
},
|
|
1665
1665
|
onKeyDown: onKeyDownSlider,
|
|
1666
1666
|
onBlur: function onBlur(event) {
|
|
@@ -2861,7 +2861,7 @@ var RenderLayersConnect = function RenderLayersConnect(_ref) {
|
|
|
2861
2861
|
case 10:
|
|
2862
2862
|
_context.prev = 10;
|
|
2863
2863
|
_context.t0 = _context["catch"](0);
|
|
2864
|
-
console.warn(_context.t0.message);
|
|
2864
|
+
console.warn(_context.t0 instanceof Error ? _context.t0.message : 'addService failed');
|
|
2865
2865
|
case 13:
|
|
2866
2866
|
case "end":
|
|
2867
2867
|
return _context.stop();
|
|
@@ -3662,7 +3662,7 @@ var BaseLayers = function BaseLayers(_ref) {
|
|
|
3662
3662
|
// If already in selectedBaseLayers based on name or id, keep current id
|
|
3663
3663
|
var constructLayerId = function constructLayerId(baseLayer, selectedBaseLayers) {
|
|
3664
3664
|
var foundLayer = selectedBaseLayers.find(function (selectedBaseLayer) {
|
|
3665
|
-
return baseLayer.id === selectedBaseLayer.id || baseLayer.name === selectedBaseLayer.name;
|
|
3665
|
+
return (baseLayer == null ? void 0 : baseLayer.id) === (selectedBaseLayer == null ? void 0 : selectedBaseLayer.id) || baseLayer.name === selectedBaseLayer.name;
|
|
3666
3666
|
});
|
|
3667
3667
|
return foundLayer ? foundLayer.id : webmapUtils.generateLayerId();
|
|
3668
3668
|
};
|
|
@@ -3679,7 +3679,7 @@ var constructListAvailableBaseLayers = function constructListAvailableBaseLayers
|
|
|
3679
3679
|
// Ensure that current selected baselayer(s) are in the baseLayersWithMapId array, otherwise add them
|
|
3680
3680
|
return selectedBaseLayers.reduce(function (list, selectedBaseLayer) {
|
|
3681
3681
|
var foundLayer = baseLayersWithMapId.find(function (layer) {
|
|
3682
|
-
return layer.id === selectedBaseLayer.id;
|
|
3682
|
+
return layer.id === (selectedBaseLayer == null ? void 0 : selectedBaseLayer.id);
|
|
3683
3683
|
});
|
|
3684
3684
|
if (foundLayer) {
|
|
3685
3685
|
return list;
|
|
@@ -4707,9 +4707,9 @@ var ProjectionSelect = function ProjectionSelect(_ref) {
|
|
|
4707
4707
|
value: currentProjection,
|
|
4708
4708
|
list: availableProjections,
|
|
4709
4709
|
currentIndex: index,
|
|
4710
|
-
onChange: function onChange(
|
|
4711
|
-
|
|
4712
|
-
selectProjection(
|
|
4710
|
+
onChange: function onChange(event) {
|
|
4711
|
+
event.stopPropagation();
|
|
4712
|
+
selectProjection(event.target.value);
|
|
4713
4713
|
},
|
|
4714
4714
|
onChangeMouseWheel: function onChangeMouseWheel(e) {
|
|
4715
4715
|
return selectProjection(e.value);
|
|
@@ -5351,38 +5351,6 @@ var MultiMapMultiDimensionSelectConnect = function MultiMapMultiDimensionSelectC
|
|
|
5351
5351
|
});
|
|
5352
5352
|
};
|
|
5353
5353
|
|
|
5354
|
-
var ZoomControlConnect = function ZoomControlConnect(_ref) {
|
|
5355
|
-
var mapId = _ref.mapId;
|
|
5356
|
-
var isVisible = useSelector(function (store) {
|
|
5357
|
-
return mapSelectors.isZoomControlsVisible(store, mapId);
|
|
5358
|
-
});
|
|
5359
|
-
var adagucRef = React.useRef(null);
|
|
5360
|
-
React.useEffect(function () {
|
|
5361
|
-
var webmapjs = webmapUtils.getWMJSMapById(mapId);
|
|
5362
|
-
if (!webmapjs) {
|
|
5363
|
-
return;
|
|
5364
|
-
}
|
|
5365
|
-
adagucRef.current = webmapjs;
|
|
5366
|
-
}, [mapId]);
|
|
5367
|
-
var onZoomIn = function onZoomIn() {
|
|
5368
|
-
return adagucRef.current.zoomIn(undefined);
|
|
5369
|
-
};
|
|
5370
|
-
var onZoomOut = function onZoomOut() {
|
|
5371
|
-
return adagucRef.current.zoomOut();
|
|
5372
|
-
};
|
|
5373
|
-
var onZoomReset = function onZoomReset() {
|
|
5374
|
-
return adagucRef.current.zoomToLayer(adagucRef.current.getActiveLayer());
|
|
5375
|
-
};
|
|
5376
|
-
if (!isVisible) {
|
|
5377
|
-
return null;
|
|
5378
|
-
}
|
|
5379
|
-
return jsx(ZoomControls, {
|
|
5380
|
-
onZoomIn: onZoomIn,
|
|
5381
|
-
onZoomOut: onZoomOut,
|
|
5382
|
-
onZoomReset: onZoomReset
|
|
5383
|
-
});
|
|
5384
|
-
};
|
|
5385
|
-
|
|
5386
5354
|
/* *
|
|
5387
5355
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5388
5356
|
* you may not use this file except in compliance with the License.
|
|
@@ -5628,398 +5596,297 @@ var useKeyboardZoomAndPan = function useKeyboardZoomAndPan(mapIsActive, mapId, m
|
|
|
5628
5596
|
};
|
|
5629
5597
|
var PAN_STEP_PERCENTAGE = 0.02;
|
|
5630
5598
|
|
|
5631
|
-
var
|
|
5632
|
-
var ORIGIN_REACTMAPVIEWCONNECT_ONMAPCHANGEDIMENSION = 'ORIGIN_REACTMAPVIEWCONNECT_ONMAPCHANGEDIMENSION';
|
|
5633
|
-
/**
|
|
5634
|
-
* Connected component used to display the map and selected layers.
|
|
5635
|
-
* Includes options to disable the map controls and legend.
|
|
5636
|
-
*
|
|
5637
|
-
* Expects the following props:
|
|
5638
|
-
* @param {string} mapId mapId: string - Id of the map
|
|
5639
|
-
* @param {object} [controls.zoomControls] **optional** controls: object - toggle the map controls, zoomControls defaults to true
|
|
5640
|
-
* @param {boolean} [displayTimeInMap] **optional** displayTimeInMap: boolean, toggles the mapTime, defaults to true
|
|
5641
|
-
* @param {boolean} [showScaleBar] **optional** showScaleBar: boolean, toggles the scaleBar, defaults to true
|
|
5642
|
-
* @example
|
|
5643
|
-
* ```<MapViewConnect mapId={mapId} controls={{ zoomControls: false }} displayTimeInMap={false} showScaleBar={false}/>```
|
|
5644
|
-
*/
|
|
5645
|
-
var MapViewConnect = function MapViewConnect(_ref) {
|
|
5646
|
-
var _linkedFeatures$conca;
|
|
5599
|
+
var SearchControlButtonConnect = function SearchControlButtonConnect(_ref) {
|
|
5647
5600
|
var mapId = _ref.mapId,
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
var
|
|
5651
|
-
|
|
5652
|
-
var
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
return mapSelectors.getMapLayers(store, mapId);
|
|
5657
|
-
});
|
|
5658
|
-
var baseLayers = useSelector(function (store) {
|
|
5659
|
-
return mapSelectors.getMapBaseLayers(store, mapId);
|
|
5660
|
-
});
|
|
5661
|
-
var overLayers = useSelector(function (store) {
|
|
5662
|
-
return mapSelectors.getMapOverLayers(store, mapId);
|
|
5663
|
-
});
|
|
5664
|
-
var featureLayers = useSelector(function (store) {
|
|
5665
|
-
return mapSelectors.getMapFeatureLayers(store, mapId);
|
|
5666
|
-
});
|
|
5667
|
-
var linkedFeatures = useSelector(function (store) {
|
|
5668
|
-
var _store$syncronization;
|
|
5669
|
-
return genericSelectors.selectLinkedFeatures((_store$syncronization = store.syncronizationGroupStore) == null ? void 0 : _store$syncronization.linkedState, mapId);
|
|
5670
|
-
});
|
|
5671
|
-
var linkedFormFeatures = useSelector(function (store) {
|
|
5672
|
-
var _store$syncronization2;
|
|
5673
|
-
return genericSelectors.selectLinkedFormFeatures((_store$syncronization2 = store.syncronizationGroupStore) == null ? void 0 : _store$syncronization2.linkedState, mapId);
|
|
5674
|
-
});
|
|
5675
|
-
var bbox = useSelector(function (store) {
|
|
5676
|
-
return mapSelectors.getBbox(store, mapId);
|
|
5677
|
-
});
|
|
5678
|
-
var srs = useSelector(function (store) {
|
|
5679
|
-
return mapSelectors.getSrs(store, mapId);
|
|
5680
|
-
});
|
|
5681
|
-
var activeLayerId = useSelector(function (store) {
|
|
5682
|
-
return mapSelectors.getActiveLayerId(store, mapId);
|
|
5683
|
-
});
|
|
5684
|
-
var animationDelay = useSelector(function (store) {
|
|
5685
|
-
return mapSelectors.getMapAnimationDelay(store, mapId);
|
|
5686
|
-
});
|
|
5687
|
-
var mapPinLocation = useSelector(function (store) {
|
|
5688
|
-
return mapSelectors.getPinLocation(store, mapId);
|
|
5689
|
-
});
|
|
5690
|
-
var linkedPanelId = useSelector(function (store) {
|
|
5691
|
-
return genericSelectors.selectLinkedPanelId(store, mapId);
|
|
5692
|
-
});
|
|
5693
|
-
var selectedFeatureCoordinates = useSelector(function (store) {
|
|
5694
|
-
return genericSelectors.getSelectedFeature(store.syncronizationGroupStore, linkedPanelId);
|
|
5695
|
-
});
|
|
5696
|
-
var disableMapPin = useSelector(function (store) {
|
|
5697
|
-
return mapSelectors.getDisableMapPin(store, mapId);
|
|
5601
|
+
_ref$source = _ref.source,
|
|
5602
|
+
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
5603
|
+
var _useCoreTranslation = useCoreTranslation(),
|
|
5604
|
+
t = _useCoreTranslation.t;
|
|
5605
|
+
var dispatch = useDispatch();
|
|
5606
|
+
var dialogType = uiTypes.DialogTypes.Search + "-" + mapId;
|
|
5607
|
+
var currentActiveMapId = useSelector(function (store) {
|
|
5608
|
+
return uiSelectors.getDialogMapId(store, dialogType);
|
|
5698
5609
|
});
|
|
5699
|
-
var
|
|
5700
|
-
return
|
|
5610
|
+
var isOpenInStore = useSelector(function (store) {
|
|
5611
|
+
return uiSelectors.getisDialogOpen(store, dialogType);
|
|
5701
5612
|
});
|
|
5702
|
-
var
|
|
5703
|
-
|
|
5613
|
+
var openSearchDialog = React__default.useCallback(function () {
|
|
5614
|
+
dispatch(uiActions.setActiveMapIdForDialog({
|
|
5615
|
+
type: dialogType,
|
|
5616
|
+
mapId: mapId,
|
|
5617
|
+
setOpen: currentActiveMapId !== mapId ? true : !isOpenInStore,
|
|
5618
|
+
source: source
|
|
5619
|
+
}));
|
|
5620
|
+
}, [currentActiveMapId, dialogType, dispatch, isOpenInStore, mapId, source]);
|
|
5621
|
+
return jsx(MapControlButton, {
|
|
5622
|
+
onClick: openSearchDialog,
|
|
5623
|
+
title: t('search-title'),
|
|
5624
|
+
"aria-label": t('search-title-aria'),
|
|
5625
|
+
isActive: isOpenInStore,
|
|
5626
|
+
children: jsx(Search, {})
|
|
5704
5627
|
});
|
|
5628
|
+
};
|
|
5629
|
+
|
|
5630
|
+
var MY_LOCATION = 'MyLocation';
|
|
5631
|
+
var locationOptions = {
|
|
5632
|
+
enableHighAccuracy: false,
|
|
5633
|
+
timeout: 5000,
|
|
5634
|
+
maximumAge: 0
|
|
5635
|
+
};
|
|
5636
|
+
var circleDrawFunction = function circleDrawFunction(args, fillColor, radius) {
|
|
5637
|
+
if (fillColor === void 0) {
|
|
5638
|
+
fillColor = '#88F';
|
|
5639
|
+
}
|
|
5640
|
+
if (radius === void 0) {
|
|
5641
|
+
radius = 12;
|
|
5642
|
+
}
|
|
5643
|
+
var ctx = args.context,
|
|
5644
|
+
coord = args.coord;
|
|
5645
|
+
ctx.strokeStyle = '#000';
|
|
5646
|
+
ctx.fillStyle = fillColor || '#88F';
|
|
5647
|
+
ctx.lineWidth = 1;
|
|
5648
|
+
ctx.beginPath();
|
|
5649
|
+
ctx.arc(coord.x, coord.y, radius || 10, 0, 2 * Math.PI);
|
|
5650
|
+
ctx.fill();
|
|
5651
|
+
ctx.stroke();
|
|
5652
|
+
ctx.fillStyle = '#000';
|
|
5653
|
+
ctx.beginPath();
|
|
5654
|
+
ctx.arc(coord.x, coord.y, 2, 0, 2 * Math.PI);
|
|
5655
|
+
ctx.fill();
|
|
5656
|
+
};
|
|
5657
|
+
var MyMapLocation = function MyMapLocation(_ref) {
|
|
5658
|
+
var _sx;
|
|
5659
|
+
var mapId = _ref.mapId,
|
|
5660
|
+
isLoading = _ref.isLoading,
|
|
5661
|
+
hasFailed = _ref.hasFailed,
|
|
5662
|
+
setIsLoading = _ref.setIsLoading,
|
|
5663
|
+
setHasFailed = _ref.setHasFailed;
|
|
5664
|
+
var _useCoreTranslation = useCoreTranslation(),
|
|
5665
|
+
t = _useCoreTranslation.t;
|
|
5705
5666
|
var dispatch = useDispatch();
|
|
5706
|
-
var
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
return;
|
|
5667
|
+
var layersBelongsToCurrentMapId = useSelector(function (store) {
|
|
5668
|
+
return layerSelectors.getLayersByMapId(store, mapId || '');
|
|
5669
|
+
});
|
|
5670
|
+
var layerLocation = layersBelongsToCurrentMapId.find(function (layer) {
|
|
5671
|
+
var _layer$geojson$featur;
|
|
5672
|
+
if (layer.geojson && layer.geojson.features[0] && layer.geojson.features[0].properties && (_layer$geojson$featur = layer.geojson.features[0].properties) != null && _layer$geojson$featur.name) {
|
|
5673
|
+
if (layer.geojson.features[0].properties.name === MY_LOCATION) {
|
|
5674
|
+
return layer;
|
|
5715
5675
|
}
|
|
5716
5676
|
}
|
|
5717
|
-
|
|
5718
|
-
}, [dispatch, mapId]);
|
|
5719
|
-
var setTime = React.useCallback(function (setTimePayload) {
|
|
5720
|
-
var _wmjsMap$getDimension;
|
|
5721
|
-
var wmjsMap = webmapUtils.getWMJSMapById(mapId);
|
|
5722
|
-
/* Check if the map not already has this value set, otherwise this component will re-render */
|
|
5723
|
-
if (wmjsMap && wmjsMap.getDimension('time') && ((_wmjsMap$getDimension = wmjsMap.getDimension('time')) == null ? void 0 : _wmjsMap$getDimension.currentValue) === setTimePayload.value) {
|
|
5724
|
-
return;
|
|
5725
|
-
}
|
|
5726
|
-
dispatch(genericActions.setTime(setTimePayload));
|
|
5727
|
-
}, [dispatch, mapId]);
|
|
5728
|
-
var updateLayerInformation = React.useCallback(function (payload) {
|
|
5729
|
-
dispatch(layerActions.onUpdateLayerInformation(payload));
|
|
5730
|
-
}, [dispatch]);
|
|
5731
|
-
var registerMap = React.useCallback(function (payload) {
|
|
5732
|
-
dispatch(mapActions.registerMap(payload));
|
|
5733
|
-
}, [dispatch]);
|
|
5734
|
-
var unregisterMap = React.useCallback(function (payload) {
|
|
5735
|
-
dispatch(mapActions.unregisterMap(payload));
|
|
5736
|
-
}, [dispatch]);
|
|
5737
|
-
var genericSetBbox = React.useCallback(function (payload) {
|
|
5738
|
-
dispatch(genericActions.setBbox(payload));
|
|
5739
|
-
}, [dispatch]);
|
|
5740
|
-
var syncGroupAddSource = React.useCallback(function (payload) {
|
|
5741
|
-
dispatch(genericActions.syncGroupAddSource(payload));
|
|
5742
|
-
}, [dispatch]);
|
|
5743
|
-
var syncGroupRemoveSource = React.useCallback(function (payload) {
|
|
5744
|
-
dispatch(genericActions.syncGroupRemoveSource(payload));
|
|
5745
|
-
}, [dispatch]);
|
|
5746
|
-
var layerError = React.useCallback(function (payload) {
|
|
5747
|
-
dispatch(layerActions.layerError(payload));
|
|
5748
|
-
}, [dispatch]);
|
|
5749
|
-
var mapPinChangeLocation = React.useCallback(function (payload) {
|
|
5750
|
-
dispatch(mapActions.setMapPinLocation(payload));
|
|
5751
|
-
}, [dispatch]);
|
|
5752
|
-
var setSelectedFeature = React.useCallback(function (payload) {
|
|
5753
|
-
dispatch(layerActions.setSelectedFeature(payload));
|
|
5754
|
-
}, [dispatch]);
|
|
5755
|
-
var handleFeatureSelect = function handleFeatureSelect(mapId, featureId) {
|
|
5756
|
-
dispatch(genericActions.addSharedData({
|
|
5757
|
-
panelId: mapId,
|
|
5758
|
-
data: {
|
|
5759
|
-
selectedFeatureId: featureId || ''
|
|
5760
|
-
}
|
|
5761
|
-
}));
|
|
5762
|
-
};
|
|
5763
|
-
var updateFeature = React.useCallback(function (_ref2) {
|
|
5764
|
-
var geojson = _ref2.geojson,
|
|
5765
|
-
reason = _ref2.reason,
|
|
5766
|
-
layerId = _ref2.layerId;
|
|
5767
|
-
var activeDrawToolId = drawtoolSelectors.getActiveDrawToolId(store.getState());
|
|
5768
|
-
var activeDrawMode = drawtoolSelectors.getActiveDrawMode(store.getState(), activeDrawToolId);
|
|
5769
|
-
dispatch(layerActions.updateFeature({
|
|
5770
|
-
geojson: geojson,
|
|
5771
|
-
reason: reason,
|
|
5772
|
-
layerId: layerId,
|
|
5773
|
-
shouldAllowMultipleShapes: drawtoolSelectors.getShouldAllowMultipleShapes(store.getState(), activeDrawToolId),
|
|
5774
|
-
geoJSONIntersectionLayerId: drawtoolSelectors.getGeoJSONIntersectionLayerId(store.getState(), activeDrawToolId),
|
|
5775
|
-
geoJSONIntersectionBoundsLayerId: drawtoolSelectors.getGeoJSONIntersectionBoundsLayerId(store.getState(), activeDrawToolId),
|
|
5776
|
-
selectionType: activeDrawMode == null ? void 0 : activeDrawMode.selectionType
|
|
5777
|
-
}));
|
|
5778
|
-
}, [dispatch, store]);
|
|
5779
|
-
var exitFeatureDrawMode = React.useCallback(function (_ref3) {
|
|
5780
|
-
var reason = _ref3.reason,
|
|
5781
|
-
layerId = _ref3.layerId;
|
|
5782
|
-
var activeDrawToolId = drawtoolSelectors.getActiveDrawToolId(store.getState());
|
|
5783
|
-
dispatch(layerActions.exitFeatureDrawMode({
|
|
5784
|
-
reason: reason,
|
|
5785
|
-
layerId: layerId,
|
|
5786
|
-
shouldAllowMultipleShapes: drawtoolSelectors.getShouldAllowMultipleShapes(store.getState(), activeDrawToolId)
|
|
5787
|
-
}));
|
|
5788
|
-
}, [dispatch, store]);
|
|
5789
|
-
var isActiveWindowId = useSelector(function (store) {
|
|
5790
|
-
return uiSelectors.getIsActiveWindowId(store, mapId);
|
|
5677
|
+
return undefined;
|
|
5791
5678
|
});
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
var
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
});
|
|
5801
|
-
}, [syncGroupRemoveSource, unregisterMap]);
|
|
5802
|
-
React.useEffect(function () {
|
|
5803
|
-
registerMap({
|
|
5804
|
-
mapId: mapId
|
|
5805
|
-
});
|
|
5806
|
-
syncGroupAddSource({
|
|
5807
|
-
id: mapId,
|
|
5808
|
-
type: [syncConstants.SYNCGROUPS_TYPE_SETTIME, syncConstants.SYNCGROUPS_TYPE_SETBBOX]
|
|
5809
|
-
});
|
|
5810
|
-
dispatch(loadingIndicatorActions.setGetMapIsLoading({
|
|
5811
|
-
id: mapId,
|
|
5812
|
-
isGetMapLoading: false
|
|
5813
|
-
}));
|
|
5814
|
-
}, [dispatch, mapId, registerMap, syncGroupAddSource]);
|
|
5815
|
-
var onGetMapLoadStart = React.useCallback(function () {
|
|
5816
|
-
dispatch(loadingIndicatorActions.setGetMapIsLoading({
|
|
5817
|
-
id: mapId,
|
|
5818
|
-
isGetMapLoading: true
|
|
5819
|
-
}));
|
|
5820
|
-
}, [dispatch, mapId]);
|
|
5821
|
-
var onGetMapLoadReady = React.useCallback(function () {
|
|
5822
|
-
dispatch(loadingIndicatorActions.setGetMapIsLoading({
|
|
5823
|
-
id: mapId,
|
|
5824
|
-
isGetMapLoading: false
|
|
5825
|
-
}));
|
|
5826
|
-
}, [dispatch, mapId]);
|
|
5827
|
-
var onGetCapabilitiesLoadStart = React.useCallback(function () {
|
|
5828
|
-
dispatch(loadingIndicatorActions.setGetCapabilitiesIsLoading({
|
|
5829
|
-
id: mapId,
|
|
5830
|
-
isGetCapabilitiesLoading: true
|
|
5831
|
-
}));
|
|
5832
|
-
}, [dispatch, mapId]);
|
|
5833
|
-
var onGetCapabilitiesLoadReady = React.useCallback(function () {
|
|
5834
|
-
dispatch(loadingIndicatorActions.setGetCapabilitiesIsLoading({
|
|
5835
|
-
id: mapId,
|
|
5836
|
-
isGetCapabilitiesLoading: false
|
|
5837
|
-
}));
|
|
5838
|
-
}, [dispatch, mapId]);
|
|
5839
|
-
var isTimeScrollingEnabled = useSelector(syncGroupsSelectors.isTimeScrollingEnabled);
|
|
5840
|
-
var _useSelector = useSelector(function (state) {
|
|
5841
|
-
return genericSelectors.selectSharedData(state, linkedPanelId);
|
|
5842
|
-
}),
|
|
5843
|
-
hoverId = _useSelector.hoverId;
|
|
5844
|
-
var debouncedSetHoverFeature = React.useMemo(function () {
|
|
5845
|
-
return debounce(function (featureId) {
|
|
5846
|
-
return dispatch(genericActions.addSharedData({
|
|
5847
|
-
panelId: linkedPanelId,
|
|
5848
|
-
data: {
|
|
5849
|
-
hoverId: featureId
|
|
5850
|
-
}
|
|
5679
|
+
var layerLocationId = (layerLocation == null ? void 0 : layerLocation.id) || '';
|
|
5680
|
+
var circleDrawFunctionId = useRef(registerDrawFunction(circleDrawFunction));
|
|
5681
|
+
var handleLocationClick = function handleLocationClick() {
|
|
5682
|
+
setIsLoading(true);
|
|
5683
|
+
if (mapId && layerLocationId !== '') {
|
|
5684
|
+
dispatch(layerActions.layerDelete({
|
|
5685
|
+
mapId: mapId,
|
|
5686
|
+
layerId: layerLocationId
|
|
5851
5687
|
}));
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
} else {
|
|
5885
|
-
mapChangeDimension(mapDimensionPayload);
|
|
5886
|
-
}
|
|
5887
|
-
},
|
|
5888
|
-
onUpdateLayerInformation: updateLayerInformation,
|
|
5889
|
-
onMapPinChangeLocation: mapPinChangeLocation,
|
|
5890
|
-
onMapZoomEnd: function onMapZoomEnd(a) {
|
|
5891
|
-
genericSetBbox({
|
|
5892
|
-
bbox: a.bbox,
|
|
5893
|
-
srs: a.srs,
|
|
5894
|
-
sourceId: mapId,
|
|
5895
|
-
origin: mapEnums.MapActionOrigin.map,
|
|
5896
|
-
mapId: mapId
|
|
5897
|
-
});
|
|
5898
|
-
},
|
|
5899
|
-
onWMJSMount: function onWMJSMount(mapId) {
|
|
5688
|
+
setIsLoading(false);
|
|
5689
|
+
} else if (navigator.geolocation && mapId && layerLocationId === '' && circleDrawFunctionId) {
|
|
5690
|
+
navigator.geolocation.getCurrentPosition(function (success) {
|
|
5691
|
+
setIsLoading(false);
|
|
5692
|
+
setHasFailed(false);
|
|
5693
|
+
var _success$coords = success.coords,
|
|
5694
|
+
latitude = _success$coords.latitude,
|
|
5695
|
+
longitude = _success$coords.longitude;
|
|
5696
|
+
var geojson = {
|
|
5697
|
+
type: 'FeatureCollection',
|
|
5698
|
+
features: [{
|
|
5699
|
+
type: 'Feature',
|
|
5700
|
+
properties: {
|
|
5701
|
+
name: MY_LOCATION,
|
|
5702
|
+
drawFunctionId: circleDrawFunctionId.current
|
|
5703
|
+
},
|
|
5704
|
+
geometry: {
|
|
5705
|
+
type: 'Point',
|
|
5706
|
+
coordinates: [longitude, latitude]
|
|
5707
|
+
}
|
|
5708
|
+
}]
|
|
5709
|
+
};
|
|
5710
|
+
var layerId = webmapUtils.generateLayerId();
|
|
5711
|
+
dispatch(layerActions.addLayer({
|
|
5712
|
+
mapId: mapId,
|
|
5713
|
+
layer: {
|
|
5714
|
+
geojson: geojson,
|
|
5715
|
+
layerType: LayerType.featureLayer
|
|
5716
|
+
},
|
|
5717
|
+
layerId: layerId,
|
|
5718
|
+
origin: MY_LOCATION
|
|
5719
|
+
}));
|
|
5900
5720
|
var wmjsMap = webmapUtils.getWMJSMapById(mapId);
|
|
5901
5721
|
if (!wmjsMap) {
|
|
5902
5722
|
return;
|
|
5903
5723
|
}
|
|
5904
|
-
wmjsMap.
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5724
|
+
wmjsMap.calculateBoundingBoxAndZoom(latitude, longitude);
|
|
5725
|
+
}, function (error) {
|
|
5726
|
+
setIsLoading(false);
|
|
5727
|
+
setHasFailed(true);
|
|
5728
|
+
console.warn(t('search-error', {
|
|
5729
|
+
error: error.message
|
|
5730
|
+
}));
|
|
5731
|
+
}, locationOptions);
|
|
5732
|
+
}
|
|
5733
|
+
};
|
|
5734
|
+
var chooseIcon = function chooseIcon() {
|
|
5735
|
+
return hasFailed ? jsx(Exclamation, {
|
|
5736
|
+
style: {
|
|
5737
|
+
color: 'red'
|
|
5913
5738
|
},
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
layerId: layer.id,
|
|
5930
|
-
error: Error("" + error)
|
|
5931
|
-
});
|
|
5932
|
-
}
|
|
5933
|
-
}, layer), layer.id);
|
|
5934
|
-
}), (_linkedFeatures$conca = linkedFeatures.concat(linkedFormFeatures)) == null ? void 0 : _linkedFeatures$conca.map(function (feature) {
|
|
5935
|
-
return jsx(MapViewLayer, {
|
|
5936
|
-
id: feature.id,
|
|
5937
|
-
geojson: feature == null ? void 0 : feature.geoJSON,
|
|
5938
|
-
onHoverFeature: function onHoverFeature(hoverInfo) {
|
|
5939
|
-
if (hoverInfo === undefined && hoverId !== undefined) {
|
|
5940
|
-
debouncedSetHoverFeature();
|
|
5941
|
-
} else if (hoverInfo != null && hoverInfo.feature && feature.originalId !== hoverId) {
|
|
5942
|
-
debouncedSetHoverFeature(feature.originalId);
|
|
5943
|
-
}
|
|
5739
|
+
"aria-label": "location error"
|
|
5740
|
+
}) : jsx(MyLocation, {
|
|
5741
|
+
"aria-label": "location default"
|
|
5742
|
+
});
|
|
5743
|
+
};
|
|
5744
|
+
return jsx("div", {
|
|
5745
|
+
children: isLoading ? jsxs(Fragment, {
|
|
5746
|
+
children: [jsx(CircularProgress, {
|
|
5747
|
+
value: 100,
|
|
5748
|
+
variant: "determinate",
|
|
5749
|
+
sx: {
|
|
5750
|
+
height: '100%',
|
|
5751
|
+
width: '100%',
|
|
5752
|
+
color: function color(theme) {
|
|
5753
|
+
return theme.palette.mode === 'light' ? '#1a90ff' : '#bad4ff';
|
|
5944
5754
|
},
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
var clickedFeatureIndex = features.findIndex(function (feature) {
|
|
5958
|
-
var _feature$properties;
|
|
5959
|
-
return ((_feature$properties = feature.properties) == null ? void 0 : _feature$properties.name) === clickedFeatureName;
|
|
5960
|
-
});
|
|
5961
|
-
if (disableMapPin === false) {
|
|
5962
|
-
var _selectedFeature$id;
|
|
5963
|
-
var selectedFeature = features[clickedFeatureIndex];
|
|
5964
|
-
handleFeatureSelect(linkedPanelId, (_selectedFeature$id = selectedFeature.id) == null ? void 0 : _selectedFeature$id.toString());
|
|
5965
|
-
}
|
|
5966
|
-
}
|
|
5967
|
-
}, feature.id);
|
|
5968
|
-
}), featureLayers.map(function (layer) {
|
|
5969
|
-
return jsx(MapViewLayer, Object.assign({
|
|
5970
|
-
id: "featurelayer-" + layer.id,
|
|
5971
|
-
onLayerError: function onLayerError(_, error) {
|
|
5972
|
-
layerError({
|
|
5973
|
-
layerId: layer.id,
|
|
5974
|
-
error: Error("" + error)
|
|
5975
|
-
});
|
|
5755
|
+
padding: '8px'
|
|
5756
|
+
},
|
|
5757
|
+
thickness: 6,
|
|
5758
|
+
"aria-label": "location loading"
|
|
5759
|
+
}), jsx(CircularProgress, {
|
|
5760
|
+
variant: "indeterminate",
|
|
5761
|
+
disableShrink: true,
|
|
5762
|
+
sx: (_sx = {
|
|
5763
|
+
height: '100%',
|
|
5764
|
+
width: '100%',
|
|
5765
|
+
color: function color(theme) {
|
|
5766
|
+
return theme.palette.mode === 'light' ? '#bad4ff' : '#45556F';
|
|
5976
5767
|
},
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
5768
|
+
animationDuration: '1000ms',
|
|
5769
|
+
position: 'absolute',
|
|
5770
|
+
left: 0
|
|
5771
|
+
}, _sx["& ." + circularProgressClasses.circle] = {
|
|
5772
|
+
strokeLinecap: 'round'
|
|
5773
|
+
}, _sx.padding = '8px', _sx),
|
|
5774
|
+
thickness: 6
|
|
5775
|
+
})]
|
|
5776
|
+
}) : jsx(CustomIconButton, {
|
|
5777
|
+
title: t('search-find-location'),
|
|
5778
|
+
"aria-label": MY_LOCATION,
|
|
5779
|
+
onClick: handleLocationClick,
|
|
5780
|
+
isSelected: layerLocationId !== '',
|
|
5781
|
+
size: "large",
|
|
5782
|
+
children: chooseIcon()
|
|
5783
|
+
})
|
|
5784
|
+
});
|
|
5785
|
+
};
|
|
5786
|
+
|
|
5787
|
+
var SearchDialog = function SearchDialog(_ref) {
|
|
5788
|
+
var isOpen = _ref.isOpen,
|
|
5789
|
+
onClose = _ref.onClose,
|
|
5790
|
+
_ref$mapId = _ref.mapId,
|
|
5791
|
+
mapId = _ref$mapId === void 0 ? '' : _ref$mapId;
|
|
5792
|
+
var _useCoreTranslation = useCoreTranslation(),
|
|
5793
|
+
t = _useCoreTranslation.t;
|
|
5794
|
+
var _useState = useState(false),
|
|
5795
|
+
isLoading = _useState[0],
|
|
5796
|
+
setIsLoading = _useState[1];
|
|
5797
|
+
var _useState2 = useState(false),
|
|
5798
|
+
hasFailed = _useState2[0],
|
|
5799
|
+
setHasFailed = _useState2[1];
|
|
5800
|
+
return isOpen && mapId ? jsxs(Box$1, {
|
|
5801
|
+
sx: {
|
|
5802
|
+
display: 'flex',
|
|
5803
|
+
flexDirection: 'row',
|
|
5804
|
+
alignItems: 'center',
|
|
5805
|
+
position: 'absolute',
|
|
5806
|
+
pointerEvents: 'all',
|
|
5807
|
+
zIndex: 999,
|
|
5808
|
+
left: 50,
|
|
5809
|
+
top: 15,
|
|
5810
|
+
borderBottom: '1px solid grey',
|
|
5811
|
+
backgroundColor: function backgroundColor(theme) {
|
|
5812
|
+
return theme.palette.background.paper;
|
|
5813
|
+
}
|
|
5814
|
+
},
|
|
5815
|
+
children: [jsx(MyMapLocation, {
|
|
5816
|
+
mapId: mapId,
|
|
5817
|
+
isLoading: isLoading,
|
|
5818
|
+
hasFailed: hasFailed,
|
|
5819
|
+
setIsLoading: setIsLoading,
|
|
5820
|
+
setHasFailed: setHasFailed
|
|
5821
|
+
}), jsx(TextField, {
|
|
5822
|
+
id: "dummy-search-field",
|
|
5823
|
+
label: t('search-title'),
|
|
5824
|
+
variant: "filled",
|
|
5825
|
+
slotProps: {
|
|
5826
|
+
input: {
|
|
5827
|
+
disableUnderline: true,
|
|
5828
|
+
endAdornment: jsx(InputAdornment, {
|
|
5829
|
+
position: "end",
|
|
5830
|
+
children: jsx(CustomIconButton, {
|
|
5831
|
+
tooltipTitle: t('actions-close'),
|
|
5832
|
+
edge: "end",
|
|
5833
|
+
onClick: onClose,
|
|
5834
|
+
size: "large",
|
|
5835
|
+
children: jsx(Close, {})
|
|
5836
|
+
})
|
|
5837
|
+
})
|
|
5838
|
+
}
|
|
5839
|
+
}
|
|
5840
|
+
})]
|
|
5841
|
+
}) : null;
|
|
5842
|
+
};
|
|
5843
|
+
|
|
5844
|
+
var SearchControlConnect = function SearchControlConnect(_ref) {
|
|
5845
|
+
var mapId = _ref.mapId;
|
|
5846
|
+
var dialogType = uiTypes.DialogTypes.Search + "-" + mapId;
|
|
5847
|
+
var _useSetupDialog = useSetupDialog(dialogType),
|
|
5848
|
+
isDialogOpen = _useSetupDialog.isDialogOpen,
|
|
5849
|
+
onCloseDialog = _useSetupDialog.onCloseDialog;
|
|
5850
|
+
return jsx(SearchDialog, {
|
|
5851
|
+
isOpen: isDialogOpen,
|
|
5852
|
+
onClose: onCloseDialog,
|
|
5853
|
+
mapId: mapId
|
|
5854
|
+
});
|
|
5855
|
+
};
|
|
5856
|
+
|
|
5857
|
+
var ZoomControlConnect = function ZoomControlConnect(_ref) {
|
|
5858
|
+
var mapId = _ref.mapId;
|
|
5859
|
+
var isVisible = useSelector(function (store) {
|
|
5860
|
+
return mapSelectors.isZoomControlsVisible(store, mapId);
|
|
5861
|
+
});
|
|
5862
|
+
var adagucRef = React.useRef(null);
|
|
5863
|
+
React.useEffect(function () {
|
|
5864
|
+
var webmapjs = webmapUtils.getWMJSMapById(mapId);
|
|
5865
|
+
if (!webmapjs) {
|
|
5866
|
+
return;
|
|
5867
|
+
}
|
|
5868
|
+
adagucRef.current = webmapjs;
|
|
5869
|
+
}, [mapId]);
|
|
5870
|
+
var onZoomIn = function onZoomIn() {
|
|
5871
|
+
return adagucRef.current.zoomIn(undefined);
|
|
5872
|
+
};
|
|
5873
|
+
var onZoomOut = function onZoomOut() {
|
|
5874
|
+
return adagucRef.current.zoomOut();
|
|
5875
|
+
};
|
|
5876
|
+
var onZoomReset = function onZoomReset() {
|
|
5877
|
+
return adagucRef.current.zoomToLayer(adagucRef.current.getActiveLayer());
|
|
5878
|
+
};
|
|
5879
|
+
if (!isVisible) {
|
|
5880
|
+
return null;
|
|
5881
|
+
}
|
|
5882
|
+
return jsx(ZoomControls, {
|
|
5883
|
+
onZoomIn: onZoomIn,
|
|
5884
|
+
onZoomOut: onZoomOut,
|
|
5885
|
+
onZoomReset: onZoomReset
|
|
6019
5886
|
});
|
|
6020
5887
|
};
|
|
6021
5888
|
|
|
6022
|
-
var _excluded$
|
|
5889
|
+
var _excluded$2 = ["showMapId"];
|
|
6023
5890
|
var LegendConnectComponent = function LegendConnectComponent(_ref) {
|
|
6024
5891
|
var _ref$showMapId = _ref.showMapId,
|
|
6025
5892
|
showMapId = _ref$showMapId === void 0 ? false : _ref$showMapId,
|
|
@@ -6073,7 +5940,7 @@ var LegendConnectComponent = function LegendConnectComponent(_ref) {
|
|
|
6073
5940
|
var LegendConnect = function LegendConnect(_ref2) {
|
|
6074
5941
|
var _ref2$showMapId = _ref2.showMapId,
|
|
6075
5942
|
showMapId = _ref2$showMapId === void 0 ? false : _ref2$showMapId,
|
|
6076
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
5943
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
|
|
6077
5944
|
return jsx(LegendConnectComponent, Object.assign({
|
|
6078
5945
|
showMapId: showMapId
|
|
6079
5946
|
}, props));
|
|
@@ -6262,7 +6129,7 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
6262
6129
|
case 9:
|
|
6263
6130
|
_context.prev = 9;
|
|
6264
6131
|
_context.t0 = _context["catch"](0);
|
|
6265
|
-
errorMessage = _context.t0.message;
|
|
6132
|
+
errorMessage = _context.t0 instanceof Error ? _context.t0.message : 'fetchLayerInfo failed';
|
|
6266
6133
|
updateLayerResult({
|
|
6267
6134
|
layerId: layerId,
|
|
6268
6135
|
data: errorMessage,
|
|
@@ -6469,261 +6336,434 @@ var GetFeatureInfoButtonConnect = function GetFeatureInfoButtonConnect(_ref) {
|
|
|
6469
6336
|
});
|
|
6470
6337
|
};
|
|
6471
6338
|
|
|
6472
|
-
var
|
|
6339
|
+
var _excluded$1 = ["mapId", "children", "controls"];
|
|
6340
|
+
var ORIGIN_REACTMAPVIEWCONNECT_ONMAPCHANGEDIMENSION = 'ORIGIN_REACTMAPVIEWCONNECT_ONMAPCHANGEDIMENSION';
|
|
6341
|
+
/**
|
|
6342
|
+
* Connected component used to display the map and selected layers.
|
|
6343
|
+
* Includes options to disable the map controls and legend.
|
|
6344
|
+
*
|
|
6345
|
+
* Expects the following props:
|
|
6346
|
+
* @param {string} mapId mapId: string - Id of the map
|
|
6347
|
+
* @param {object} [controls.zoomControls] **optional** controls: object - toggle the map controls, zoomControls defaults to true
|
|
6348
|
+
* @param {boolean} [displayTimeInMap] **optional** displayTimeInMap: boolean, toggles the mapTime, defaults to true
|
|
6349
|
+
* @param {boolean} [showScaleBar] **optional** showScaleBar: boolean, toggles the scaleBar, defaults to true
|
|
6350
|
+
* @example
|
|
6351
|
+
* ```<MapViewConnect mapId={mapId} controls={{ zoomControls: false }} displayTimeInMap={false} showScaleBar={false}/>```
|
|
6352
|
+
*/
|
|
6353
|
+
var MapViewConnect = function MapViewConnect(_ref) {
|
|
6354
|
+
var _linkedFeatures$conca;
|
|
6473
6355
|
var mapId = _ref.mapId,
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
var
|
|
6484
|
-
return
|
|
6356
|
+
children = _ref.children,
|
|
6357
|
+
_ref$controls = _ref.controls,
|
|
6358
|
+
controls = _ref$controls === void 0 ? {
|
|
6359
|
+
mapControlsPositionTop: 0,
|
|
6360
|
+
zoomControls: true
|
|
6361
|
+
} : _ref$controls,
|
|
6362
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
6363
|
+
var mapRef = React.useRef(null);
|
|
6364
|
+
var store = useStore();
|
|
6365
|
+
var mapDimensions = useSelector(function (store) {
|
|
6366
|
+
return mapSelectors.getMapDimensions(store, mapId);
|
|
6485
6367
|
});
|
|
6486
|
-
var
|
|
6487
|
-
|
|
6488
|
-
type: dialogType,
|
|
6489
|
-
mapId: mapId,
|
|
6490
|
-
setOpen: currentActiveMapId !== mapId ? true : !isOpenInStore,
|
|
6491
|
-
source: source
|
|
6492
|
-
}));
|
|
6493
|
-
}, [currentActiveMapId, dialogType, dispatch, isOpenInStore, mapId, source]);
|
|
6494
|
-
return jsx(MapControlButton, {
|
|
6495
|
-
onClick: openSearchDialog,
|
|
6496
|
-
title: t('search-title'),
|
|
6497
|
-
"aria-label": t('search-title-aria'),
|
|
6498
|
-
isActive: isOpenInStore,
|
|
6499
|
-
children: jsx(Search, {})
|
|
6368
|
+
var layers = useSelector(function (store) {
|
|
6369
|
+
return mapSelectors.getMapLayers(store, mapId);
|
|
6500
6370
|
});
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
var MY_LOCATION = 'MyLocation';
|
|
6504
|
-
var locationOptions = {
|
|
6505
|
-
enableHighAccuracy: false,
|
|
6506
|
-
timeout: 5000,
|
|
6507
|
-
maximumAge: 0
|
|
6508
|
-
};
|
|
6509
|
-
var circleDrawFunction = function circleDrawFunction(args, fillColor, radius) {
|
|
6510
|
-
if (fillColor === void 0) {
|
|
6511
|
-
fillColor = '#88F';
|
|
6512
|
-
}
|
|
6513
|
-
if (radius === void 0) {
|
|
6514
|
-
radius = 12;
|
|
6515
|
-
}
|
|
6516
|
-
var ctx = args.context,
|
|
6517
|
-
coord = args.coord;
|
|
6518
|
-
ctx.strokeStyle = '#000';
|
|
6519
|
-
ctx.fillStyle = fillColor || '#88F';
|
|
6520
|
-
ctx.lineWidth = 1;
|
|
6521
|
-
ctx.beginPath();
|
|
6522
|
-
ctx.arc(coord.x, coord.y, radius || 10, 0, 2 * Math.PI);
|
|
6523
|
-
ctx.fill();
|
|
6524
|
-
ctx.stroke();
|
|
6525
|
-
ctx.fillStyle = '#000';
|
|
6526
|
-
ctx.beginPath();
|
|
6527
|
-
ctx.arc(coord.x, coord.y, 2, 0, 2 * Math.PI);
|
|
6528
|
-
ctx.fill();
|
|
6529
|
-
};
|
|
6530
|
-
var MyMapLocation = function MyMapLocation(_ref) {
|
|
6531
|
-
var _sx;
|
|
6532
|
-
var mapId = _ref.mapId,
|
|
6533
|
-
isLoading = _ref.isLoading,
|
|
6534
|
-
hasFailed = _ref.hasFailed,
|
|
6535
|
-
setIsLoading = _ref.setIsLoading,
|
|
6536
|
-
setHasFailed = _ref.setHasFailed;
|
|
6537
|
-
var _useCoreTranslation = useCoreTranslation(),
|
|
6538
|
-
t = _useCoreTranslation.t;
|
|
6539
|
-
var dispatch = useDispatch();
|
|
6540
|
-
var layersBelongsToCurrentMapId = useSelector(function (store) {
|
|
6541
|
-
return layerSelectors.getLayersByMapId(store, mapId || '');
|
|
6371
|
+
var baseLayers = useSelector(function (store) {
|
|
6372
|
+
return mapSelectors.getMapBaseLayers(store, mapId);
|
|
6542
6373
|
});
|
|
6543
|
-
var
|
|
6544
|
-
|
|
6545
|
-
if (layer.geojson && layer.geojson.features[0] && layer.geojson.features[0].properties && (_layer$geojson$featur = layer.geojson.features[0].properties) != null && _layer$geojson$featur.name) {
|
|
6546
|
-
if (layer.geojson.features[0].properties.name === MY_LOCATION) {
|
|
6547
|
-
return layer;
|
|
6548
|
-
}
|
|
6549
|
-
}
|
|
6550
|
-
return undefined;
|
|
6374
|
+
var overLayers = useSelector(function (store) {
|
|
6375
|
+
return mapSelectors.getMapOverLayers(store, mapId);
|
|
6551
6376
|
});
|
|
6552
|
-
var
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6377
|
+
var featureLayers = useSelector(function (store) {
|
|
6378
|
+
return mapSelectors.getMapFeatureLayers(store, mapId);
|
|
6379
|
+
});
|
|
6380
|
+
var linkedFeatures = useSelector(function (store) {
|
|
6381
|
+
var _store$syncGroups;
|
|
6382
|
+
return genericSelectors.selectLinkedFeatures((_store$syncGroups = store.syncGroups) == null ? void 0 : _store$syncGroups.linkedState, mapId);
|
|
6383
|
+
});
|
|
6384
|
+
var linkedFormFeatures = useSelector(function (store) {
|
|
6385
|
+
var _store$syncGroups2;
|
|
6386
|
+
return genericSelectors.selectLinkedFormFeatures((_store$syncGroups2 = store.syncGroups) == null ? void 0 : _store$syncGroups2.linkedState, mapId);
|
|
6387
|
+
});
|
|
6388
|
+
var bbox = useSelector(function (store) {
|
|
6389
|
+
return mapSelectors.getBbox(store, mapId);
|
|
6390
|
+
});
|
|
6391
|
+
var srs = useSelector(function (store) {
|
|
6392
|
+
return mapSelectors.getSrs(store, mapId);
|
|
6393
|
+
});
|
|
6394
|
+
var activeLayerId = useSelector(function (store) {
|
|
6395
|
+
return mapSelectors.getActiveLayerId(store, mapId);
|
|
6396
|
+
});
|
|
6397
|
+
var animationDelay = useSelector(function (store) {
|
|
6398
|
+
return mapSelectors.getMapAnimationDelay(store, mapId);
|
|
6399
|
+
});
|
|
6400
|
+
var mapPinLocation = useSelector(function (store) {
|
|
6401
|
+
return mapSelectors.getPinLocation(store, mapId);
|
|
6402
|
+
});
|
|
6403
|
+
var linkedPanelId = useSelector(function (store) {
|
|
6404
|
+
return genericSelectors.selectLinkedPanelId(store, mapId);
|
|
6405
|
+
});
|
|
6406
|
+
var selectedFeatureCoordinates = useSelector(function (store) {
|
|
6407
|
+
return genericSelectors.getSelectedFeature(store.syncGroups, linkedPanelId);
|
|
6408
|
+
});
|
|
6409
|
+
var disableMapPin = useSelector(function (store) {
|
|
6410
|
+
return mapSelectors.getDisableMapPin(store, mapId);
|
|
6411
|
+
});
|
|
6412
|
+
var displayMapPin = useSelector(function (store) {
|
|
6413
|
+
return mapSelectors.getDisplayMapPin(store, mapId);
|
|
6414
|
+
});
|
|
6415
|
+
var timestep = useSelector(function (store) {
|
|
6416
|
+
return mapSelectors.getMapTimeStep(store, mapId);
|
|
6417
|
+
});
|
|
6418
|
+
var dispatch = useDispatch();
|
|
6419
|
+
var mapChangeDimension = React.useCallback(function (mapDimensionPayload) {
|
|
6420
|
+
if (mapDimensionPayload.dimension) {
|
|
6421
|
+
var wmjsMap = webmapUtils.getWMJSMapById(mapId);
|
|
6422
|
+
if (!wmjsMap) {
|
|
6423
|
+
return;
|
|
6424
|
+
}
|
|
6425
|
+
var dimension = wmjsMap.getDimension(mapDimensionPayload.dimension.name);
|
|
6426
|
+
if (dimension && dimension.currentValue === mapDimensionPayload.dimension.currentValue) {
|
|
6427
|
+
return;
|
|
6428
|
+
}
|
|
6429
|
+
}
|
|
6430
|
+
dispatch(mapActions.mapChangeDimension(mapDimensionPayload));
|
|
6431
|
+
}, [dispatch, mapId]);
|
|
6432
|
+
var setTime = React.useCallback(function (setTimePayload) {
|
|
6433
|
+
var _wmjsMap$getDimension;
|
|
6434
|
+
var wmjsMap = webmapUtils.getWMJSMapById(mapId);
|
|
6435
|
+
/* Check if the map not already has this value set, otherwise this component will re-render */
|
|
6436
|
+
if (wmjsMap && wmjsMap.getDimension('time') && ((_wmjsMap$getDimension = wmjsMap.getDimension('time')) == null ? void 0 : _wmjsMap$getDimension.currentValue) === setTimePayload.value) {
|
|
6437
|
+
return;
|
|
6438
|
+
}
|
|
6439
|
+
dispatch(genericActions.setTime(setTimePayload));
|
|
6440
|
+
}, [dispatch, mapId]);
|
|
6441
|
+
var updateLayerInformation = React.useCallback(function (payload) {
|
|
6442
|
+
dispatch(layerActions.onUpdateLayerInformation(payload));
|
|
6443
|
+
}, [dispatch]);
|
|
6444
|
+
var registerMap = React.useCallback(function (payload) {
|
|
6445
|
+
dispatch(mapActions.registerMap(payload));
|
|
6446
|
+
}, [dispatch]);
|
|
6447
|
+
var unregisterMap = React.useCallback(function (payload) {
|
|
6448
|
+
dispatch(mapActions.unregisterMap(payload));
|
|
6449
|
+
}, [dispatch]);
|
|
6450
|
+
var genericSetBbox = React.useCallback(function (payload) {
|
|
6451
|
+
dispatch(genericActions.setBbox(payload));
|
|
6452
|
+
}, [dispatch]);
|
|
6453
|
+
var syncGroupAddSource = React.useCallback(function (payload) {
|
|
6454
|
+
dispatch(genericActions.syncGroupAddSource(payload));
|
|
6455
|
+
}, [dispatch]);
|
|
6456
|
+
var syncGroupRemoveSource = React.useCallback(function (payload) {
|
|
6457
|
+
dispatch(genericActions.syncGroupRemoveSource(payload));
|
|
6458
|
+
}, [dispatch]);
|
|
6459
|
+
var layerError = React.useCallback(function (payload) {
|
|
6460
|
+
dispatch(layerActions.layerError(payload));
|
|
6461
|
+
}, [dispatch]);
|
|
6462
|
+
var mapPinChangeLocation = React.useCallback(function (payload) {
|
|
6463
|
+
dispatch(mapActions.setMapPinLocation(payload));
|
|
6464
|
+
}, [dispatch]);
|
|
6465
|
+
var setSelectedFeature = React.useCallback(function (payload) {
|
|
6466
|
+
dispatch(layerActions.setSelectedFeature(payload));
|
|
6467
|
+
}, [dispatch]);
|
|
6468
|
+
var handleFeatureSelect = function handleFeatureSelect(mapId, featureId) {
|
|
6469
|
+
dispatch(genericActions.addSharedData({
|
|
6470
|
+
panelId: mapId,
|
|
6471
|
+
data: {
|
|
6472
|
+
selectedFeatureId: featureId || ''
|
|
6473
|
+
}
|
|
6474
|
+
}));
|
|
6475
|
+
};
|
|
6476
|
+
var updateFeature = React.useCallback(function (_ref2) {
|
|
6477
|
+
var geojson = _ref2.geojson,
|
|
6478
|
+
reason = _ref2.reason,
|
|
6479
|
+
layerId = _ref2.layerId;
|
|
6480
|
+
var activeDrawToolId = drawtoolSelectors.getActiveDrawToolId(store.getState());
|
|
6481
|
+
var activeDrawMode = drawtoolSelectors.getActiveDrawMode(store.getState(), activeDrawToolId);
|
|
6482
|
+
dispatch(layerActions.updateFeature({
|
|
6483
|
+
geojson: geojson,
|
|
6484
|
+
reason: reason,
|
|
6485
|
+
layerId: layerId,
|
|
6486
|
+
shouldAllowMultipleShapes: drawtoolSelectors.getShouldAllowMultipleShapes(store.getState(), activeDrawToolId),
|
|
6487
|
+
geoJSONIntersectionLayerId: drawtoolSelectors.getGeoJSONIntersectionLayerId(store.getState(), activeDrawToolId),
|
|
6488
|
+
geoJSONIntersectionBoundsLayerId: drawtoolSelectors.getGeoJSONIntersectionBoundsLayerId(store.getState(), activeDrawToolId),
|
|
6489
|
+
selectionType: activeDrawMode == null ? void 0 : activeDrawMode.selectionType
|
|
6490
|
+
}));
|
|
6491
|
+
}, [dispatch, store]);
|
|
6492
|
+
var exitFeatureDrawMode = React.useCallback(function (_ref3) {
|
|
6493
|
+
var reason = _ref3.reason,
|
|
6494
|
+
layerId = _ref3.layerId;
|
|
6495
|
+
var activeDrawToolId = drawtoolSelectors.getActiveDrawToolId(store.getState());
|
|
6496
|
+
dispatch(layerActions.exitFeatureDrawMode({
|
|
6497
|
+
reason: reason,
|
|
6498
|
+
layerId: layerId,
|
|
6499
|
+
shouldAllowMultipleShapes: drawtoolSelectors.getShouldAllowMultipleShapes(store.getState(), activeDrawToolId)
|
|
6500
|
+
}));
|
|
6501
|
+
}, [dispatch, store]);
|
|
6502
|
+
var isActiveWindowId = useSelector(function (store) {
|
|
6503
|
+
return uiSelectors.getIsActiveWindowId(store, mapId);
|
|
6504
|
+
});
|
|
6505
|
+
useKeyboardZoomAndPan(isActiveWindowId, mapId, mapRef.current);
|
|
6506
|
+
useTouchZoomPan(isActiveWindowId, mapId);
|
|
6507
|
+
var unRegister = React.useCallback(function (mapId) {
|
|
6508
|
+
unregisterMap({
|
|
6509
|
+
mapId: mapId
|
|
6510
|
+
});
|
|
6511
|
+
syncGroupRemoveSource({
|
|
6512
|
+
id: mapId
|
|
6513
|
+
});
|
|
6514
|
+
}, [syncGroupRemoveSource, unregisterMap]);
|
|
6515
|
+
React.useEffect(function () {
|
|
6516
|
+
registerMap({
|
|
6517
|
+
mapId: mapId
|
|
6518
|
+
});
|
|
6519
|
+
syncGroupAddSource({
|
|
6520
|
+
id: mapId,
|
|
6521
|
+
type: [syncConstants.SYNCGROUPS_TYPE_SETTIME, syncConstants.SYNCGROUPS_TYPE_SETBBOX]
|
|
6522
|
+
});
|
|
6523
|
+
dispatch(loadingIndicatorActions.setGetMapIsLoading({
|
|
6524
|
+
id: mapId,
|
|
6525
|
+
isGetMapLoading: false
|
|
6526
|
+
}));
|
|
6527
|
+
}, [dispatch, mapId, registerMap, syncGroupAddSource]);
|
|
6528
|
+
var onGetMapLoadStart = React.useCallback(function () {
|
|
6529
|
+
dispatch(loadingIndicatorActions.setGetMapIsLoading({
|
|
6530
|
+
id: mapId,
|
|
6531
|
+
isGetMapLoading: true
|
|
6532
|
+
}));
|
|
6533
|
+
}, [dispatch, mapId]);
|
|
6534
|
+
var onGetMapLoadReady = React.useCallback(function () {
|
|
6535
|
+
dispatch(loadingIndicatorActions.setGetMapIsLoading({
|
|
6536
|
+
id: mapId,
|
|
6537
|
+
isGetMapLoading: false
|
|
6538
|
+
}));
|
|
6539
|
+
}, [dispatch, mapId]);
|
|
6540
|
+
var onGetCapabilitiesLoadStart = React.useCallback(function () {
|
|
6541
|
+
dispatch(loadingIndicatorActions.setGetCapabilitiesIsLoading({
|
|
6542
|
+
id: mapId,
|
|
6543
|
+
isGetCapabilitiesLoading: true
|
|
6544
|
+
}));
|
|
6545
|
+
}, [dispatch, mapId]);
|
|
6546
|
+
var onGetCapabilitiesLoadReady = React.useCallback(function () {
|
|
6547
|
+
dispatch(loadingIndicatorActions.setGetCapabilitiesIsLoading({
|
|
6548
|
+
id: mapId,
|
|
6549
|
+
isGetCapabilitiesLoading: false
|
|
6550
|
+
}));
|
|
6551
|
+
}, [dispatch, mapId]);
|
|
6552
|
+
var isTimeScrollingEnabled = useSelector(syncGroupsSelectors.isTimeScrollingEnabled);
|
|
6553
|
+
var _useSelector = useSelector(function (state) {
|
|
6554
|
+
return genericSelectors.selectSharedData(state, linkedPanelId);
|
|
6555
|
+
}),
|
|
6556
|
+
hoverId = _useSelector.hoverId;
|
|
6557
|
+
var debouncedSetHoverFeature = React.useMemo(function () {
|
|
6558
|
+
return debounce(function (featureId) {
|
|
6559
|
+
return dispatch(genericActions.addSharedData({
|
|
6560
|
+
panelId: linkedPanelId,
|
|
6561
|
+
data: {
|
|
6562
|
+
hoverId: featureId
|
|
6563
|
+
}
|
|
6560
6564
|
}));
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6565
|
+
}, 200);
|
|
6566
|
+
}, [dispatch, linkedPanelId]);
|
|
6567
|
+
return jsxs("div", {
|
|
6568
|
+
style: {
|
|
6569
|
+
height: '100%'
|
|
6570
|
+
},
|
|
6571
|
+
ref: mapRef,
|
|
6572
|
+
children: [jsxs(MapView, Object.assign({}, props, {
|
|
6573
|
+
mapId: mapId,
|
|
6574
|
+
controls: {},
|
|
6575
|
+
linkedFeatures: {
|
|
6576
|
+
type: 'FeatureCollection',
|
|
6577
|
+
features: linkedFeatures.flatMap(function (feature) {
|
|
6578
|
+
return feature.geoJSON.features;
|
|
6579
|
+
})
|
|
6580
|
+
},
|
|
6581
|
+
isTimeScrollingEnabled: isTimeScrollingEnabled,
|
|
6582
|
+
srs: srs,
|
|
6583
|
+
bbox: bbox,
|
|
6584
|
+
mapPinLocation: displayMapPin ? selectedFeatureCoordinates || mapPinLocation : undefined,
|
|
6585
|
+
dimensions: mapDimensions,
|
|
6586
|
+
activeLayerId: activeLayerId,
|
|
6587
|
+
animationDelay: animationDelay,
|
|
6588
|
+
timestep: timestep,
|
|
6589
|
+
displayMapPin: displayMapPin,
|
|
6590
|
+
disableMapPin: disableMapPin,
|
|
6591
|
+
onMapChangeDimension: function onMapChangeDimension(mapDimensionPayload) {
|
|
6592
|
+
if (mapDimensionPayload && mapDimensionPayload.dimension && mapDimensionPayload.dimension.name && mapDimensionPayload.dimension.name === 'time') {
|
|
6593
|
+
setTime({
|
|
6594
|
+
sourceId: mapId,
|
|
6595
|
+
origin: mapDimensionPayload.origin + "==> " + ORIGIN_REACTMAPVIEWCONNECT_ONMAPCHANGEDIMENSION,
|
|
6596
|
+
value: handleDateUtilsISOString(mapDimensionPayload.dimension.currentValue)
|
|
6597
|
+
});
|
|
6598
|
+
} else {
|
|
6599
|
+
mapChangeDimension(mapDimensionPayload);
|
|
6600
|
+
}
|
|
6601
|
+
},
|
|
6602
|
+
onUpdateLayerInformation: updateLayerInformation,
|
|
6603
|
+
onMapPinChangeLocation: mapPinChangeLocation,
|
|
6604
|
+
onMapZoomEnd: function onMapZoomEnd(a) {
|
|
6605
|
+
genericSetBbox({
|
|
6606
|
+
bbox: a.bbox,
|
|
6607
|
+
srs: a.srs,
|
|
6608
|
+
sourceId: mapId,
|
|
6609
|
+
origin: mapEnums.MapActionOrigin.map,
|
|
6610
|
+
mapId: mapId
|
|
6611
|
+
});
|
|
6612
|
+
},
|
|
6613
|
+
onWMJSMount: function onWMJSMount(mapId) {
|
|
6614
|
+
var wmjsMap = webmapUtils.getWMJSMapById(mapId);
|
|
6615
|
+
if (!wmjsMap) {
|
|
6616
|
+
return;
|
|
6617
|
+
}
|
|
6618
|
+
wmjsMap.getListener().addEventListener('onloadstart', onGetMapLoadStart);
|
|
6619
|
+
wmjsMap.getListener().addEventListener('onloadready', onGetMapLoadReady);
|
|
6620
|
+
wmServiceListener.addEventListener(EVENT_GETCAPABILITIES_START, onGetCapabilitiesLoadStart, true);
|
|
6621
|
+
wmServiceListener.addEventListener(EVENT_GETCAPABILITIES_READY, onGetCapabilitiesLoadReady, true);
|
|
6622
|
+
},
|
|
6623
|
+
onWMJSUnMount: function onWMJSUnMount(mapId) {
|
|
6624
|
+
unRegister(mapId);
|
|
6625
|
+
wmServiceListener.removeEventListener(EVENT_GETCAPABILITIES_START, onGetCapabilitiesLoadStart);
|
|
6626
|
+
wmServiceListener.removeEventListener(EVENT_GETCAPABILITIES_READY, onGetCapabilitiesLoadReady);
|
|
6627
|
+
},
|
|
6628
|
+
children: [baseLayers.map(function (layer) {
|
|
6629
|
+
return jsx(MapViewLayer, Object.assign({
|
|
6630
|
+
id: "baselayer-" + layer.id,
|
|
6631
|
+
onLayerError: function onLayerError(_, error) {
|
|
6632
|
+
layerError({
|
|
6633
|
+
layerId: layer.id,
|
|
6634
|
+
error: Error("" + error)
|
|
6635
|
+
});
|
|
6636
|
+
}
|
|
6637
|
+
}, layer), layer.id);
|
|
6638
|
+
}), layers.map(function (layer) {
|
|
6639
|
+
return jsx(MapViewLayer, Object.assign({
|
|
6640
|
+
id: "layer-" + layer.id,
|
|
6641
|
+
onLayerError: function onLayerError(_, error) {
|
|
6642
|
+
layerError({
|
|
6643
|
+
layerId: layer.id,
|
|
6644
|
+
error: Error("" + error)
|
|
6645
|
+
});
|
|
6646
|
+
}
|
|
6647
|
+
}, layer), layer.id);
|
|
6648
|
+
}), (_linkedFeatures$conca = linkedFeatures.concat(linkedFormFeatures)) == null ? void 0 : _linkedFeatures$conca.map(function (feature) {
|
|
6649
|
+
return jsx(MapViewLayer, {
|
|
6650
|
+
id: feature.id,
|
|
6651
|
+
geojson: feature == null ? void 0 : feature.geoJSON,
|
|
6652
|
+
onHoverFeature: function onHoverFeature(hoverInfo) {
|
|
6653
|
+
if (hoverInfo === undefined && hoverId !== undefined) {
|
|
6654
|
+
debouncedSetHoverFeature();
|
|
6655
|
+
} else if (hoverInfo != null && hoverInfo.feature && feature.originalId !== hoverId) {
|
|
6656
|
+
debouncedSetHoverFeature(feature.originalId);
|
|
6580
6657
|
}
|
|
6581
|
-
}]
|
|
6582
|
-
};
|
|
6583
|
-
var layerId = webmapUtils.generateLayerId();
|
|
6584
|
-
dispatch(layerActions.addLayer({
|
|
6585
|
-
mapId: mapId,
|
|
6586
|
-
layer: {
|
|
6587
|
-
geojson: geojson,
|
|
6588
|
-
layerType: LayerType.featureLayer
|
|
6589
6658
|
},
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
variant: "determinate",
|
|
6622
|
-
sx: {
|
|
6623
|
-
height: '100%',
|
|
6624
|
-
width: '100%',
|
|
6625
|
-
color: function color(theme) {
|
|
6626
|
-
return theme.palette.mode === 'light' ? '#1a90ff' : '#bad4ff';
|
|
6659
|
+
onClickFeature: function onClickFeature(event) {
|
|
6660
|
+
var _event$feature$proper;
|
|
6661
|
+
var isClickOutsideFeature = !event || !event.feature;
|
|
6662
|
+
if (isClickOutsideFeature) {
|
|
6663
|
+
if (mapPinLocation) {
|
|
6664
|
+
handleFeatureSelect(linkedPanelId, undefined);
|
|
6665
|
+
}
|
|
6666
|
+
return;
|
|
6667
|
+
}
|
|
6668
|
+
// Handle clicks on station
|
|
6669
|
+
var clickedFeatureName = (_event$feature$proper = event.feature.properties) == null ? void 0 : _event$feature$proper.name;
|
|
6670
|
+
var features = linkedFeatures[0].geoJSON.features;
|
|
6671
|
+
var clickedFeatureIndex = features.findIndex(function (feature) {
|
|
6672
|
+
var _feature$properties;
|
|
6673
|
+
return ((_feature$properties = feature.properties) == null ? void 0 : _feature$properties.name) === clickedFeatureName;
|
|
6674
|
+
});
|
|
6675
|
+
if (disableMapPin === false) {
|
|
6676
|
+
var _selectedFeature$id;
|
|
6677
|
+
var selectedFeature = features[clickedFeatureIndex];
|
|
6678
|
+
handleFeatureSelect(linkedPanelId, (_selectedFeature$id = selectedFeature.id) == null ? void 0 : _selectedFeature$id.toString());
|
|
6679
|
+
}
|
|
6680
|
+
}
|
|
6681
|
+
}, feature.id);
|
|
6682
|
+
}), featureLayers.map(function (layer) {
|
|
6683
|
+
return jsx(MapViewLayer, Object.assign({
|
|
6684
|
+
id: "featurelayer-" + layer.id,
|
|
6685
|
+
onLayerError: function onLayerError(_, error) {
|
|
6686
|
+
layerError({
|
|
6687
|
+
layerId: layer.id,
|
|
6688
|
+
error: Error("" + error)
|
|
6689
|
+
});
|
|
6627
6690
|
},
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6691
|
+
onClickFeature: function onClickFeature(event) {
|
|
6692
|
+
var isClickOutsideFeature = !event;
|
|
6693
|
+
if (isClickOutsideFeature && !layer.isInEditMode) {
|
|
6694
|
+
setSelectedFeature({
|
|
6695
|
+
layerId: layer.id,
|
|
6696
|
+
selectedFeatureIndex: undefined
|
|
6697
|
+
});
|
|
6698
|
+
return;
|
|
6699
|
+
}
|
|
6700
|
+
if ((event == null ? void 0 : event.isInEditMode) === false) {
|
|
6701
|
+
setSelectedFeature({
|
|
6702
|
+
layerId: layer.id,
|
|
6703
|
+
selectedFeatureIndex: event.featureIndex
|
|
6704
|
+
});
|
|
6705
|
+
}
|
|
6640
6706
|
},
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
}
|
|
6687
|
-
},
|
|
6688
|
-
|
|
6707
|
+
updateGeojson: function updateGeojson(geojson, reason) {
|
|
6708
|
+
updateFeature({
|
|
6709
|
+
geojson: geojson,
|
|
6710
|
+
layerId: layer.id,
|
|
6711
|
+
reason: reason
|
|
6712
|
+
});
|
|
6713
|
+
},
|
|
6714
|
+
exitDrawModeCallback: function exitDrawModeCallback(reason) {
|
|
6715
|
+
return exitFeatureDrawMode({
|
|
6716
|
+
reason: reason,
|
|
6717
|
+
layerId: layer.id
|
|
6718
|
+
});
|
|
6719
|
+
}
|
|
6720
|
+
}, layer), layer.id);
|
|
6721
|
+
}), overLayers.map(function (layer) {
|
|
6722
|
+
return jsx(MapViewLayer, Object.assign({
|
|
6723
|
+
id: "baselayer-" + layer.id,
|
|
6724
|
+
onLayerError: function onLayerError(_, error) {
|
|
6725
|
+
layerError({
|
|
6726
|
+
layerId: layer.id,
|
|
6727
|
+
error: Error("" + error)
|
|
6728
|
+
});
|
|
6729
|
+
}
|
|
6730
|
+
}, layer), layer.id);
|
|
6731
|
+
}), children]
|
|
6732
|
+
})), jsxs(MapControls, {
|
|
6733
|
+
"data-testid": "mapControls",
|
|
6734
|
+
style: {
|
|
6735
|
+
top: controls == null ? void 0 : controls.mapControlsPositionTop
|
|
6736
|
+
},
|
|
6737
|
+
children: [(controls == null ? void 0 : controls.search) && jsx(SearchControlButtonConnect, {
|
|
6738
|
+
mapId: mapId
|
|
6739
|
+
}), (controls == null ? void 0 : controls.zoomControls) && jsx(ZoomControlConnect, {
|
|
6740
|
+
mapId: mapId
|
|
6741
|
+
}), (controls == null ? void 0 : controls.layerManagerAndLegend) && jsxs(Fragment, {
|
|
6742
|
+
children: [jsx(LayerManagerMapButtonConnect, {
|
|
6743
|
+
mapId: mapId
|
|
6744
|
+
}), jsx(LegendMapButtonConnect, {
|
|
6745
|
+
mapId: mapId,
|
|
6746
|
+
multiLegend: controls == null ? void 0 : controls.multiLegend
|
|
6747
|
+
})]
|
|
6748
|
+
}), (controls == null ? void 0 : controls.dimensionSelect) && jsx(MultiDimensionSelectMapButtonsConnect, {
|
|
6749
|
+
mapId: mapId
|
|
6750
|
+
}), (controls == null ? void 0 : controls.getFeatureInfo) && jsx(GetFeatureInfoButtonConnect, {
|
|
6751
|
+
mapId: mapId
|
|
6752
|
+
}), controls == null ? void 0 : controls.additionalMapControls]
|
|
6753
|
+
}), (controls == null ? void 0 : controls.multiLegend) && jsx(LegendConnect, {
|
|
6754
|
+
showMapId: true,
|
|
6689
6755
|
mapId: mapId,
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
disableUnderline: true,
|
|
6701
|
-
endAdornment: jsx(InputAdornment, {
|
|
6702
|
-
position: "end",
|
|
6703
|
-
children: jsx(CustomIconButton, {
|
|
6704
|
-
tooltipTitle: t('actions-close'),
|
|
6705
|
-
edge: "end",
|
|
6706
|
-
onClick: onClose,
|
|
6707
|
-
size: "large",
|
|
6708
|
-
children: jsx(Close, {})
|
|
6709
|
-
})
|
|
6710
|
-
})
|
|
6711
|
-
}
|
|
6712
|
-
}
|
|
6756
|
+
multiLegend: controls == null ? void 0 : controls.multiLegend
|
|
6757
|
+
}), jsx(SearchControlConnect, {
|
|
6758
|
+
mapId: mapId
|
|
6759
|
+
}), (controls == null ? void 0 : controls.getFeatureInfo) && jsx(GetFeatureInfoConnect, {
|
|
6760
|
+
showMapId: true,
|
|
6761
|
+
mapId: mapId
|
|
6762
|
+
}), jsx(LayerManagerConnect, {
|
|
6763
|
+
mapId: mapId,
|
|
6764
|
+
bounds: "parent",
|
|
6765
|
+
isDocked: true
|
|
6713
6766
|
})]
|
|
6714
|
-
}) : null;
|
|
6715
|
-
};
|
|
6716
|
-
|
|
6717
|
-
var SearchControlConnect = function SearchControlConnect(_ref) {
|
|
6718
|
-
var mapId = _ref.mapId;
|
|
6719
|
-
var dialogType = uiTypes.DialogTypes.Search + "-" + mapId;
|
|
6720
|
-
var _useSetupDialog = useSetupDialog(dialogType),
|
|
6721
|
-
isDialogOpen = _useSetupDialog.isDialogOpen,
|
|
6722
|
-
onCloseDialog = _useSetupDialog.onCloseDialog;
|
|
6723
|
-
return jsx(SearchDialog, {
|
|
6724
|
-
isOpen: isDialogOpen,
|
|
6725
|
-
onClose: onCloseDialog,
|
|
6726
|
-
mapId: mapId
|
|
6727
6767
|
});
|
|
6728
6768
|
};
|
|
6729
6769
|
|
|
@@ -7682,7 +7722,8 @@ var titleStyle = function titleStyle(theme) {
|
|
|
7682
7722
|
zIndex: 50,
|
|
7683
7723
|
color: theme.palette.common.black,
|
|
7684
7724
|
whiteSpace: 'nowrap',
|
|
7685
|
-
userSelect: 'none'
|
|
7725
|
+
userSelect: 'none',
|
|
7726
|
+
textShadow: '1px 1px 2px #ffffffE6, -1px 1px 2px #ffffffE6, -1px -1px 2px #ffffffE6, 1px -1px 2px #ffffffE6'
|
|
7686
7727
|
};
|
|
7687
7728
|
};
|
|
7688
7729
|
var defaultBbox = {
|
|
@@ -7805,7 +7846,7 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_ref) {
|
|
|
7805
7846
|
}));
|
|
7806
7847
|
}
|
|
7807
7848
|
if (shouldDisplayDrawControls) {
|
|
7808
|
-
dispatch(
|
|
7849
|
+
dispatch(layerActions.addLayer({
|
|
7809
7850
|
mapId: mapId,
|
|
7810
7851
|
layer: {
|
|
7811
7852
|
geojson: emptyGeoJSON,
|
|
@@ -7817,7 +7858,18 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_ref) {
|
|
|
7817
7858
|
}
|
|
7818
7859
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7819
7860
|
}, []);
|
|
7820
|
-
var
|
|
7861
|
+
var mapControlConfig = useMemo(function () {
|
|
7862
|
+
return {
|
|
7863
|
+
mapControlsPositionTop: title ? 24 : 8,
|
|
7864
|
+
search: displaySearchButtonInMap,
|
|
7865
|
+
zoomControls: shouldShowZoomControls,
|
|
7866
|
+
layerManagerAndLegend: displayLayerManagerAndLegendButtonInMap,
|
|
7867
|
+
multiLegend: multiLegend,
|
|
7868
|
+
dimensionSelect: displayDimensionSelectButtonInMap,
|
|
7869
|
+
getFeatureInfo: displayGetFeatureInfoButtonInMap,
|
|
7870
|
+
additionalMapControls: mapControls
|
|
7871
|
+
};
|
|
7872
|
+
}, [title, displaySearchButtonInMap, shouldShowZoomControls, displayLayerManagerAndLegendButtonInMap, multiLegend, displayDimensionSelectButtonInMap, displayGetFeatureInfoButtonInMap, mapControls]);
|
|
7821
7873
|
return React__default.useMemo(function () {
|
|
7822
7874
|
renderCounter.count(ConfigurableMapConnect.name + "_" + mapId);
|
|
7823
7875
|
return jsxs(Box, {
|
|
@@ -7833,25 +7885,6 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_ref) {
|
|
|
7833
7885
|
"data-testid": "mapTitle",
|
|
7834
7886
|
sx: titleStyle,
|
|
7835
7887
|
children: title
|
|
7836
|
-
}), jsxs(MapControls, {
|
|
7837
|
-
"data-testid": "mapControls",
|
|
7838
|
-
style: {
|
|
7839
|
-
top: mapControlsPositionTop
|
|
7840
|
-
},
|
|
7841
|
-
children: [displaySearchButtonInMap && jsx(SearchControlButtonConnect, {
|
|
7842
|
-
mapId: mapId
|
|
7843
|
-
}), jsx(ZoomControlConnect, {
|
|
7844
|
-
mapId: id
|
|
7845
|
-
}), displayLayerManagerAndLegendButtonInMap && jsx(LayerManagerMapButtonConnect, {
|
|
7846
|
-
mapId: mapId
|
|
7847
|
-
}), displayLayerManagerAndLegendButtonInMap && jsx(LegendMapButtonConnect, {
|
|
7848
|
-
mapId: mapId,
|
|
7849
|
-
multiLegend: multiLegend
|
|
7850
|
-
}), displayDimensionSelectButtonInMap && jsx(MultiDimensionSelectMapButtonsConnect, {
|
|
7851
|
-
mapId: mapId
|
|
7852
|
-
}), displayGetFeatureInfoButtonInMap && jsx(GetFeatureInfoButtonConnect, {
|
|
7853
|
-
mapId: mapId
|
|
7854
|
-
}), mapControls]
|
|
7855
7888
|
}), !disableTimeSlider && jsx(Box, {
|
|
7856
7889
|
sx: {
|
|
7857
7890
|
position: 'absolute',
|
|
@@ -7866,7 +7899,7 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_ref) {
|
|
|
7866
7899
|
mapWindowRef: mapWindowRef
|
|
7867
7900
|
})
|
|
7868
7901
|
}), jsx(MapViewConnect, {
|
|
7869
|
-
controls:
|
|
7902
|
+
controls: mapControlConfig,
|
|
7870
7903
|
displayTimeInMap: displayTimeInMap,
|
|
7871
7904
|
showScaleBar: false,
|
|
7872
7905
|
shouldAutoFetch: shouldAutoFetch,
|
|
@@ -7874,24 +7907,11 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_ref) {
|
|
|
7874
7907
|
shouldDisablePrefetching: shouldDisablePrefetching,
|
|
7875
7908
|
tileServerSettings: tileServerSettings,
|
|
7876
7909
|
children: children
|
|
7877
|
-
}), multiLegend && jsx(LegendConnect, {
|
|
7878
|
-
showMapId: true,
|
|
7879
|
-
mapId: mapId,
|
|
7880
|
-
multiLegend: multiLegend
|
|
7881
|
-
}), jsx(SearchControlConnect, {
|
|
7882
|
-
mapId: mapId
|
|
7883
7910
|
}), showClock && jsx(TimeSliderClockConnect, {
|
|
7884
7911
|
mapId: mapId
|
|
7885
|
-
}), displayGetFeatureInfoButtonInMap && jsx(GetFeatureInfoConnect, {
|
|
7886
|
-
showMapId: true,
|
|
7887
|
-
mapId: mapId
|
|
7888
|
-
}), jsx(LayerManagerConnect, {
|
|
7889
|
-
mapId: mapId,
|
|
7890
|
-
bounds: "parent",
|
|
7891
|
-
isDocked: true
|
|
7892
7912
|
})]
|
|
7893
7913
|
});
|
|
7894
|
-
}, [mapId, title,
|
|
7914
|
+
}, [mapId, title, id, mapControlConfig, tileServerSettings, disableTimeSlider, displayTimeInMap, shouldAutoFetch, shouldDisablePrefetching, children, showClock]);
|
|
7895
7915
|
};
|
|
7896
7916
|
|
|
7897
7917
|
var mapBoxStyle = function mapBoxStyle(theme) {
|
|
@@ -7970,7 +7990,7 @@ var MultiMapViewConnect = function MultiMapViewConnect(_ref) {
|
|
|
7970
7990
|
isAlwaysVisible: true,
|
|
7971
7991
|
mapWindowRef: multiMapWindowRef
|
|
7972
7992
|
})
|
|
7973
|
-
}),
|
|
7993
|
+
}), jsx(LegendConnect, {
|
|
7974
7994
|
showMapId: true,
|
|
7975
7995
|
mapId: firstMapId,
|
|
7976
7996
|
multiLegend: multiLegend
|
|
@@ -8051,23 +8071,24 @@ var makeMapPreset = function makeMapPreset(timeIncrement, uniqueId, referenceTim
|
|
|
8051
8071
|
title: "FC +" + timeIncrement,
|
|
8052
8072
|
displayTimeInMap: true,
|
|
8053
8073
|
bbox: {
|
|
8054
|
-
left: -
|
|
8055
|
-
bottom:
|
|
8056
|
-
right:
|
|
8057
|
-
top:
|
|
8074
|
+
left: -638936.0386164065,
|
|
8075
|
+
bottom: 6068439.661512798,
|
|
8076
|
+
right: 1613044.3568348314,
|
|
8077
|
+
top: 7876599.103115981
|
|
8058
8078
|
},
|
|
8059
8079
|
srs: PROJECTION.EPSG_3857.value,
|
|
8060
8080
|
componentType: 'MultiMap',
|
|
8061
8081
|
layers: layers.map(function (layer, index) {
|
|
8062
8082
|
return Object.assign({}, layer, {
|
|
8063
8083
|
id: uniqueId + "-" + index,
|
|
8064
|
-
dimensions
|
|
8084
|
+
/* Set time dimensions if layer type is not overLayer */
|
|
8085
|
+
dimensions: layer.layerType !== LayerType.overLayer ? [{
|
|
8065
8086
|
name: 'reference_time',
|
|
8066
8087
|
currentValue: referenceTime
|
|
8067
8088
|
}, {
|
|
8068
8089
|
name: 'time',
|
|
8069
8090
|
currentValue: mapTime
|
|
8070
|
-
}]
|
|
8091
|
+
}] : []
|
|
8071
8092
|
});
|
|
8072
8093
|
}),
|
|
8073
8094
|
displayLayerManagerAndLegendButtonInMap: displayLayerManagerAndLegendButtonInMap,
|
|
@@ -8085,8 +8106,10 @@ var ModelRunInterval = function ModelRunInterval(_ref) {
|
|
|
8085
8106
|
_ref$multiLegend = _ref.multiLegend,
|
|
8086
8107
|
multiLegend = _ref$multiLegend === void 0 ? false : _ref$multiLegend;
|
|
8087
8108
|
var displayLayerManagerAndLegendButtonInAllMaps = !useHasSyncGroupWithLayerActions(syncGroupsIds);
|
|
8088
|
-
/* Get latest reference time for
|
|
8089
|
-
var latestReferenceTime = useGetLatestReferenceTime(layers
|
|
8109
|
+
/* Get latest reference time for layer that is not an overLayer */
|
|
8110
|
+
var latestReferenceTime = useGetLatestReferenceTime(layers.find(function (layer) {
|
|
8111
|
+
return layer.layerType !== LayerType.overLayer;
|
|
8112
|
+
}));
|
|
8090
8113
|
if (latestReferenceTime === '') {
|
|
8091
8114
|
return jsx("div", {
|
|
8092
8115
|
children: "Loading..."
|