@terraware/web-components 4.2.26-rc.0 → 4.3.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/_vendor/react-multi-carousel/index.js +13 -0
- package/_vendor/react-multi-carousel/lib/Arrows.js +13 -0
- package/_vendor/react-multi-carousel/lib/Carousel.js +19 -0
- package/_vendor/react-multi-carousel/lib/CarouselItems.js +14 -0
- package/_vendor/react-multi-carousel/lib/Dots.js +16 -0
- package/_vendor/react-multi-carousel/lib/index.js +13 -0
- package/_vendor/react-multi-carousel/lib/types.js +13 -0
- package/_vendor/react-multi-carousel/lib/utils/clones.js +14 -0
- package/_vendor/react-multi-carousel/lib/utils/common.js +13 -0
- package/_vendor/react-multi-carousel/lib/utils/dots.js +14 -0
- package/_vendor/react-multi-carousel/lib/utils/elementWidth.js +12 -0
- package/_vendor/react-multi-carousel/lib/utils/index.js +20 -0
- package/_vendor/react-multi-carousel/lib/utils/mouseOrTouchMove.js +14 -0
- package/_vendor/react-multi-carousel/lib/utils/next.js +13 -0
- package/_vendor/react-multi-carousel/lib/utils/previous.js +14 -0
- package/_vendor/react-multi-carousel/lib/utils/throttle.js +12 -0
- package/_vendor/react-multi-carousel/lib/utils/throwError.js +14 -0
- package/_virtual/Arrows.js +3 -0
- package/_virtual/Carousel.js +3 -0
- package/_virtual/CarouselItems.js +3 -0
- package/_virtual/Dots.js +3 -0
- package/_virtual/_commonjsHelpers.js +5 -0
- package/_virtual/clones.js +3 -0
- package/_virtual/common.js +3 -0
- package/_virtual/dots2.js +3 -0
- package/_virtual/elementWidth.js +3 -0
- package/_virtual/index.js +7 -0
- package/_virtual/index2.js +3 -0
- package/_virtual/index3.js +3 -0
- package/_virtual/mouseOrTouchMove.js +3 -0
- package/_virtual/next.js +3 -0
- package/_virtual/previous.js +3 -0
- package/_virtual/throttle.js +3 -0
- package/_virtual/throwError.js +3 -0
- package/_virtual/types.js +3 -0
- package/components/AntSwitch/index.js +6 -4
- package/components/Autocomplete/Autocomplete.js +19 -16
- package/components/Badge/index.js +8 -6
- package/components/BusySpinner/index.js +11 -8
- package/components/Button/Button.js +12 -9
- package/components/Checkbox.js +11 -8
- package/components/Confirm/index.js +14 -17
- package/components/DatePicker/DatePicker.js +19 -23
- package/components/DialogBox/DialogBox.js +25 -20
- package/components/Divisor.js +11 -8
- package/components/Dropdown.js +18 -15
- package/components/EditableTable/index.js +17 -14
- package/components/ErrorBox/ErrorBox.js +18 -15
- package/components/FileChooser/index.js +20 -15
- package/components/FormBottomBar/index.js +15 -12
- package/components/Icon/Icon.js +9 -6
- package/components/Icon/icons/index.js +252 -251
- package/components/IconTooltip/index.js +14 -9
- package/components/Map/MapBox.js +35 -32
- package/components/Map/MapContainer.js +10 -6
- package/components/Map/MapDateSliderControl.js +14 -12
- package/components/Map/MapDrawer.js +16 -12
- package/components/Map/MapLegend.js +32 -28
- package/components/Map/MapViewStyleControl.js +11 -9
- package/components/Map/ReactMapboxWrapper.js +1 -1
- package/components/Map/index.js +13 -11
- package/components/Map/types.js +5 -3
- package/components/Map/useMaintainLayerOrder.js +5 -2
- package/components/Markdown/index.js +6 -4
- package/components/Message/Message.js +25 -20
- package/components/MultiSelect/index.js +26 -23
- package/components/Navbar/NavFooter.js +8 -5
- package/components/Navbar/NavItem.js +14 -11
- package/components/Navbar/NavSection.js +10 -7
- package/components/Navbar/Navbar.js +16 -11
- package/components/Navbar/SubNavbar.js +8 -5
- package/components/Note.js +10 -7
- package/components/OverlayModal/OverlayModal.js +13 -11
- package/components/PageForm/index.js +15 -12
- package/components/PhotoChooser/index.js +30 -25
- package/components/PhotosCarousel/index.js +15 -18
- package/components/Pill/index.js +14 -11
- package/components/PillList/index.js +10 -7
- package/components/PlacementWrapper/index.js +8 -6
- package/components/PopoverMenu/Popover.js +12 -9
- package/components/PopoverMenu/index.js +14 -11
- package/components/PopoverMultiSelect/index.js +14 -11
- package/components/ProgressCircle/ProgressCircle.js +12 -9
- package/components/RadioButton.js +9 -6
- package/components/Select/Select.js +9 -6
- package/components/Select/SelectT.js +30 -26
- package/components/Separator/index.js +7 -5
- package/components/Size.js +1 -1
- package/components/Slider/index.js +9 -6
- package/components/SummaryBox.js +13 -10
- package/components/Tabs/index.js +22 -18
- package/components/TextTruncated/index.js +13 -20
- package/components/Textfield/Textfield.js +34 -28
- package/components/Textfield/TruncatedTextArea.js +12 -10
- package/components/TimelineSlider/TimelineMarker.js +8 -6
- package/components/TimelineSlider/TimelineRail.js +6 -4
- package/components/TimelineSlider/index.js +14 -12
- package/components/Tooltip/Tooltip.js +12 -7
- package/components/ViewPhotosDialog/index.js +14 -11
- package/components/VirtualWalkthrough/Annotation.js +10 -8
- package/components/VirtualWalkthrough/AnnotationEditPane.js +23 -21
- package/components/VirtualWalkthrough/AnnotationPanel.js +16 -14
- package/components/VirtualWalkthrough/Application.js +9 -7
- package/components/VirtualWalkthrough/AutoRotator.js +5 -3
- package/components/VirtualWalkthrough/BlockingSpinner.js +10 -7
- package/components/VirtualWalkthrough/BoundaryRing.js +8 -6
- package/components/VirtualWalkthrough/BoundaryWall.js +8 -6
- package/components/VirtualWalkthrough/CameraInfo.js +15 -13
- package/components/VirtualWalkthrough/ControlsInfoPane.js +59 -57
- package/components/VirtualWalkthrough/GradientSky.js +8 -6
- package/components/VirtualWalkthrough/SplatControls.js +37 -35
- package/components/VirtualWalkthrough/SplatCrop.js +6 -4
- package/components/VirtualWalkthrough/SplatFadeCrop.js +7 -5
- package/components/VirtualWalkthrough/SplatModel.js +17 -14
- package/components/VirtualWalkthrough/SplatRevealRain.js +6 -4
- package/components/VirtualWalkthrough/TfAnnotationManager.js +8 -5
- package/components/VirtualWalkthrough/TfXrNavigation.js +7 -5
- package/components/VirtualWalkthrough/VirtualWalkthroughViewer.js +47 -45
- package/components/VirtualWalkthrough/VrAnnotationPanel.js +9 -7
- package/components/VirtualWalkthrough/XrAnnotationInteraction.js +9 -7
- package/components/VirtualWalkthrough/XrExitButton.js +9 -7
- package/components/VirtualWalkthrough/XrGazeDwell.js +9 -7
- package/components/VirtualWalkthrough/XrPointerRay.js +9 -7
- package/components/VirtualWalkthrough/boundary-ring.js +7 -5
- package/components/VirtualWalkthrough/boundary-wall.js +8 -6
- package/components/VirtualWalkthrough/groundPlane.js +6 -3
- package/components/VirtualWalkthrough/gsplat-fade-crop-effect.js +5 -2
- package/components/VirtualWalkthrough/splatFormat.js +6 -4
- package/components/VirtualWalkthrough/vr-annotation-panel-layout.js +4 -2
- package/components/VirtualWalkthrough/vr-annotation-panel.js +8 -5
- package/components/VirtualWalkthrough/walkthrough-camera.js +6 -4
- package/components/VirtualWalkthrough/xr-annotation-candidates.js +8 -6
- package/components/VirtualWalkthrough/xr-annotation-interaction.js +9 -6
- package/components/VirtualWalkthrough/xr-annotation-targeting.js +5 -2
- package/components/VirtualWalkthrough/xr-button-arming.js +4 -2
- package/components/VirtualWalkthrough/xr-button-hold.js +5 -3
- package/components/VirtualWalkthrough/xr-exit-button.js +10 -8
- package/components/VirtualWalkthrough/xr-face-buttons.js +6 -4
- package/components/VirtualWalkthrough/xr-gaze-dwell-state.js +5 -3
- package/components/VirtualWalkthrough/xr-gaze-dwell.js +9 -7
- package/components/VirtualWalkthrough/xr-interactive-ui.js +10 -8
- package/components/VirtualWalkthrough/xr-pointer-ray.js +5 -3
- package/components/VirtualWalkthrough/xr-progress-pie.js +4 -2
- package/components/VirtualWalkthrough/xr-ray-quad.js +5 -2
- package/components/VirtualWalkthrough/xr-scene-bounds.js +5 -3
- package/components/VirtualWalkthrough/xr-teleport-gesture.js +4 -2
- package/components/svg/BlobbyGrayIconImage.js +13 -11
- package/components/svg/BlobbyGrayIconImport.js +13 -11
- package/components/svg/BlobbyGrayIconUploadToTheCloud.js +13 -11
- package/components/svg/BlobbyIconCloudChecked.js +41 -39
- package/components/svg/BlobbyIconExportOrUploadPhoto.js +41 -39
- package/components/svg/BlobbyIconFolder.js +41 -39
- package/components/svg/BlobbyIconGraphReport.js +41 -39
- package/components/svg/BlobbyIconHappy.js +41 -39
- package/components/svg/BlobbyIconHeartMonitor.js +41 -39
- package/components/svg/BlobbyIconLeaf.js +41 -39
- package/components/svg/BlobbyIconLibrary.js +41 -39
- package/components/svg/BlobbyIconNursery.js +41 -39
- package/components/svg/BlobbyIconOrganization.js +41 -39
- package/components/svg/BlobbyIconParchment.js +41 -39
- package/components/svg/BlobbyIconPeople.js +41 -39
- package/components/svg/BlobbyIconSeedBank.js +41 -39
- package/components/svg/BlobbyIconSeedling.js +41 -39
- package/components/svg/BlobbyIconSeeds.js +41 -39
- package/components/svg/BlobbyIconSite.js +42 -40
- package/components/svg/BlobbyIconSparkles.js +41 -39
- package/components/svg/BlobbyIconWrench.js +41 -39
- package/components/svg/Bug.js +8 -6
- package/components/svg/Calendar.js +8 -6
- package/components/svg/CaretDown.js +8 -6
- package/components/svg/CaretLeft.js +8 -6
- package/components/svg/CaretRight.js +8 -6
- package/components/svg/CaretUp.js +8 -6
- package/components/svg/ChevronDown.js +8 -6
- package/components/svg/ChevronUp.js +8 -6
- package/components/svg/Close.js +8 -6
- package/components/svg/Critical.js +8 -6
- package/components/svg/Edit.js +41 -39
- package/components/svg/Error.js +8 -6
- package/components/svg/Filter.js +8 -6
- package/components/svg/Folder.js +8 -6
- package/components/svg/Help.js +8 -6
- package/components/svg/Home.js +8 -6
- package/components/svg/IconAdd.js +8 -6
- package/components/svg/IconArrowRight.js +8 -6
- package/components/svg/IconBusinessNetwork.js +8 -6
- package/components/svg/IconCalendar.js +8 -6
- package/components/svg/IconCancel.js +8 -6
- package/components/svg/IconChargingBattery.js +8 -6
- package/components/svg/IconChecklist.js +8 -6
- package/components/svg/IconCheckmark.js +8 -6
- package/components/svg/IconCoinInHand.js +8 -6
- package/components/svg/IconColumns.js +8 -6
- package/components/svg/IconComment.js +8 -6
- package/components/svg/IconDashboard.js +8 -6
- package/components/svg/IconDataMigration.js +8 -6
- package/components/svg/IconDocument.js +8 -6
- package/components/svg/IconDownloadFromTheCloud.js +8 -6
- package/components/svg/IconEdit.js +8 -6
- package/components/svg/IconExpand.js +8 -6
- package/components/svg/IconExport.js +8 -6
- package/components/svg/IconExternalLink.js +8 -6
- package/components/svg/IconEye.js +8 -6
- package/components/svg/IconEyeOff.js +8 -6
- package/components/svg/IconFile.js +8 -6
- package/components/svg/IconFolder.js +8 -6
- package/components/svg/IconFullScreen.js +8 -6
- package/components/svg/IconFutures.js +8 -6
- package/components/svg/IconGraphReport.js +8 -6
- package/components/svg/IconHeartMonitor.js +8 -6
- package/components/svg/IconHelp.js +8 -6
- package/components/svg/IconHistory.js +8 -6
- package/components/svg/IconImport.js +8 -6
- package/components/svg/IconIndex.js +8 -6
- package/components/svg/IconLayers.js +8 -6
- package/components/svg/IconLibrary.js +8 -6
- package/components/svg/IconList.js +8 -6
- package/components/svg/IconLivePlant.js +8 -6
- package/components/svg/IconLocations.js +8 -6
- package/components/svg/IconMail.js +8 -6
- package/components/svg/IconManager.js +8 -6
- package/components/svg/IconMarker.js +8 -6
- package/components/svg/IconMenu.js +8 -6
- package/components/svg/IconMenuHorizontal.js +8 -6
- package/components/svg/IconModule.js +8 -6
- package/components/svg/IconMyLocation.js +8 -6
- package/components/svg/IconNote.js +8 -6
- package/components/svg/IconNursery.js +8 -6
- package/components/svg/IconOrg.js +8 -6
- package/components/svg/IconParchment.js +8 -6
- package/components/svg/IconPhoto.js +8 -6
- package/components/svg/IconPlantsFilled.js +8 -6
- package/components/svg/IconRedo.js +8 -6
- package/components/svg/IconRestorationSite.js +8 -6
- package/components/svg/IconSeedBank.js +8 -6
- package/components/svg/IconSeedling.js +8 -6
- package/components/svg/IconSettings.js +8 -6
- package/components/svg/IconSlice.js +8 -6
- package/components/svg/IconSubmit.js +8 -6
- package/components/svg/IconSubtract.js +8 -6
- package/components/svg/IconSynced.js +8 -6
- package/components/svg/IconTrashCan.js +8 -6
- package/components/svg/IconTreasureMap.js +8 -6
- package/components/svg/IconUnavailable.js +8 -6
- package/components/svg/IconUndo.js +8 -6
- package/components/svg/IconVariable.js +8 -6
- package/components/svg/IconVideo.js +9 -7
- package/components/svg/IconWifi.js +8 -6
- package/components/svg/Info.js +8 -6
- package/components/svg/Key.js +8 -6
- package/components/svg/Leaf.js +8 -6
- package/components/svg/Lock.js +8 -6
- package/components/svg/Logo.js +16 -14
- package/components/svg/MenuVertical.js +8 -6
- package/components/svg/Notification.js +8 -6
- package/components/svg/Person.js +8 -6
- package/components/svg/Plus.js +8 -6
- package/components/svg/RestorationSite.js +8 -6
- package/components/svg/Search.js +8 -6
- package/components/svg/Seeds.js +8 -6
- package/components/svg/Site.js +8 -6
- package/components/svg/Sparkles.js +8 -6
- package/components/svg/Species.js +8 -6
- package/components/svg/Species2.js +41 -39
- package/components/svg/Spinner.js +16 -14
- package/components/svg/Star.js +8 -6
- package/components/svg/Success.js +8 -6
- package/components/svg/SuccessFilled.js +8 -6
- package/components/svg/TerrawareLogoDesktop.js +17 -15
- package/components/svg/TerrawareLogoMobile.js +9 -7
- package/components/svg/Touchscreen.js +8 -6
- package/components/svg/UploadCloud.js +41 -39
- package/components/svg/Warning.js +8 -6
- package/components/svg/WelcomeClipboard.js +32 -30
- package/components/svg/index.js +127 -127
- package/components/table/EnhancedTableToolbar.js +18 -15
- package/components/table/EnhancedTableToolbarV2.js +8 -6
- package/components/table/TableCellRenderer.js +37 -32
- package/components/table/TableHeader.js +17 -14
- package/components/table/TableHeaderItem.js +18 -15
- package/components/table/density.js +5 -3
- package/components/table/index.js +40 -37
- package/components/table/sort.js +6 -4
- package/components/table/types.js +1 -1
- package/components/types/index.js +1 -1
- package/hooks/useBoolean.js +4 -2
- package/hooks/useCameraPosition.js +5 -2
- package/hooks/useDevicePerformance.js +6 -3
- package/hooks/useXr.js +6 -4
- package/index.js +55 -58
- package/package.json +6 -2
- package/style-dictionary-dist/TerrawareTheme.js +2 -1
- package/theme.js +5 -2
- package/utils/color.js +5 -2
- package/utils/date.js +7 -6
- package/utils/index.js +4 -5
- package/utils/preventDefaultEvent.js +2 -1
- package/utils/text.js +3 -2
- package/utils/useDeviceInfo.js +2 -1
- package/virtualWalkthrough.js +23 -31
- package/components/Button/button.test.js +0 -23
- package/components/MultiSelect/MultiSelect.test.js +0 -73
- package/components/VirtualWalkthrough/TfXrNavigation.test.js +0 -110
- package/components/VirtualWalkthrough/boundary-ring.test.js +0 -109
- package/components/VirtualWalkthrough/boundary-wall.test.js +0 -203
- package/components/VirtualWalkthrough/groundPlane.test.js +0 -45
- package/components/VirtualWalkthrough/splatFormat.test.js +0 -51
- package/components/VirtualWalkthrough/vr-annotation-panel-layout.test.js +0 -26
- package/components/VirtualWalkthrough/xr-annotation-targeting.test.js +0 -66
- package/components/VirtualWalkthrough/xr-button-arming.test.js +0 -35
- package/components/VirtualWalkthrough/xr-button-hold.test.js +0 -57
- package/components/VirtualWalkthrough/xr-exit-button.test.js +0 -23
- package/components/VirtualWalkthrough/xr-face-buttons.test.js +0 -82
- package/components/VirtualWalkthrough/xr-gaze-dwell-state.test.js +0 -61
- package/components/VirtualWalkthrough/xr-interactive-ui.test.js +0 -165
- package/components/VirtualWalkthrough/xr-progress-pie.test.js +0 -79
- package/components/VirtualWalkthrough/xr-ray-quad.test.js +0 -37
- package/components/VirtualWalkthrough/xr-scene-bounds.test.js +0 -70
- package/components/VirtualWalkthrough/xr-teleport-gesture.test.js +0 -90
- package/components/table/sort.test.js +0 -35
- package/utils/date.test.js +0 -84
- package/utils/text.test.js +0 -21
package/components/Map/MapBox.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useRef, useState, useCallback, useMemo, useEffect } from 'react';
|
|
2
|
+
import ReactMapbox, { Layer, Marker, FullscreenControl, NavigationControl, Source } from 'react-map-gl/mapbox';
|
|
3
|
+
import { useTheme, Box } from '@mui/material';
|
|
4
4
|
import 'mapbox-gl/dist/mapbox-gl.css';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
5
|
+
import 'lodash';
|
|
6
|
+
import 'luxon';
|
|
7
|
+
import useDeviceInfo from '../../utils/useDeviceInfo.js';
|
|
8
|
+
import Icon from '../Icon/Icon.js';
|
|
9
|
+
import MapViewStyleControl from './MapViewStyleControl.js';
|
|
10
|
+
import { stylesUrl } from './types.js';
|
|
11
|
+
import { useMaintainLayerOrder } from './useMaintainLayerOrder.js';
|
|
12
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
+
|
|
12
14
|
const MapBox = props => {
|
|
13
15
|
const {
|
|
14
16
|
clusterRadius,
|
|
@@ -133,7 +135,7 @@ const MapBox = props => {
|
|
|
133
135
|
textLayers
|
|
134
136
|
} = useMemo(() => {
|
|
135
137
|
const _borderLayers = featureGroups?.map(group => {
|
|
136
|
-
return /*#__PURE__*/
|
|
138
|
+
return /*#__PURE__*/jsx(Layer, {
|
|
137
139
|
id: `${group.layerId}-border`,
|
|
138
140
|
source: 'mapData',
|
|
139
141
|
type: "line",
|
|
@@ -155,8 +157,8 @@ const MapBox = props => {
|
|
|
155
157
|
const notSelectedFilter = ['==', ['get', 'selected'], false];
|
|
156
158
|
const hoverFilter = ['==', ['get', 'id'], hoverFeatureId ?? null];
|
|
157
159
|
const notHoverFilter = ['!=', ['get', 'id'], hoverFeatureId ?? null];
|
|
158
|
-
return /*#__PURE__*/
|
|
159
|
-
children: [/*#__PURE__*/
|
|
160
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
161
|
+
children: [/*#__PURE__*/jsx(Layer, {
|
|
160
162
|
id: group.layerId,
|
|
161
163
|
source: 'mapData',
|
|
162
164
|
type: 'fill',
|
|
@@ -164,7 +166,7 @@ const MapBox = props => {
|
|
|
164
166
|
'fill-opacity': 0
|
|
165
167
|
},
|
|
166
168
|
filter: ['all', groupFilter, clickableFilter]
|
|
167
|
-
}, group.layerId), /*#__PURE__*/
|
|
169
|
+
}, group.layerId), /*#__PURE__*/jsx(Layer, {
|
|
168
170
|
id: `${group.layerId}-unselected`,
|
|
169
171
|
source: 'mapData',
|
|
170
172
|
type: 'fill',
|
|
@@ -176,7 +178,7 @@ const MapBox = props => {
|
|
|
176
178
|
'fill-opacity': opacity
|
|
177
179
|
},
|
|
178
180
|
filter: ['all', groupFilter, notSelectedFilter, notHoverFilter]
|
|
179
|
-
}, `${group.layerId}-unselected`), /*#__PURE__*/
|
|
181
|
+
}, `${group.layerId}-unselected`), /*#__PURE__*/jsx(Layer, {
|
|
180
182
|
id: `${group.layerId}-selected`,
|
|
181
183
|
slot: 'bottom',
|
|
182
184
|
source: 'mapData',
|
|
@@ -189,7 +191,7 @@ const MapBox = props => {
|
|
|
189
191
|
'fill-opacity': selectedOpacity
|
|
190
192
|
},
|
|
191
193
|
filter: ['all', groupFilter, selectedFilter, notHoverFilter]
|
|
192
|
-
}, `${group.layerId}-selected`), /*#__PURE__*/
|
|
194
|
+
}, `${group.layerId}-selected`), /*#__PURE__*/jsx(Layer, {
|
|
193
195
|
id: `${group.layerId}-hover`,
|
|
194
196
|
source: 'mapData',
|
|
195
197
|
type: 'fill',
|
|
@@ -201,7 +203,7 @@ const MapBox = props => {
|
|
|
201
203
|
'fill-opacity': hoverOpacity
|
|
202
204
|
},
|
|
203
205
|
filter: ['all', groupFilter, hoverFilter, notSelectedFilter]
|
|
204
|
-
}, `${group.layerId}-hover`), /*#__PURE__*/
|
|
206
|
+
}, `${group.layerId}-hover`), /*#__PURE__*/jsx(Layer, {
|
|
205
207
|
id: `${group.layerId}-selected-hover`,
|
|
206
208
|
source: 'mapData',
|
|
207
209
|
type: 'fill',
|
|
@@ -219,7 +221,7 @@ const MapBox = props => {
|
|
|
219
221
|
const _textLayers = featureGroups?.map(group => {
|
|
220
222
|
const groupFilter = ['==', ['get', 'layerId'], group.layerId];
|
|
221
223
|
const labelFilter = ['has', 'label'];
|
|
222
|
-
return /*#__PURE__*/
|
|
224
|
+
return /*#__PURE__*/jsx(Layer, {
|
|
223
225
|
id: `${group.layerId}-label`,
|
|
224
226
|
source: 'mapData',
|
|
225
227
|
type: 'symbol',
|
|
@@ -250,7 +252,7 @@ const MapBox = props => {
|
|
|
250
252
|
layerId,
|
|
251
253
|
featureId
|
|
252
254
|
}) => `${layerId}/${featureId}`);
|
|
253
|
-
return /*#__PURE__*/
|
|
255
|
+
return /*#__PURE__*/jsx(Layer, {
|
|
254
256
|
id: `highlight-${group.highlightId}-${index}`,
|
|
255
257
|
source: 'mapData',
|
|
256
258
|
type: 'fill',
|
|
@@ -273,7 +275,7 @@ const MapBox = props => {
|
|
|
273
275
|
return clusteredMarkers.map((markers, i) => {
|
|
274
276
|
if (markers.length === 1) {
|
|
275
277
|
const marker = markers[0];
|
|
276
|
-
return /*#__PURE__*/
|
|
278
|
+
return /*#__PURE__*/jsx(Marker, {
|
|
277
279
|
className: "map-marker",
|
|
278
280
|
longitude: marker.longitude,
|
|
279
281
|
latitude: marker.latitude,
|
|
@@ -285,7 +287,7 @@ const MapBox = props => {
|
|
|
285
287
|
style: {
|
|
286
288
|
backgroundColor: marker.selected ? markerGroup.style.iconColor : theme.palette.TwClrBg
|
|
287
289
|
},
|
|
288
|
-
children: /*#__PURE__*/
|
|
290
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
289
291
|
fillColor: marker.selected ? theme.palette.TwClrBg : markerGroup.style.iconColor,
|
|
290
292
|
name: markerGroup.style.iconName,
|
|
291
293
|
size: 'small'
|
|
@@ -297,7 +299,7 @@ const MapBox = props => {
|
|
|
297
299
|
const latAvg = latSum / markers.length;
|
|
298
300
|
const lngAvg = lngSum / markers.length;
|
|
299
301
|
const selected = markers.some(marker => marker.selected);
|
|
300
|
-
return /*#__PURE__*/
|
|
302
|
+
return /*#__PURE__*/jsxs(Marker, {
|
|
301
303
|
className: "map-marker map-marker--cluster",
|
|
302
304
|
longitude: lngAvg,
|
|
303
305
|
latitude: latAvg,
|
|
@@ -316,10 +318,10 @@ const MapBox = props => {
|
|
|
316
318
|
style: {
|
|
317
319
|
backgroundColor: selected ? markerGroup.style.iconColor : theme.palette.TwClrBg
|
|
318
320
|
},
|
|
319
|
-
children: [/*#__PURE__*/
|
|
321
|
+
children: [/*#__PURE__*/jsx("p", {
|
|
320
322
|
className: "count",
|
|
321
323
|
children: markers.length
|
|
322
|
-
}), /*#__PURE__*/
|
|
324
|
+
}), /*#__PURE__*/jsx(Icon, {
|
|
323
325
|
fillColor: selected ? theme.palette.TwClrBg : markerGroup.style.iconColor,
|
|
324
326
|
name: markerGroup.style.iconName,
|
|
325
327
|
size: 'small'
|
|
@@ -391,7 +393,7 @@ const MapBox = props => {
|
|
|
391
393
|
return [...fillLayers.map(layer => layer.props.id), ...highlightLayers.map(layer => layer.props.id), ...borderLayers.map(layer => layer.props.id), ...textLayers.map(layer => layer.props.id)];
|
|
392
394
|
}, [borderLayers, fillLayers, highlightLayers, textLayers]);
|
|
393
395
|
useMaintainLayerOrder(mapRef, orderedLayerIds);
|
|
394
|
-
return /*#__PURE__*/
|
|
396
|
+
return /*#__PURE__*/jsxs(ReactMapbox, {
|
|
395
397
|
attributionControl: false,
|
|
396
398
|
cursor: cursor,
|
|
397
399
|
doubleClickZoom: !disableZoom && !disableDoubleClickZoom,
|
|
@@ -413,21 +415,21 @@ const MapBox = props => {
|
|
|
413
415
|
onMouseOver: onMouseOver,
|
|
414
416
|
onMouseOut: onMouseOut,
|
|
415
417
|
onMouseMove: onMouseMove,
|
|
416
|
-
children: [isDesktop && !hideFullScreenControl && /*#__PURE__*/
|
|
418
|
+
children: [isDesktop && !hideFullScreenControl && /*#__PURE__*/jsx(FullscreenControl, {
|
|
417
419
|
position: "top-left",
|
|
418
420
|
containerId: containerId
|
|
419
|
-
}), !hideZoomControl && /*#__PURE__*/
|
|
421
|
+
}), !hideZoomControl && /*#__PURE__*/jsx(NavigationControl, {
|
|
420
422
|
showCompass: false,
|
|
421
423
|
style: {
|
|
422
424
|
marginRight: theme.spacing(2),
|
|
423
425
|
marginBottom: theme.spacing(2)
|
|
424
426
|
},
|
|
425
427
|
position: "bottom-right"
|
|
426
|
-
}), !hideMapViewStyleControl && /*#__PURE__*/
|
|
428
|
+
}), !hideMapViewStyleControl && /*#__PURE__*/jsx(MapViewStyleControl, {
|
|
427
429
|
containerId: containerId,
|
|
428
430
|
mapViewStyle: mapViewStyle,
|
|
429
431
|
setMapViewStyle: setMapViewStyle
|
|
430
|
-
}), controlTopRight && /*#__PURE__*/
|
|
432
|
+
}), controlTopRight && /*#__PURE__*/jsx(Box, {
|
|
431
433
|
sx: {
|
|
432
434
|
height: 'max-content',
|
|
433
435
|
position: 'absolute',
|
|
@@ -437,7 +439,7 @@ const MapBox = props => {
|
|
|
437
439
|
zIndex: 1000
|
|
438
440
|
},
|
|
439
441
|
children: controlTopRight
|
|
440
|
-
}), controlBottomLeft && /*#__PURE__*/
|
|
442
|
+
}), controlBottomLeft && /*#__PURE__*/jsx(Box, {
|
|
441
443
|
style: {
|
|
442
444
|
height: 'max-content',
|
|
443
445
|
position: 'absolute',
|
|
@@ -447,7 +449,7 @@ const MapBox = props => {
|
|
|
447
449
|
zIndex: 1000
|
|
448
450
|
},
|
|
449
451
|
children: controlBottomLeft
|
|
450
|
-
}), geojson && /*#__PURE__*/
|
|
452
|
+
}), geojson && /*#__PURE__*/jsxs(Source, {
|
|
451
453
|
id: "mapData",
|
|
452
454
|
type: "geojson",
|
|
453
455
|
data: geojson,
|
|
@@ -455,4 +457,5 @@ const MapBox = props => {
|
|
|
455
457
|
}), markersComponents]
|
|
456
458
|
}, mapId);
|
|
457
459
|
};
|
|
458
|
-
|
|
460
|
+
|
|
461
|
+
export { MapBox as default };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import 'lodash';
|
|
3
|
+
import 'luxon';
|
|
4
|
+
import useDeviceInfo from '../../utils/useDeviceInfo.js';
|
|
3
5
|
import './styles.scss';
|
|
4
|
-
import {
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
5
8
|
const MapContainer = props => {
|
|
6
9
|
const {
|
|
7
10
|
containerId,
|
|
@@ -14,13 +17,14 @@ const MapContainer = props => {
|
|
|
14
17
|
isDesktop
|
|
15
18
|
} = useDeviceInfo();
|
|
16
19
|
const drawerOnly = useMemo(() => !isDesktop && drawerOpen, [drawerOpen, isDesktop]);
|
|
17
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/jsxs("div", {
|
|
18
21
|
id: containerId,
|
|
19
22
|
className: `map-container map-container${isDesktop ? '--desktop' : `--mobile${drawerOpen ? '-drawer-open' : ''}`}`,
|
|
20
|
-
children: [/*#__PURE__*/
|
|
23
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
21
24
|
className: `map-holder${drawerOnly ? ' map-holder--hidden' : ''}`,
|
|
22
25
|
children: map
|
|
23
26
|
}), drawerOpen && drawer, !drawerOnly && legend]
|
|
24
27
|
});
|
|
25
28
|
};
|
|
26
|
-
|
|
29
|
+
|
|
30
|
+
export { MapContainer as default };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useTheme, Card, Typography, Box } from '@mui/material';
|
|
3
3
|
import { DateTime } from 'luxon';
|
|
4
|
-
import { getShortDate } from '../../utils/date';
|
|
5
|
-
import Slider from '../Slider';
|
|
6
|
-
import {
|
|
4
|
+
import { getShortDate } from '../../utils/date.js';
|
|
5
|
+
import Slider from '../Slider/index.js';
|
|
6
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
|
|
7
8
|
const MapDateSliderControl = ({
|
|
8
9
|
dates,
|
|
9
10
|
selectedDate,
|
|
@@ -26,11 +27,11 @@ const MapDateSliderControl = ({
|
|
|
26
27
|
}));
|
|
27
28
|
}, [dates]);
|
|
28
29
|
const getDateString = date => getShortDate(date);
|
|
29
|
-
const getDateLabel = date => /*#__PURE__*/
|
|
30
|
+
const getDateLabel = date => /*#__PURE__*/jsx(Typography, {
|
|
30
31
|
fontSize: "12px",
|
|
31
32
|
children: getDateString(date)
|
|
32
33
|
});
|
|
33
|
-
return /*#__PURE__*/
|
|
34
|
+
return /*#__PURE__*/jsxs(Card, {
|
|
34
35
|
style: {
|
|
35
36
|
border: `1px solid ${theme.palette.TwClrBrdrTertiary}`,
|
|
36
37
|
borderRadius: '8px',
|
|
@@ -40,20 +41,20 @@ const MapDateSliderControl = ({
|
|
|
40
41
|
maxWidth: '270px',
|
|
41
42
|
width: dates.length > 1 ? '270px' : undefined
|
|
42
43
|
},
|
|
43
|
-
children: [selectedDate && /*#__PURE__*/
|
|
44
|
+
children: [selectedDate && /*#__PURE__*/jsx(Typography, {
|
|
44
45
|
fontSize: "14px",
|
|
45
46
|
fontWeight: 600,
|
|
46
47
|
textAlign: "right",
|
|
47
48
|
children: getDateString(selectedDate)
|
|
48
|
-
}), dates.length > 1 && /*#__PURE__*/
|
|
49
|
-
children: [/*#__PURE__*/
|
|
49
|
+
}), dates.length > 1 && /*#__PURE__*/jsxs(Fragment, {
|
|
50
|
+
children: [/*#__PURE__*/jsx(Slider, {
|
|
50
51
|
value: selectedDate.valueOf(),
|
|
51
52
|
min: earliestDate.valueOf(),
|
|
52
53
|
max: latestDate.valueOf(),
|
|
53
54
|
marks: marks,
|
|
54
55
|
valueLabelDisplay: "off",
|
|
55
56
|
onChange: value => onChange(DateTime.fromMillis(value))
|
|
56
|
-
}), /*#__PURE__*/
|
|
57
|
+
}), /*#__PURE__*/jsxs(Box, {
|
|
57
58
|
display: "flex",
|
|
58
59
|
justifyContent: "space-between",
|
|
59
60
|
children: [getDateLabel(earliestDate), getDateLabel(latestDate)]
|
|
@@ -61,4 +62,5 @@ const MapDateSliderControl = ({
|
|
|
61
62
|
})]
|
|
62
63
|
});
|
|
63
64
|
};
|
|
64
|
-
|
|
65
|
+
|
|
66
|
+
export { MapDateSliderControl as default };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Box, IconButton
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import 'react';
|
|
2
|
+
import { useTheme, Box, IconButton } from '@mui/material';
|
|
3
|
+
import 'lodash';
|
|
4
|
+
import 'luxon';
|
|
5
|
+
import useDeviceInfo from '../../utils/useDeviceInfo.js';
|
|
6
|
+
import Icon from '../Icon/Icon.js';
|
|
5
7
|
import './styles.scss';
|
|
6
|
-
import {
|
|
8
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
+
|
|
7
10
|
const MapDrawer = props => {
|
|
8
11
|
const {
|
|
9
12
|
children,
|
|
@@ -17,28 +20,29 @@ const MapDrawer = props => {
|
|
|
17
20
|
const {
|
|
18
21
|
isDesktop
|
|
19
22
|
} = useDeviceInfo();
|
|
20
|
-
return open ? /*#__PURE__*/
|
|
23
|
+
return open ? /*#__PURE__*/jsxs(Box, {
|
|
21
24
|
className: `map-drawer map-drawer${isDesktop ? `--${size}` : '--mobile'}`,
|
|
22
25
|
borderLeft: isDesktop ? `1px solid ${theme.palette.TwClrBrdrTertiary}` : undefined,
|
|
23
26
|
borderRight: isDesktop ? `1px solid ${theme.palette.TwClrBrdrTertiary}` : undefined,
|
|
24
27
|
style: style,
|
|
25
|
-
children: [/*#__PURE__*/
|
|
28
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
26
29
|
className: "map-drawer--header",
|
|
27
|
-
children: [/*#__PURE__*/
|
|
30
|
+
children: [/*#__PURE__*/jsx("p", {
|
|
28
31
|
className: "title",
|
|
29
32
|
children: title
|
|
30
|
-
}), /*#__PURE__*/
|
|
33
|
+
}), /*#__PURE__*/jsx(IconButton, {
|
|
31
34
|
onClick: onClose,
|
|
32
35
|
size: "small",
|
|
33
|
-
children: /*#__PURE__*/
|
|
36
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
34
37
|
name: "close",
|
|
35
38
|
className: "icon-close"
|
|
36
39
|
})
|
|
37
40
|
})]
|
|
38
|
-
}), /*#__PURE__*/
|
|
41
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
39
42
|
className: 'map-drawer--body',
|
|
40
43
|
children: children
|
|
41
44
|
})]
|
|
42
45
|
}) : null;
|
|
43
46
|
};
|
|
44
|
-
|
|
47
|
+
|
|
48
|
+
export { MapDrawer as default };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import 'react';
|
|
2
|
+
import { useTheme, Typography, Tooltip, Box } from '@mui/material';
|
|
3
|
+
import 'lodash';
|
|
4
|
+
import 'luxon';
|
|
5
|
+
import useDeviceInfo from '../../utils/useDeviceInfo.js';
|
|
6
|
+
import AntSwitch from '../AntSwitch/index.js';
|
|
7
|
+
import Icon from '../Icon/Icon.js';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
|
+
|
|
7
10
|
const MapLegend = ({
|
|
8
11
|
legends
|
|
9
12
|
}) => {
|
|
@@ -15,27 +18,27 @@ const MapLegend = ({
|
|
|
15
18
|
const legendComponents = legends.map((legend, index) => {
|
|
16
19
|
const isFirst = index === 0;
|
|
17
20
|
const isLast = index === legends.length - 1;
|
|
18
|
-
const switchComponent = legend.type === 'highlight' ? /*#__PURE__*/
|
|
21
|
+
const switchComponent = legend.type === 'highlight' ? /*#__PURE__*/jsx(AntSwitch, {
|
|
19
22
|
disabled: legend.disabled,
|
|
20
23
|
checked: legend.visible,
|
|
21
24
|
onChange: legend.setVisible
|
|
22
25
|
}) : undefined;
|
|
23
|
-
const titleComponent = /*#__PURE__*/
|
|
26
|
+
const titleComponent = /*#__PURE__*/jsxs(Typography, {
|
|
24
27
|
fontSize: "16px",
|
|
25
28
|
fontWeight: 600,
|
|
26
29
|
width: isMobile ? '100%' : undefined,
|
|
27
30
|
marginRight: isMobile ? 0 : theme.spacing(4),
|
|
28
31
|
paddingLeft: switchComponent ? theme.spacing(1) : theme.spacing(0),
|
|
29
|
-
children: [legend.title, legend.tooltip && /*#__PURE__*/
|
|
32
|
+
children: [legend.title, legend.tooltip && /*#__PURE__*/jsx(Tooltip, {
|
|
30
33
|
title: legend.tooltip,
|
|
31
34
|
sx: {
|
|
32
35
|
display: 'inline-block',
|
|
33
36
|
verticalAlign: 'text-top',
|
|
34
37
|
marginLeft: theme.spacing(1)
|
|
35
38
|
},
|
|
36
|
-
children: /*#__PURE__*/
|
|
39
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
37
40
|
display: "flex",
|
|
38
|
-
children: /*#__PURE__*/
|
|
41
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
39
42
|
fillColor: theme.palette.TwClrIcnInfo,
|
|
40
43
|
name: "info",
|
|
41
44
|
size: "small"
|
|
@@ -49,7 +52,7 @@ const MapLegend = ({
|
|
|
49
52
|
const selected = legend.type === 'layer' ? item.id === legend.selectedLayer : legend.type === 'marker' ? item.visible : false;
|
|
50
53
|
const logoComponent = () => {
|
|
51
54
|
if (item.style.type === 'icon') {
|
|
52
|
-
return /*#__PURE__*/
|
|
55
|
+
return /*#__PURE__*/jsx(Icon, {
|
|
53
56
|
name: item.style.iconName,
|
|
54
57
|
fillColor: item.style.iconColor,
|
|
55
58
|
style: {
|
|
@@ -58,7 +61,7 @@ const MapLegend = ({
|
|
|
58
61
|
size: 'small'
|
|
59
62
|
});
|
|
60
63
|
} else {
|
|
61
|
-
return /*#__PURE__*/
|
|
64
|
+
return /*#__PURE__*/jsx(Box, {
|
|
62
65
|
display: 'flex',
|
|
63
66
|
sx: {
|
|
64
67
|
border: `2px solid ${item.style.borderColor ?? theme.palette.TwClrBaseGreen300}`,
|
|
@@ -68,7 +71,7 @@ const MapLegend = ({
|
|
|
68
71
|
minWidth: '24px',
|
|
69
72
|
marginRight: theme.spacing(1)
|
|
70
73
|
},
|
|
71
|
-
children: /*#__PURE__*/
|
|
74
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
72
75
|
height: '16px',
|
|
73
76
|
width: '24px',
|
|
74
77
|
sx: {
|
|
@@ -85,23 +88,23 @@ const MapLegend = ({
|
|
|
85
88
|
switch (legend.type) {
|
|
86
89
|
case 'marker':
|
|
87
90
|
const featureItem = item;
|
|
88
|
-
const visibleIcon = featureItem.visible ? /*#__PURE__*/
|
|
91
|
+
const visibleIcon = featureItem.visible ? /*#__PURE__*/jsx(Icon, {
|
|
89
92
|
name: "iconEye"
|
|
90
|
-
}) : /*#__PURE__*/
|
|
93
|
+
}) : /*#__PURE__*/jsx(Icon, {
|
|
91
94
|
name: "iconEyeOff"
|
|
92
95
|
});
|
|
93
|
-
return /*#__PURE__*/
|
|
96
|
+
return /*#__PURE__*/jsx(Box, {
|
|
94
97
|
display: "flex",
|
|
95
98
|
children: visibleIcon
|
|
96
99
|
});
|
|
97
100
|
case 'layer':
|
|
98
101
|
const layerItem = item;
|
|
99
|
-
return /*#__PURE__*/
|
|
102
|
+
return /*#__PURE__*/jsx(Box, {
|
|
100
103
|
display: "flex",
|
|
101
104
|
sx: {
|
|
102
105
|
visibility: layerItem.id === legend.selectedLayer ? 'visible' : 'hidden'
|
|
103
106
|
},
|
|
104
|
-
children: /*#__PURE__*/
|
|
107
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
105
108
|
name: "checkmark",
|
|
106
109
|
style: {
|
|
107
110
|
marginRight: theme.spacing(1)
|
|
@@ -112,7 +115,7 @@ const MapLegend = ({
|
|
|
112
115
|
return undefined;
|
|
113
116
|
}
|
|
114
117
|
};
|
|
115
|
-
return /*#__PURE__*/
|
|
118
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
116
119
|
onClick: onClick,
|
|
117
120
|
display: "flex",
|
|
118
121
|
alignItems: "center",
|
|
@@ -124,31 +127,31 @@ const MapLegend = ({
|
|
|
124
127
|
opacity: disabled ? '0.5' : 1
|
|
125
128
|
},
|
|
126
129
|
justifyContent: 'space-between',
|
|
127
|
-
children: [/*#__PURE__*/
|
|
130
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
128
131
|
display: "flex",
|
|
129
132
|
alignItems: "center",
|
|
130
133
|
paddingRight: theme.spacing(1),
|
|
131
|
-
children: [logoComponent(), /*#__PURE__*/
|
|
134
|
+
children: [logoComponent(), /*#__PURE__*/jsx(Typography, {
|
|
132
135
|
fontSize: "14px",
|
|
133
136
|
fontWeight: 400,
|
|
134
137
|
children: item.label
|
|
135
138
|
})]
|
|
136
|
-
}), /*#__PURE__*/
|
|
139
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
137
140
|
display: "flex",
|
|
138
141
|
children: visibleComponent()
|
|
139
142
|
})]
|
|
140
143
|
}, `${index}-${itemIndex}`);
|
|
141
144
|
});
|
|
142
|
-
return /*#__PURE__*/
|
|
145
|
+
return /*#__PURE__*/jsx(Box, {
|
|
143
146
|
sx: {
|
|
144
147
|
opacity: legend.disabled ? 0.7 : 1
|
|
145
148
|
},
|
|
146
149
|
borderBottom: isLast ? 'none' : `1px solid ${theme.palette.TwClrBrdrTertiary}`,
|
|
147
|
-
children: /*#__PURE__*/
|
|
150
|
+
children: /*#__PURE__*/jsxs(Box, {
|
|
148
151
|
paddingBottom: 2,
|
|
149
152
|
paddingTop: isFirst ? 0 : 2,
|
|
150
153
|
flexDirection: 'column',
|
|
151
|
-
children: [/*#__PURE__*/
|
|
154
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
152
155
|
display: "flex",
|
|
153
156
|
alignItems: 'center',
|
|
154
157
|
paddingLeft: theme.spacing(1),
|
|
@@ -157,7 +160,7 @@ const MapLegend = ({
|
|
|
157
160
|
})
|
|
158
161
|
}, legend.title);
|
|
159
162
|
});
|
|
160
|
-
return /*#__PURE__*/
|
|
163
|
+
return /*#__PURE__*/jsx(Box, {
|
|
161
164
|
bgcolor: theme.palette.TwClrBaseWhite,
|
|
162
165
|
display: "flex",
|
|
163
166
|
justifyItems: "flex-start",
|
|
@@ -171,4 +174,5 @@ const MapLegend = ({
|
|
|
171
174
|
children: legendComponents
|
|
172
175
|
});
|
|
173
176
|
};
|
|
174
|
-
|
|
177
|
+
|
|
178
|
+
export { MapLegend as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import PopoverMenu from '../PopoverMenu';
|
|
4
|
-
import { MapViewStyles } from './types';
|
|
5
|
-
import { jsx
|
|
1
|
+
import { useMemo, useCallback } from 'react';
|
|
2
|
+
import { useTheme, Box } from '@mui/material';
|
|
3
|
+
import PopoverMenu from '../PopoverMenu/index.js';
|
|
4
|
+
import { MapViewStyles } from './types.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
6
7
|
const MapViewStyleControl = ({
|
|
7
8
|
containerId,
|
|
8
9
|
mapViewStyle,
|
|
@@ -24,7 +25,7 @@ const MapViewStyleControl = ({
|
|
|
24
25
|
return document.getElementById(containerId);
|
|
25
26
|
}
|
|
26
27
|
}, [containerId]);
|
|
27
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/jsx(Box, {
|
|
28
29
|
sx: {
|
|
29
30
|
position: 'absolute',
|
|
30
31
|
top: '10px',
|
|
@@ -45,8 +46,8 @@ const MapViewStyleControl = ({
|
|
|
45
46
|
marginLeft: 0
|
|
46
47
|
}
|
|
47
48
|
},
|
|
48
|
-
children: /*#__PURE__*/
|
|
49
|
-
anchor: /*#__PURE__*/
|
|
49
|
+
children: /*#__PURE__*/jsx(PopoverMenu, {
|
|
50
|
+
anchor: /*#__PURE__*/jsx(Box, {
|
|
50
51
|
component: "span",
|
|
51
52
|
sx: {
|
|
52
53
|
fontSize: '12px',
|
|
@@ -61,4 +62,5 @@ const MapViewStyleControl = ({
|
|
|
61
62
|
})
|
|
62
63
|
});
|
|
63
64
|
};
|
|
64
|
-
|
|
65
|
+
|
|
66
|
+
export { MapViewStyleControl as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import ReactMapbox from 'react-map-gl/mapbox';
|
|
2
|
-
export default
|
|
2
|
+
export { default } from 'react-map-gl/mapbox';
|
package/components/Map/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import MapBox from './MapBox';
|
|
3
|
-
import MapContainer from './MapContainer';
|
|
4
|
-
import MapDrawer from './MapDrawer';
|
|
5
|
-
import MapLegend from './MapLegend';
|
|
6
|
-
import { jsx
|
|
1
|
+
import { useState, useCallback, useMemo } from 'react';
|
|
2
|
+
import MapBox from './MapBox.js';
|
|
3
|
+
import MapContainer from './MapContainer.js';
|
|
4
|
+
import MapDrawer from './MapDrawer.js';
|
|
5
|
+
import MapLegend from './MapLegend.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
7
8
|
const MapComponent = props => {
|
|
8
9
|
const {
|
|
9
10
|
clusterRadius,
|
|
@@ -138,9 +139,9 @@ const MapComponent = props => {
|
|
|
138
139
|
highlightImageUrls.forEach(url => imageUrls.add(url));
|
|
139
140
|
return Array.from(imageUrls);
|
|
140
141
|
}, [features]);
|
|
141
|
-
return /*#__PURE__*/
|
|
142
|
+
return /*#__PURE__*/jsx(MapContainer, {
|
|
142
143
|
containerId: mapContainerId ?? 'map-container',
|
|
143
|
-
map: /*#__PURE__*/
|
|
144
|
+
map: /*#__PURE__*/jsx(MapBox, {
|
|
144
145
|
clusterRadius: clusterRadius,
|
|
145
146
|
containerId: mapContainerId ?? 'map-container',
|
|
146
147
|
controlBottomLeft: controlBottomLeft,
|
|
@@ -164,7 +165,7 @@ const MapComponent = props => {
|
|
|
164
165
|
setMapViewStyle: setMapViewStyle,
|
|
165
166
|
token: token
|
|
166
167
|
}),
|
|
167
|
-
drawer: /*#__PURE__*/
|
|
168
|
+
drawer: /*#__PURE__*/jsx(MapDrawer, {
|
|
168
169
|
open: drawerOpen ?? false,
|
|
169
170
|
onClose: () => setDrawerOpen?.(false),
|
|
170
171
|
size: drawerSize ?? 'small',
|
|
@@ -172,9 +173,10 @@ const MapComponent = props => {
|
|
|
172
173
|
children: drawerChildren
|
|
173
174
|
}),
|
|
174
175
|
drawerOpen: drawerOpen,
|
|
175
|
-
legend: !hideLegend && legends && /*#__PURE__*/
|
|
176
|
+
legend: !hideLegend && legends && /*#__PURE__*/jsx(MapLegend, {
|
|
176
177
|
legends: legends
|
|
177
178
|
})
|
|
178
179
|
});
|
|
179
180
|
};
|
|
180
|
-
|
|
181
|
+
|
|
182
|
+
export { MapComponent as default };
|
package/components/Map/types.js
CHANGED
|
@@ -8,11 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
// Additional shading/annotations for map entities
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const MapViewStyles = ['Outdoors', 'Satellite', 'Light', 'Dark', 'Streets'];
|
|
12
|
+
const stylesUrl = {
|
|
13
13
|
Outdoors: 'mapbox://styles/mapbox/outdoors-v12?optimize=true',
|
|
14
14
|
Satellite: 'mapbox://styles/mapbox/satellite-streets-v12?optimize=true',
|
|
15
15
|
Streets: 'mapbox://styles/mapbox/streets-v12?optimize=true',
|
|
16
16
|
Light: 'mapbox://styles/mapbox/light-v11?optimize=true',
|
|
17
17
|
Dark: 'mapbox://styles/mapbox/dark-v11?optimize=true'
|
|
18
|
-
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { MapViewStyles, stylesUrl };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Ensures that all given layers maintain strict order in the Mapbox layer stack.
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
+
const useMaintainLayerOrder = (mapRef, orderedLayerIds) => {
|
|
6
7
|
useEffect(() => {
|
|
7
8
|
const map = mapRef.current;
|
|
8
9
|
if (!map) {
|
|
@@ -22,4 +23,6 @@ export const useMaintainLayerOrder = (mapRef, orderedLayerIds) => {
|
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
}, [mapRef, orderedLayerIds]);
|
|
25
|
-
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { useMaintainLayerOrder };
|