@m4l/components 1.0.11 → 1.0.13
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/components/AccountPopover/{index.62b1290b.js → index.f22ad364.js} +4 -4
- package/components/AppBar/{index.b48343d8.js → index.8d90ce87.js} +4 -4
- package/components/CommonActions/components/ActionCancel/index.609a78ca.js +12 -0
- package/components/CommonActions/components/ActionFormCancel/index.a1318eac.js +56 -0
- package/components/CommonActions/components/ActionFormIntro/index.34d569d1.js +33 -0
- package/components/CommonActions/components/ActionIntro/index.ebac0bc1.js +25 -0
- package/components/CommonActions/components/Actions/index.258bf919.js +71 -0
- package/components/DataGrid/constants.e334cd50.js +10 -0
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index.7fb1ebaa.js +26 -0
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index.0ee10612.js +22 -0
- package/components/DataGrid/formatters/ColumnDateFormatter/index.e00d0cf2.js +19 -0
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index.dce9ada8.js +23 -0
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/index.880e743b.js +14 -0
- package/components/DataGrid/formatters/ColumnPointsFormatter/index.226cc583.js +10 -0
- package/components/DataGrid/formatters/ColumnPriceFormatter/index.bf9d9e60.js +10 -0
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/index.4045b2f2.js +36 -0
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index.a87302d1.js +10 -0
- package/components/DataGrid/formatters/index.2c2f0ae4.js +1 -0
- package/components/DataGrid/index.68e19254.js +915 -0
- package/components/DataGrid/subcomponents/Actions/index.6b044e84.js +596 -0
- package/components/DataGrid/subcomponents/editors/TextEditor/index.3f0d9e28.js +76 -0
- package/components/DragResizeWindow/{index.8b3e79f7.js → index.a358789f.js} +6 -3
- package/components/DynamicFilter/constants.1dddd09c.js +31 -0
- package/components/DynamicFilter/dictionary.d28d39ef.js +51 -0
- package/components/DynamicFilter/helpers/{index.609b3915.js → index.11ed2896.js} +4 -4
- package/components/DynamicFilter/{index.0f04f223.js → index.056a99c7.js} +3 -3
- package/components/DynamicFilter/slots/{index.00b68384.js → index.82d7eaf2.js} +31 -31
- package/components/DynamicFilter/store/{index.85a2812f.js → index.9b5121d6.js} +2 -2
- package/components/DynamicFilter/subcomponents/{index.86c6fda2.js → index.778c93cc.js} +217 -15
- package/components/FieldLabel/{index.1577ac9c.js → index.6b6f708e.js} +4 -4
- package/components/GridLayout/{index.656840a5.js → index.68d907d4.js} +34 -11
- package/components/GridLayout/subcomponents/Griditem/{index.b23625d7.js → index.8955a794.js} +3 -4
- package/components/GridLayout/subcomponents/Responsive/{index.97505a31.js → index.45cecca2.js} +1 -2
- package/components/GridLayout/subcomponents/SizeProvider/{index.36cb4139.js → index.7050ac4f.js} +1 -1
- package/components/HelperText/{index.ebb53dac.js → index.09e80920.js} +1 -1
- package/components/Icon/{index.8ecfb193.js → index.83867398.js} +10 -26
- package/components/Image/{index.4a822ede.js → index.19aa7ff5.js} +3 -2
- package/components/LanguagePopover/index.921efd11.js +188 -0
- package/components/{mui_extended/LinearProgress/index.e9455b2e.js → LinearProgressIndeterminate/index.ea9c8518.js} +4 -9
- package/components/LoadingError/{index.9e829e8d.js → index.aee18b24.js} +11 -7
- package/components/MFLoader/{index.29f445e2.js → index.c975666e.js} +8 -4
- package/components/ModalDialog/{index.96c4aba3.js → index.0dd5af28.js} +14 -5
- package/components/NavLink/{index.9f5d5670.js → index.ad039baf.js} +3 -2
- package/components/NoItemSelected/{index.0ae9f28f.js → index.d10603d7.js} +13 -3
- package/components/ObjectLogs/{index.40c5047f.js → index.a3e42b21.js} +26 -8
- package/components/PDFViewer/{index.651cc4b6.js → index.35f68e67.js} +2 -2
- package/components/Page/{index.1d08818c.js → index.f4755eba.js} +18 -2
- package/components/PaperForm/{index.1a8b10d4.js → index.007ef4cf.js} +2 -2
- package/components/Period/{index.236971ae.js → index.9647181b.js} +15 -54
- package/components/PrintingSystem/{index.9fdae551.js → index.a69a9d85.js} +14 -15
- package/components/PrintingSystem/subcomponents/BodyNode/{index.794dbc69.js → index.528fcfbf.js} +1 -1
- package/components/PrintingSystem/subcomponents/ChartNode/{index.6bbf7d75.js → index.fbe87257.js} +1 -1
- package/components/PrintingSystem/subcomponents/DividerNode/{index.015a2212.js → index.f5adab1d.js} +1 -1
- package/components/PrintingSystem/subcomponents/FooterNode/{index.08eeb1d2.js → index.f42ca7dc.js} +1 -1
- package/components/PrintingSystem/subcomponents/GridNode/{index.23995699.js → index.041b9cff.js} +1 -1
- package/components/PrintingSystem/subcomponents/HeaderNode/{index.3fa36620.js → index.a8140332.js} +1 -1
- package/components/PrintingSystem/subcomponents/PaperNode/{index.8b7d43f4.js → index.aabde2bb.js} +1 -1
- package/components/PrintingSystem/subcomponents/PropertyValueNode/{index.9856c572.js → index.7f75ca46.js} +1 -1
- package/components/PrintingSystem/subcomponents/SectionNode/{index.89b3a4e0.js → index.61babb47.js} +1 -1
- package/components/PrintingSystem/subcomponents/TextBoxNode/{index.dc6e9dc2.js → index.4d0e67a3.js} +1 -1
- package/components/PropertyValue/{index.646a7e8b.js → index.51faabb5.js} +7 -4
- package/components/Resizeable/{index.414ff687.js → index.4f75c0b5.js} +1 -1
- package/components/ScrollBar/{index.1e89bb44.js → index.21bc5025.js} +1 -1
- package/components/SideBar/{index.d221254d.js → index.4075c562.js} +36 -7
- package/components/SplitLayout/{index.7d9edf4e.js → index.15756f0f.js} +3 -1
- package/components/ToastContainer/{index.7f246bbd.js → index.2a7d304e.js} +3 -3
- package/components/animate/variants/index.7a912140.js +1 -0
- package/components/areas/components/AreasAdmin/index.325bac22.js +733 -0
- package/components/areas/components/AreasViewer/index.6e30ec72.js +1072 -0
- package/components/areas/components/index.558684b3.js +1 -0
- package/components/areas/constants.66529246.js +6 -0
- package/components/areas/contexts/AreasContext/{index.0815f278.js → index.3311cbf9.js} +6 -5
- package/components/areas/contexts/DynamicMFParmsContext/{index.37d1d444.js → index.3d9ad0ad.js} +2 -2
- package/components/areas/contexts/WindowToolsMFContext/{index.69d95c15.js → index.992ae7a3.js} +2 -2
- package/components/areas/contexts/index.24025b97.js +1 -0
- package/components/areas/dictionary.08cfc4c9.js +36 -0
- package/components/areas/hooks/index.d9dc1e21.js +1 -0
- package/components/areas/hooks/useAreas/{index.4039e30d.js → index.f81493ef.js} +1 -1
- package/components/areas/hooks/useDynamicMFParameters/{index.03ce6078.js → index.9e09e1e3.js} +1 -1
- package/components/areas/hooks/useWindowToolsMF/{index.09801b66.js → index.2fbae9dc.js} +1 -1
- package/components/areas/icons.8266ccc8.js +26 -0
- package/components/areas/index.4cc6a221.js +22 -0
- package/components/commercial/AppBarCommercial/index.cbd55cf8.js +28 -0
- package/components/commercial/SectionCommercial/index.d22ebbd5.js +57 -0
- package/components/commercial/TopBar/index.410fffa8.js +234 -0
- package/components/{HamburgerMenu/index.6c82741d.js → commercial/index.07638f52.js} +5 -3
- package/components/formatters/BooleanFormatter/index.cbf9cd6e.js +44 -0
- package/components/formatters/DateFormatter/index.2ef6f261.js +43 -0
- package/components/formatters/PointsFormatter/index.d8a4ee54.js +25 -0
- package/components/formatters/PriceFormatter/index.97f75b4b.js +35 -0
- package/components/formatters/UncertaintyFormatter/index.c3ffdebc.js +29 -0
- package/components/formatters/index.63a3e08e.js +117 -0
- package/components/hook-form/HelperError/{index.2ed03a3c.js → index.c0109d5b.js} +1 -1
- package/components/hook-form/RHFAutocomplete/index.2991d444.js +404 -0
- package/components/hook-form/RHFAutocompleteAsync/{index.69f5661d.js → index.d97c727b.js} +2 -3
- package/components/hook-form/RHFCheckbox/{index.13de27db.js → index.b57e3131.js} +4 -4
- package/components/hook-form/RHFColorPicker/{index.66004599.js → index.310f6ff0.js} +6 -6
- package/components/hook-form/RHFDateTime/{index.dfe07e18.js → index.5689a29f.js} +5 -5
- package/components/hook-form/RHFPeriod/{index.d852649b.js → index.019e61ae.js} +4 -4
- package/components/hook-form/RHFTextField/{index.d207efc1.js → index.10e57945.js} +6 -6
- package/components/hook-form/RHFUpload/{index.955a4ba5.js → index.7fd23b2a.js} +5 -5
- package/components/{mui_extended/Tab/index.37d588d6.js → maps/components/GpsTools/index.20f83559.js} +331 -645
- package/components/maps/{index.a1bf63f2.js → components/Map/index.c37f3304.js} +737 -28
- package/components/maps/index.13bb982c.js +7 -0
- package/components/modal/{WindowBase.390b0910.js → WindowBase.cfbb0c9e.js} +4 -4
- package/components/modal/{WindowConfirm.243e1bef.js → WindowConfirm.300bd34b.js} +10 -6
- package/components/modal/{index.5bce430d.js → index.81eb6def.js} +5 -1
- package/components/mui_extended/Accordion/{index.f7a17c83.js → index.0843a609.js} +5 -5
- package/components/mui_extended/Avatar/{index.12b96914.js → index.fb9ad158.js} +1 -1
- package/components/mui_extended/Badge/{index.4737c113.js → index.8beaeefc.js} +1 -1
- package/components/mui_extended/Button/{index.52852c42.js → index.d742e9ee.js} +6 -81
- package/components/mui_extended/{CheckBox/index.01218423.js → CheckBox.21c25705.js} +1 -1
- package/components/mui_extended/IconButton/{index.d5b273e6.js → index.b4532b85.js} +1 -1
- package/components/mui_extended/LinearProgress/index.4092bb69.js +9 -0
- package/components/mui_extended/MenuActions/index.eae97857.js +176 -0
- package/components/mui_extended/Pager/{index.8960227c.js → index.3926c835.js} +22 -40
- package/components/mui_extended/Popover/index.2348fc4f.js +143 -0
- package/components/mui_extended/Tab/index.e911930f.js +135 -0
- package/components/mui_extended/ToggleButton/{index.c441b949.js → index.b834f5f0.js} +1 -1
- package/components/mui_extended/ToggleIconButton/{index.8a84f25e.js → index.fcd5205c.js} +1 -1
- package/components/mui_extended/Typography/{index.463f613f.js → index.642798f1.js} +1 -1
- package/components/mui_extended/index.b606cd9d.js +1 -0
- package/components/popups/PopupsProvider/{index.d4caacc3.js → index.d7c9efce.js} +1 -1
- package/components/popups/PopupsViewer/{index.42312806.js → index.f3677ab1.js} +10 -6
- package/contexts/ModalContext/{index.5f77a463.js → index.ad1fb73b.js} +1 -1
- package/contexts/RHFormContext/{index.95ebabc9.js → index.bf3a2812.js} +6 -2
- package/hooks/useFormAddEdit/{index.ecb77e67.js → index.6d983cd8.js} +6 -2
- package/hooks/useModal/index.2003c854.js +11 -0
- package/hooks/useTab/index.8d1a6e63.js +12 -0
- package/index.js +328 -273
- package/package.json +1 -1
- package/{react-draggable.0cc9b257.js → react-draggable.1c1ba224.js} +1 -1
- package/{react-resizable.837c446d.js → react-resizable.a59c14f4.js} +2 -2
- package/test/constants_no_mock.86c553a9.js +4 -0
- package/test/{getNameDataTestId.aee44365.js → getNameDataTestId.0faeade8.js} +2 -2
- package/utils/{index.c64c2dd1.js → index.14912462.js} +1 -54
- package/components/CommonActions/index.19f39dca.js +0 -170
- package/components/areas/constants.0d3ba950.js +0 -289
- package/components/areas/dictionary.6168209a.js +0 -266
- package/components/areas/icons.504ec098.js +0 -83
- package/components/maps/components/GpsTools/index.01acaf3e.js +0 -251
- package/components/mui_extended/Popover/index.146ded9e.js +0 -1044
- package/hooks/useModal/index.d14c7e46.js +0 -67
- package/vendor.5b266106.js +0 -3952
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import React__default, { createContext, useRef, useEffect, useContext, useMemo, useState, useCallback } from "react";
|
|
2
|
-
import { useMap, LayerGroup, MapContainer, Marker, Polyline, Circle, Polygon } from "react-leaflet";
|
|
3
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useMap, LayerGroup, MapContainer, Marker, Polyline, Circle, Polygon } from "react-leaflet";
|
|
4
3
|
import { shallow } from "zustand/shallow";
|
|
4
|
+
import React__default, { createContext, useRef, useEffect, useContext, useMemo, useState, useCallback } from "react";
|
|
5
5
|
import * as L from "leaflet";
|
|
6
6
|
import L__default from "leaflet";
|
|
7
7
|
import { Loader } from "@googlemaps/js-api-loader";
|
|
8
8
|
import { createPortal } from "react-dom";
|
|
9
|
-
import { useModuleDictionary, useModuleSkeleton, useEnvironment } from "@m4l/core";
|
|
9
|
+
import { useModuleDictionary, useModuleSkeleton, useEnvironment, useModulePrivileges } from "@m4l/core";
|
|
10
10
|
import clsx from "clsx";
|
|
11
11
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { B as Button, Z as ZoomButtons } from "../mui_extended/Button/index.52852c42.js";
|
|
12
|
+
import { A as Actions } from "../../../CommonActions/components/Actions/index.258bf919.js";
|
|
13
|
+
import { B as Button } from "../../../mui_extended/Button/index.d742e9ee.js";
|
|
15
14
|
import * as Yup from "yup";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
15
|
+
import { u as useFormReadyForUpdate } from "../../../../hooks/useFormReadyForUpdate/index.f60f500e.js";
|
|
16
|
+
import { R as RHFAutocompleteAsync } from "../../../hook-form/RHFAutocompleteAsync/index.d97c727b.js";
|
|
17
|
+
import { S as Stack } from "../../../mui_extended/Stack/index.fe363ca5.js";
|
|
18
|
+
import { R as RHFormProvider } from "../../../../contexts/RHFormContext/index.bf3a2812.js";
|
|
19
|
+
import { I as IconButton } from "../../../mui_extended/IconButton/index.b4532b85.js";
|
|
20
|
+
import { u as usePopupsStore, P as PopupsProvider } from "../../../popups/PopupsProvider/index.d7c9efce.js";
|
|
21
|
+
import { T as ToggleIconButton } from "../../../mui_extended/ToggleIconButton/index.fcd5205c.js";
|
|
22
|
+
import { c as DataGrid } from "../../../DataGrid/index.68e19254.js";
|
|
23
|
+
import { generateUtilityClasses, Tooltip, FormControl, RadioGroup, FormControlLabel, Radio, useTheme } from "@mui/material";
|
|
24
|
+
import { C as ColumnSetCheckFormatter } from "../../../DataGrid/formatters/ColumnSetCheckFormatter/index.4045b2f2.js";
|
|
25
|
+
import { I as Icon, M as MarkerIconLabel } from "../../../Icon/index.83867398.js";
|
|
26
|
+
import { u as useStateRef } from "../../../../hooks/useStateRef/index.538edb89.js";
|
|
27
|
+
import { C as CheckBox } from "../../../mui_extended/CheckBox.21c25705.js";
|
|
28
|
+
import { P as Popover } from "../../../mui_extended/Popover/index.2348fc4f.js";
|
|
29
|
+
import { P as PopupsViewer } from "../../../popups/PopupsViewer/index.f3677ab1.js";
|
|
26
30
|
import { createPathComponent } from "@react-leaflet/core";
|
|
27
31
|
import "leaflet.markercluster";
|
|
28
32
|
import { cloneDeep, throttle } from "lodash";
|
|
@@ -32,11 +36,45 @@ import { createStore, useStore } from "zustand";
|
|
|
32
36
|
import { useResponsiveDesktop, useFirstRender } from "@m4l/graphics";
|
|
33
37
|
import { devtools } from "zustand/middleware";
|
|
34
38
|
import { immer } from "zustand/middleware/immer";
|
|
35
|
-
import { generateUtilityClasses } from "@mui/material";
|
|
36
39
|
import { unstable_composeClasses } from "@mui/base";
|
|
37
|
-
import { g as getComponentUtilityClass } from "
|
|
38
|
-
import {
|
|
40
|
+
import { g as getComponentUtilityClass } from "../../../../utils/index.14912462.js";
|
|
41
|
+
import { b as bearingRawToCSS } from "../../index.13bb982c.js";
|
|
39
42
|
import "leaflet-polylinedecorator";
|
|
43
|
+
const COMPONENT_CLASS_NAME = "M4LMap";
|
|
44
|
+
const MAP_ZINDEX_DEFAULT = 0;
|
|
45
|
+
const MAP_ZINDEX_OVER_MAP = 1100;
|
|
46
|
+
const TIME_DOUBLE_CLICK = 250;
|
|
47
|
+
const MARKER_COLOR_DEFAULT = "#1E96DC";
|
|
48
|
+
const LABEL_BK_COLOR_DEFAULT = "#1E96DC";
|
|
49
|
+
const LABEL_COLOR_DEFAULT = "#FFFFFF";
|
|
50
|
+
const GPS_TOOLS_POPUP_DEFAULT_POSITION = {
|
|
51
|
+
vertical: { top: 50, bottom: 50 },
|
|
52
|
+
horizontal: { right: 50, width: 380 }
|
|
53
|
+
};
|
|
54
|
+
const MESURE_POPUP_DEFAULT_POSITION = {
|
|
55
|
+
vertical: { top: 50, height: 250 },
|
|
56
|
+
horizontal: { right: 50, width: 300 }
|
|
57
|
+
};
|
|
58
|
+
const SVG_ICON_DEFAULT = `<svg viewBox="0 0 640 640" height="32" width="32" xmlns="http://www.w3.org/2000/svg">
|
|
59
|
+
<g>
|
|
60
|
+
<circle
|
|
61
|
+
cx="320"
|
|
62
|
+
cy="320"
|
|
63
|
+
r="280"
|
|
64
|
+
fill="#1E96DC"
|
|
65
|
+
/>
|
|
66
|
+
<text
|
|
67
|
+
x="320"
|
|
68
|
+
y="320"
|
|
69
|
+
font-size="320"
|
|
70
|
+
font-family="sans-serif"
|
|
71
|
+
fill="#FFFFFF"
|
|
72
|
+
text-anchor="middle"
|
|
73
|
+
alignment-baseline="central"
|
|
74
|
+
dominant-baseline="central"
|
|
75
|
+
>P</text>
|
|
76
|
+
</g>
|
|
77
|
+
</svg>`;
|
|
40
78
|
const updateOwnerStateClasses = (_state) => {
|
|
41
79
|
};
|
|
42
80
|
const mapClasses = generateUtilityClasses(COMPONENT_CLASS_NAME, [
|
|
@@ -114,6 +152,245 @@ const useMapUtilityClasses = (_ownerState) => {
|
|
|
114
152
|
};
|
|
115
153
|
return unstable_composeClasses(slots, getComponentUtilityClass(COMPONENT_CLASS_NAME), {});
|
|
116
154
|
};
|
|
155
|
+
const MAP_DICCTIONARY = {
|
|
156
|
+
LABEL_GPSTOOLS_NAME: "label_gpstools_name",
|
|
157
|
+
LABEL_TAB_GEO: "label_tab_geo",
|
|
158
|
+
TAB_GENERAL_CONFIG_TOOLTIP: "tab_general_config_tooltip",
|
|
159
|
+
PAPER_GENERAL: "paper_general",
|
|
160
|
+
LABEL_ID: "label_id",
|
|
161
|
+
LABEL_NAME: "label_name",
|
|
162
|
+
LABEL_GEOMETRY_TYPE: "label_geometry_type",
|
|
163
|
+
LABEL_GEOMETRY_CIRCLE: "label_geometry_circle",
|
|
164
|
+
LABEL_GEOMETRY_RECTANGLE: "label_geometry_rectangle",
|
|
165
|
+
LABEL_GEOMETRY_POLYGON: "label_geometry_polygon",
|
|
166
|
+
LABEL_DRAW: "label_draw",
|
|
167
|
+
LABEL_FINISH: "label_finish",
|
|
168
|
+
PAPER_CONFIG: "paper_config",
|
|
169
|
+
LABEL_ALIAS: "label_alias",
|
|
170
|
+
LABEL_CUSTOMER_ID: "label_customer_id",
|
|
171
|
+
LABEL_TIME_MIN_IN_SECONDS: "label_time_min_in_seconds",
|
|
172
|
+
LABEL_TIME_MIN_OUT_SECONDS: "label_time_min_out_seconds",
|
|
173
|
+
TAB_STYLE_CONFIG_TOOLTIP: "tab_style_tooltip",
|
|
174
|
+
PAPER_STROKE: "paper_stroke",
|
|
175
|
+
LABEL_COLOR: "label_color",
|
|
176
|
+
LABEL_OPACITY: "label_opacity",
|
|
177
|
+
LABEL_WEIGHT: "label_weight",
|
|
178
|
+
LABEL_DASH_ARRAY: "label_dash_array",
|
|
179
|
+
LABEL_DASH_OFFSET: "label_dash_offset",
|
|
180
|
+
LABEL_RADIUS: "label_radius",
|
|
181
|
+
LABEL_LAT: "label_lat",
|
|
182
|
+
LABEL_LON: "label_lon",
|
|
183
|
+
LABEL_PLACE_MARKER: "label_place_marker",
|
|
184
|
+
LABEL_FIRST_VERTEX: "label_first_vertex",
|
|
185
|
+
LABEL_CONTINUE_LINE: "label_continue_line",
|
|
186
|
+
LABEL_FINISH_LINE: "label_finish_line",
|
|
187
|
+
LABEL_FINISH_POLY: "label_finish_poly",
|
|
188
|
+
LABEL_FINISH_RECT: "label_finish_rect",
|
|
189
|
+
LABEL_START_CIRCLE: "label_start_circle",
|
|
190
|
+
LABEL_FINISH_CIRCLE: "label_finish_circle",
|
|
191
|
+
LABEL_PLACE_CIRCLE_MARKER: "label_place_circle_marker",
|
|
192
|
+
VALIDATION_GEOMETRY_REQUIRED: "validation_geometry_required",
|
|
193
|
+
VALIDATION_FIELD_REQUIRED: "validation_field_required",
|
|
194
|
+
VALIDATION_FIELD_TYPE_NUMBER_ERROR: "validation_field_type_number_error",
|
|
195
|
+
LABEL_VIEW_TRANSIT_FEATURES: "label_view_crossing_features",
|
|
196
|
+
LABEL_VIEW_INTERNAL_FEATURES: "label_view_internal_features",
|
|
197
|
+
LABEL_CREATED_AT: "label_created_at",
|
|
198
|
+
LABEL_UPDATED_AT: "label_updated_at",
|
|
199
|
+
MODAL_DELETE_GEO_TITLE: "modal_delete_geo_title",
|
|
200
|
+
MODAL_DELETE_GEO_MESSAGE: "modal_delete_geo_message",
|
|
201
|
+
MODAL_DISABLE_GEO_TITLE: "modal_disable_geo_title",
|
|
202
|
+
MODAL_DISABLE_MESSAGE: "modal_disable_geo_message",
|
|
203
|
+
ROW_ACTION_GEO_EDIT: "row_action_geo_edit",
|
|
204
|
+
ROW_ACTION_GEO_ENABLE: "row_action_geo_enable",
|
|
205
|
+
ROW_ACTION_GEO_DISABLE: "row_action_geo_disable",
|
|
206
|
+
ROW_ACTION_GEO_DELETE: "row_action_geo_delete",
|
|
207
|
+
LABEL_TAB_MEASURE: "label_tab_measure",
|
|
208
|
+
PAPER_MEASURE: "paper_measure",
|
|
209
|
+
LABEL_MEASURE_START: "label_measure_start",
|
|
210
|
+
LABEL_MEASURE_CANCEL: "label_measure_cancel",
|
|
211
|
+
LABEL_MEASURE_DISTANCE: "label_measure_distance",
|
|
212
|
+
LABEL_MEASURE_AREA: "label_measure_area",
|
|
213
|
+
LABEL_MEASURE_UNIT: "label_measure_unit",
|
|
214
|
+
LABEL_MEASURE_UNIT_BASE_KILOMETERS: "label_measure_unit_base_kilometers",
|
|
215
|
+
LABEL_MEASURE_REMOVE_POINT: "label_measure_remove_point",
|
|
216
|
+
LABEL_LAYERS: "label_layes",
|
|
217
|
+
LABEL_LAYER_NAME: "label_layer_name",
|
|
218
|
+
LABEL_LAYER_VISIBLE: "label_layer_visible",
|
|
219
|
+
LABEL_LAYER_AUTOFOCUS: "label_layer_autofocus",
|
|
220
|
+
LABEL_LAYER_CLUSTER: "label_layer_cluster",
|
|
221
|
+
LABEL_LAYER_DELETE: "label_layer_delete",
|
|
222
|
+
ROW_ACTION_LAYER_DELETE: "row_action_layer_delete",
|
|
223
|
+
LABEL_MAP_SOURCES: "label_map_sources",
|
|
224
|
+
LABEL_TILE_OSM: "label_tile_osm",
|
|
225
|
+
LABEL_TILE_GOOGLE: "label_tile_google",
|
|
226
|
+
LABEL_TILE_GOOGLE_SATELLITE: "label_tile_google_satellite",
|
|
227
|
+
LABEL_TILE_GOOGLE_HYBRID: "label_tile_google_hybrid",
|
|
228
|
+
LABEL_TILE_BING: "label_tile_bing"
|
|
229
|
+
};
|
|
230
|
+
const MAP_ICONS = {
|
|
231
|
+
MAP_ZOOM_IN: "cmp_map_zoom_in.svg",
|
|
232
|
+
MAP_ZOOM_OUT: "cmp_map_zoom_out.svg",
|
|
233
|
+
MAP_SOURCES_TOOL: "cmp_map_mapsources_tool.svg",
|
|
234
|
+
MAP_SOURCE_OSM: "cmp_map_mapsources_osm.svg",
|
|
235
|
+
MAP_SOURCE_GOOGLE_ROADS: "cmp_map_mapsources_google.svg",
|
|
236
|
+
MAP_SOURCE_GOOGLE_HYBRID: "cmp_map_mapsources_googlehybrid.svg",
|
|
237
|
+
MAP_SOURCE_GOOGLE_SATELLITE: "cmp_map_mapsources_googlesatelite.svg",
|
|
238
|
+
MAP_SOURCE_BING: "cmp_map_mapsources_ bing.svg",
|
|
239
|
+
MAP_SOURCE_ROAD_TRAFFIC: "cmp_map_mapsources_layer-traffic.svg",
|
|
240
|
+
MAP_SOURCE_ROAD_TRANSIT: "cmp_map_mapsources_layer-transit.svg",
|
|
241
|
+
MAP_SOURCE_ROAD_BICYCLING: "cmp_map_mapsources_layer-bicycle.svg",
|
|
242
|
+
MAP_LAYERS_TOOL: "cmp_map_layers_tool.svg",
|
|
243
|
+
MAP_LAYER_VISIBLE: "cmp_map_layers_view.svg",
|
|
244
|
+
MAP_LAYER_AUTOFOCUS: "cmp_map_layers_zoom_fit.svg",
|
|
245
|
+
MAP_LAYER_CLUSTER: "cmp_map_layers_cluster.svg",
|
|
246
|
+
MAP_LAYER_DELETE: "cmp_map_layers_delete.svg",
|
|
247
|
+
MAP_GPS_TOOLS_TOOL: "cmp_map_gpstools_tool.svg",
|
|
248
|
+
GEOMETRY_CIRCLE: "geometry_circle.svg",
|
|
249
|
+
GEOMETRY_RECTANGLE: "geometry_rectangle.svg",
|
|
250
|
+
GEOMETRY_POLYGON: "geometry_polygon.svg",
|
|
251
|
+
ADD: "add.svg",
|
|
252
|
+
MAP_MEASURE_TOOL: "cmp_map_measure_tool.svg",
|
|
253
|
+
GENERAL: "general.svg",
|
|
254
|
+
CONFIG: "config.svg",
|
|
255
|
+
STROKE: "stroke.svg",
|
|
256
|
+
FILL: "fill.svg",
|
|
257
|
+
EDIT: "edit.svg",
|
|
258
|
+
DELETE: "delete.svg",
|
|
259
|
+
ACTIVE: "active.svg",
|
|
260
|
+
NAME: "name.svg"
|
|
261
|
+
};
|
|
262
|
+
const TILE_LAYER_OSM = {
|
|
263
|
+
id: "osm_roadmap",
|
|
264
|
+
sourceType: "OSM",
|
|
265
|
+
iconUrl: MAP_ICONS.MAP_SOURCE_OSM,
|
|
266
|
+
mapTypeTile: "roadmap",
|
|
267
|
+
dictionaryId: MAP_DICCTIONARY.LABEL_TILE_OSM,
|
|
268
|
+
urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
|
|
269
|
+
options: {
|
|
270
|
+
minZoom: 0,
|
|
271
|
+
maxZoom: 19,
|
|
272
|
+
subdomains: ["a", "b", "c"],
|
|
273
|
+
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a>',
|
|
274
|
+
tms: false
|
|
275
|
+
},
|
|
276
|
+
roadSelectedOptions: {
|
|
277
|
+
trafficLayer: false,
|
|
278
|
+
transitLayer: false,
|
|
279
|
+
bicyclingLayer: false
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
const TILE_LAYER_GOOGLE = {
|
|
283
|
+
id: "google_rodmap",
|
|
284
|
+
sourceType: "Google",
|
|
285
|
+
iconUrl: MAP_ICONS.MAP_SOURCE_GOOGLE_ROADS,
|
|
286
|
+
mapTypeTile: "roadmap",
|
|
287
|
+
dictionaryId: MAP_DICCTIONARY.LABEL_TILE_GOOGLE,
|
|
288
|
+
urlTemplate: "http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&key=AIzaSyDfhTK9us4kuqPTeFIm89yB3uvk2_G5AMw",
|
|
289
|
+
hasBicyclingLayer: true,
|
|
290
|
+
hasTrafficLayer: true,
|
|
291
|
+
hasTransitLayer: true,
|
|
292
|
+
options: {
|
|
293
|
+
minZoom: 0,
|
|
294
|
+
maxZoom: 22,
|
|
295
|
+
subdomains: ["mt0", "mt1", "mt2", "mt3"],
|
|
296
|
+
attribution: "Map data \xA9 Google",
|
|
297
|
+
tms: false
|
|
298
|
+
},
|
|
299
|
+
roadSelectedOptions: {
|
|
300
|
+
trafficLayer: false,
|
|
301
|
+
transitLayer: false,
|
|
302
|
+
bicyclingLayer: false
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
const TILE_LAYER_GOOGLE_SATELLITE = {
|
|
306
|
+
id: "google_satellite",
|
|
307
|
+
sourceType: "Google",
|
|
308
|
+
iconUrl: MAP_ICONS.MAP_SOURCE_GOOGLE_SATELLITE,
|
|
309
|
+
mapTypeTile: "satellite",
|
|
310
|
+
dictionaryId: MAP_DICCTIONARY.LABEL_TILE_GOOGLE_SATELLITE,
|
|
311
|
+
urlTemplate: "http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}&key=AIzaSyDfhTK9us4kuqPTeFIm89yB3uvk2_G5AMw",
|
|
312
|
+
options: {
|
|
313
|
+
minZoom: 0,
|
|
314
|
+
maxZoom: 22,
|
|
315
|
+
subdomains: ["mt0", "mt1", "mt2", "mt3"],
|
|
316
|
+
attribution: "Map data \xA9 Google",
|
|
317
|
+
tms: false
|
|
318
|
+
},
|
|
319
|
+
roadSelectedOptions: {
|
|
320
|
+
trafficLayer: false,
|
|
321
|
+
transitLayer: false,
|
|
322
|
+
bicyclingLayer: false
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
const TILE_LAYER_GOOGLE_HYBRID = {
|
|
326
|
+
id: "google_hybrid",
|
|
327
|
+
sourceType: "Google",
|
|
328
|
+
iconUrl: MAP_ICONS.MAP_SOURCE_GOOGLE_HYBRID,
|
|
329
|
+
mapTypeTile: "hybrid",
|
|
330
|
+
dictionaryId: MAP_DICCTIONARY.LABEL_TILE_GOOGLE_HYBRID,
|
|
331
|
+
urlTemplate: "http://{s}.google.com/vt/lyrs=y&x={x}&y={y}&z={z}&key=AIzaSyDfhTK9us4kuqPTeFIm89yB3uvk2_G5AMw",
|
|
332
|
+
hasBicyclingLayer: true,
|
|
333
|
+
hasTrafficLayer: true,
|
|
334
|
+
hasTransitLayer: true,
|
|
335
|
+
options: {
|
|
336
|
+
minZoom: 0,
|
|
337
|
+
maxZoom: 22,
|
|
338
|
+
subdomains: ["mt0", "mt1", "mt2", "mt3"],
|
|
339
|
+
attribution: "Map data \xA9 Google",
|
|
340
|
+
tms: false
|
|
341
|
+
},
|
|
342
|
+
roadSelectedOptions: {
|
|
343
|
+
trafficLayer: false,
|
|
344
|
+
transitLayer: false,
|
|
345
|
+
bicyclingLayer: false
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
function toQuadKey(x, y, z) {
|
|
349
|
+
let quadKey = "";
|
|
350
|
+
for (let i = z; i > 0; i--) {
|
|
351
|
+
let digit = 0;
|
|
352
|
+
const mask = 1 << i - 1;
|
|
353
|
+
if ((x & mask) !== 0) {
|
|
354
|
+
digit++;
|
|
355
|
+
}
|
|
356
|
+
if ((y & mask) !== 0) {
|
|
357
|
+
digit++;
|
|
358
|
+
digit++;
|
|
359
|
+
}
|
|
360
|
+
quadKey += digit.toString();
|
|
361
|
+
}
|
|
362
|
+
return quadKey;
|
|
363
|
+
}
|
|
364
|
+
const BING_URL_TEMPLATE = "https://{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/|QK|?mkt=en-us&it=G,VE,BX,L,LA&shading=hill&og=22&n=z";
|
|
365
|
+
const BING_SUB_DOMAINS = ["t2", "t3"];
|
|
366
|
+
const TILE_LAYER_BING = {
|
|
367
|
+
id: "bing_rodmap",
|
|
368
|
+
sourceType: "Bing",
|
|
369
|
+
mapTypeTile: "roadmap",
|
|
370
|
+
dictionaryId: MAP_DICCTIONARY.LABEL_TILE_BING,
|
|
371
|
+
iconUrl: MAP_ICONS.MAP_SOURCE_BING,
|
|
372
|
+
urlTemplate: BING_URL_TEMPLATE,
|
|
373
|
+
options: {
|
|
374
|
+
minZoom: 0,
|
|
375
|
+
maxZoom: 21,
|
|
376
|
+
subdomains: BING_SUB_DOMAINS,
|
|
377
|
+
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a>',
|
|
378
|
+
tms: true
|
|
379
|
+
},
|
|
380
|
+
roadSelectedOptions: {
|
|
381
|
+
trafficLayer: false,
|
|
382
|
+
transitLayer: false,
|
|
383
|
+
bicyclingLayer: false
|
|
384
|
+
},
|
|
385
|
+
getTileUrl: (tileCoord) => {
|
|
386
|
+
const i = Math.abs(tileCoord.x + tileCoord.y) % BING_SUB_DOMAINS.length;
|
|
387
|
+
const z = tileCoord.z;
|
|
388
|
+
const x = tileCoord.x;
|
|
389
|
+
const y = tileCoord.y;
|
|
390
|
+
const gk = toQuadKey(x, y, z);
|
|
391
|
+
return BING_URL_TEMPLATE.replace("|QK|", gk).replace("{s}", BING_SUB_DOMAINS[i]);
|
|
392
|
+
}
|
|
393
|
+
};
|
|
117
394
|
const createMapStore = (initProps) => {
|
|
118
395
|
const startProps = {
|
|
119
396
|
classes: useMapUtilityClasses(initProps.ownerState),
|
|
@@ -572,6 +849,32 @@ function useValidation() {
|
|
|
572
849
|
);
|
|
573
850
|
return { validationSchema };
|
|
574
851
|
}
|
|
852
|
+
const INITIAL_FORM_VALUES = {
|
|
853
|
+
statusLoad: "ready",
|
|
854
|
+
reInits: 0,
|
|
855
|
+
value: "0",
|
|
856
|
+
measureTypeId: "distance",
|
|
857
|
+
magnitudFactor: {
|
|
858
|
+
id: "m_kilometers",
|
|
859
|
+
name: "Kilometers",
|
|
860
|
+
symbol: "k",
|
|
861
|
+
factor_x0: 0,
|
|
862
|
+
factor_x1: 1,
|
|
863
|
+
factor_x2: 0
|
|
864
|
+
},
|
|
865
|
+
unitArea: null,
|
|
866
|
+
statusEdition: "initial"
|
|
867
|
+
};
|
|
868
|
+
const STYLE_MEASURE_OPTIONS = {
|
|
869
|
+
strokeLineColor: "#1E96DC",
|
|
870
|
+
strokeLineWeight: 5,
|
|
871
|
+
markerHeight: 37,
|
|
872
|
+
markerWidth: 26,
|
|
873
|
+
labelMarkerHeight: 0,
|
|
874
|
+
labelMarkerWidth: 0,
|
|
875
|
+
labelMarkerAnchorY: 0,
|
|
876
|
+
labelMarkerAnchorX: 0
|
|
877
|
+
};
|
|
575
878
|
const getMarkerPointIcon = (position) => {
|
|
576
879
|
return L__default.divIcon({
|
|
577
880
|
className: mapClasses.measureMarkerRoot,
|
|
@@ -882,6 +1185,48 @@ function MeasureTool() {
|
|
|
882
1185
|
}
|
|
883
1186
|
);
|
|
884
1187
|
}
|
|
1188
|
+
function ZoomButtons() {
|
|
1189
|
+
const map = useMap();
|
|
1190
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
1191
|
+
const [, setZoomInDisabled] = useState(false);
|
|
1192
|
+
const [, setZoomOutDisabled] = useState(false);
|
|
1193
|
+
useEffect(() => {
|
|
1194
|
+
const updateButtonState = () => {
|
|
1195
|
+
const currentZoom = map.getZoom();
|
|
1196
|
+
const maxZoom = map.getMaxZoom();
|
|
1197
|
+
const minZoom = map.getMinZoom();
|
|
1198
|
+
setZoomInDisabled(currentZoom === maxZoom);
|
|
1199
|
+
setZoomOutDisabled(currentZoom === minZoom);
|
|
1200
|
+
};
|
|
1201
|
+
map.on("zoomend", updateButtonState);
|
|
1202
|
+
updateButtonState();
|
|
1203
|
+
return () => {
|
|
1204
|
+
map.off("zoomend", updateButtonState);
|
|
1205
|
+
};
|
|
1206
|
+
}, [map]);
|
|
1207
|
+
const handleZoomIn = () => {
|
|
1208
|
+
map.zoomIn();
|
|
1209
|
+
};
|
|
1210
|
+
const handleZoomOut = () => {
|
|
1211
|
+
map.zoomOut();
|
|
1212
|
+
};
|
|
1213
|
+
return /* @__PURE__ */ jsxs("div", { className: mapClasses.zoomButtons, children: [
|
|
1214
|
+
/* @__PURE__ */ jsx(
|
|
1215
|
+
IconButton,
|
|
1216
|
+
{
|
|
1217
|
+
onClick: handleZoomIn,
|
|
1218
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_ZOOM_IN}`
|
|
1219
|
+
}
|
|
1220
|
+
),
|
|
1221
|
+
/* @__PURE__ */ jsx(
|
|
1222
|
+
IconButton,
|
|
1223
|
+
{
|
|
1224
|
+
onClick: handleZoomOut,
|
|
1225
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_ZOOM_OUT}`
|
|
1226
|
+
}
|
|
1227
|
+
)
|
|
1228
|
+
] });
|
|
1229
|
+
}
|
|
885
1230
|
function TopRightTools(props) {
|
|
886
1231
|
const { gpsTools } = props;
|
|
887
1232
|
const { addPopup, closePopup } = usePopupsStore((state) => state.popupsActions);
|
|
@@ -967,6 +1312,191 @@ function TopRightTools(props) {
|
|
|
967
1312
|
/* @__PURE__ */ jsx(ZoomButtons, {})
|
|
968
1313
|
] });
|
|
969
1314
|
}
|
|
1315
|
+
function useColumns(props) {
|
|
1316
|
+
const {
|
|
1317
|
+
rowKeyGetter,
|
|
1318
|
+
visibleLayers,
|
|
1319
|
+
setVisibleLayers,
|
|
1320
|
+
autoFocusLayers,
|
|
1321
|
+
setAutoFocusLayers,
|
|
1322
|
+
clusterLayers,
|
|
1323
|
+
setClusterLayers
|
|
1324
|
+
} = props;
|
|
1325
|
+
const { getLabel } = useModuleDictionary();
|
|
1326
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
1327
|
+
const useHook = useCallback(
|
|
1328
|
+
(field) => {
|
|
1329
|
+
if (field === "visible") {
|
|
1330
|
+
return [visibleLayers, setVisibleLayers];
|
|
1331
|
+
} else if (field === "autoFocus") {
|
|
1332
|
+
return [autoFocusLayers, setAutoFocusLayers];
|
|
1333
|
+
} else {
|
|
1334
|
+
return [clusterLayers, setClusterLayers];
|
|
1335
|
+
}
|
|
1336
|
+
},
|
|
1337
|
+
[visibleLayers, autoFocusLayers, clusterLayers]
|
|
1338
|
+
);
|
|
1339
|
+
const columns = useMemo(
|
|
1340
|
+
() => [
|
|
1341
|
+
{
|
|
1342
|
+
key: "name",
|
|
1343
|
+
name: getLabel(MAP_DICCTIONARY.LABEL_NAME),
|
|
1344
|
+
type: "string",
|
|
1345
|
+
width: 150,
|
|
1346
|
+
frozen: true
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
key: "visible",
|
|
1350
|
+
name: getLabel(MAP_DICCTIONARY.LABEL_LAYER_VISIBLE),
|
|
1351
|
+
width: 50,
|
|
1352
|
+
minWidth: 20,
|
|
1353
|
+
type: "boolean",
|
|
1354
|
+
formatter: ColumnSetCheckFormatter({
|
|
1355
|
+
field: "visible",
|
|
1356
|
+
rowKeyGetter,
|
|
1357
|
+
useHook
|
|
1358
|
+
}),
|
|
1359
|
+
cellClass: "rdg-cell-align-center",
|
|
1360
|
+
headerRenderer: (_p) => /* @__PURE__ */ jsx(Tooltip, { title: getLabel(MAP_DICCTIONARY.LABEL_LAYER_VISIBLE), children: /* @__PURE__ */ jsx(
|
|
1361
|
+
Icon,
|
|
1362
|
+
{
|
|
1363
|
+
size: "medium",
|
|
1364
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_VISIBLE}`
|
|
1365
|
+
}
|
|
1366
|
+
) })
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
key: "autoFocus",
|
|
1370
|
+
name: getLabel(MAP_DICCTIONARY.LABEL_LAYER_AUTOFOCUS),
|
|
1371
|
+
minWidth: 20,
|
|
1372
|
+
width: 50,
|
|
1373
|
+
type: "boolean",
|
|
1374
|
+
formatter: ColumnSetCheckFormatter({
|
|
1375
|
+
field: "autoFocus",
|
|
1376
|
+
rowKeyGetter,
|
|
1377
|
+
useHook
|
|
1378
|
+
}),
|
|
1379
|
+
cellClass: "rdg-cell-align-center",
|
|
1380
|
+
headerRenderer: (_p) => /* @__PURE__ */ jsx(Tooltip, { title: getLabel(MAP_DICCTIONARY.LABEL_LAYER_AUTOFOCUS), children: /* @__PURE__ */ jsx(
|
|
1381
|
+
Icon,
|
|
1382
|
+
{
|
|
1383
|
+
size: "medium",
|
|
1384
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_AUTOFOCUS}`
|
|
1385
|
+
}
|
|
1386
|
+
) })
|
|
1387
|
+
},
|
|
1388
|
+
{
|
|
1389
|
+
key: "cluster",
|
|
1390
|
+
name: getLabel(MAP_DICCTIONARY.LABEL_LAYER_CLUSTER),
|
|
1391
|
+
minWidth: 20,
|
|
1392
|
+
width: 50,
|
|
1393
|
+
type: "boolean",
|
|
1394
|
+
formatter: ColumnSetCheckFormatter({
|
|
1395
|
+
field: "cluster",
|
|
1396
|
+
disabledGetter: (row) => !row.clusterAble,
|
|
1397
|
+
rowKeyGetter,
|
|
1398
|
+
useHook
|
|
1399
|
+
}),
|
|
1400
|
+
cellClass: "rdg-cell-align-center",
|
|
1401
|
+
headerRenderer: (_p) => /* @__PURE__ */ jsx(Tooltip, { title: getLabel(MAP_DICCTIONARY.LABEL_LAYER_CLUSTER), children: /* @__PURE__ */ jsx(
|
|
1402
|
+
Icon,
|
|
1403
|
+
{
|
|
1404
|
+
size: "medium",
|
|
1405
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_CLUSTER}`
|
|
1406
|
+
}
|
|
1407
|
+
) })
|
|
1408
|
+
}
|
|
1409
|
+
],
|
|
1410
|
+
[getLabel, useHook]
|
|
1411
|
+
);
|
|
1412
|
+
return { columns };
|
|
1413
|
+
}
|
|
1414
|
+
function useCheckedLayers(checkedNameSet) {
|
|
1415
|
+
const [checkedLayers, setCheckedLayers] = useMapStore(
|
|
1416
|
+
(state) => [
|
|
1417
|
+
state[`${checkedNameSet}CheckedLayers`],
|
|
1418
|
+
(newSet) => {
|
|
1419
|
+
state.mapActions.setCheckedLayers(checkedNameSet, newSet);
|
|
1420
|
+
}
|
|
1421
|
+
],
|
|
1422
|
+
shallow
|
|
1423
|
+
);
|
|
1424
|
+
return [checkedLayers, setCheckedLayers];
|
|
1425
|
+
}
|
|
1426
|
+
function useRowActionsGetter() {
|
|
1427
|
+
const { getLabel } = useModuleDictionary();
|
|
1428
|
+
const { hasPrivilege } = useModulePrivileges();
|
|
1429
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
1430
|
+
const { removeLayer } = useMapStore((state) => state.mapActions, shallow);
|
|
1431
|
+
const [urlIconDelete] = useState(
|
|
1432
|
+
`${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_LAYER_DELETE}`
|
|
1433
|
+
);
|
|
1434
|
+
const onDelete = useCallback(
|
|
1435
|
+
(row) => {
|
|
1436
|
+
removeLayer(row.id);
|
|
1437
|
+
},
|
|
1438
|
+
[getLabel]
|
|
1439
|
+
);
|
|
1440
|
+
const rowActionsGetter = useCallback(
|
|
1441
|
+
(row) => {
|
|
1442
|
+
const conditionalItems = [];
|
|
1443
|
+
conditionalItems.push({
|
|
1444
|
+
urlIcon: urlIconDelete,
|
|
1445
|
+
dictionaryId: MAP_DICCTIONARY.ROW_ACTION_LAYER_DELETE,
|
|
1446
|
+
onClick: () => {
|
|
1447
|
+
onDelete(row);
|
|
1448
|
+
},
|
|
1449
|
+
disabled: !row.deleteAble
|
|
1450
|
+
});
|
|
1451
|
+
return conditionalItems;
|
|
1452
|
+
},
|
|
1453
|
+
[hasPrivilege, onDelete, urlIconDelete]
|
|
1454
|
+
);
|
|
1455
|
+
return { rowActionsGetter };
|
|
1456
|
+
}
|
|
1457
|
+
function useMaster() {
|
|
1458
|
+
const [hashLayers, layersIds] = useMapStore(
|
|
1459
|
+
(state) => [state.hashLayers, state.layersIds],
|
|
1460
|
+
shallow
|
|
1461
|
+
);
|
|
1462
|
+
const rowKeyGetter = useCallback((row) => row.id, []);
|
|
1463
|
+
const [visibleLayers, setVisibleLayers] = useCheckedLayers("visible");
|
|
1464
|
+
const [autoFocusLayers, setAutoFocusLayers] = useCheckedLayers("autoFocus");
|
|
1465
|
+
const [clusterLayers, setClusterLayers] = useCheckedLayers("cluster");
|
|
1466
|
+
const rows = useMemo(() => {
|
|
1467
|
+
const rows2 = [];
|
|
1468
|
+
layersIds.forEach((layerId) => {
|
|
1469
|
+
if (hashLayers[layerId]) {
|
|
1470
|
+
rows2.push({
|
|
1471
|
+
id: layerId,
|
|
1472
|
+
name: hashLayers[layerId].name || `*${layerId}`,
|
|
1473
|
+
active: hashLayers[layerId].visible,
|
|
1474
|
+
clusterAble: hashLayers[layerId].clusterAble || false,
|
|
1475
|
+
deleteAble: hashLayers[layerId].deleteAble || false
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
});
|
|
1479
|
+
return rows2;
|
|
1480
|
+
}, [hashLayers, layersIds]);
|
|
1481
|
+
const { rowActionsGetter } = useRowActionsGetter();
|
|
1482
|
+
const { columns } = useColumns({
|
|
1483
|
+
rowKeyGetter,
|
|
1484
|
+
visibleLayers,
|
|
1485
|
+
setVisibleLayers,
|
|
1486
|
+
autoFocusLayers,
|
|
1487
|
+
setAutoFocusLayers,
|
|
1488
|
+
clusterLayers,
|
|
1489
|
+
setClusterLayers
|
|
1490
|
+
});
|
|
1491
|
+
return {
|
|
1492
|
+
rowKeyGetter,
|
|
1493
|
+
columns,
|
|
1494
|
+
rows,
|
|
1495
|
+
checkedRows: visibleLayers,
|
|
1496
|
+
onCheckedRowsChange: setVisibleLayers,
|
|
1497
|
+
rowActionsGetter
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
970
1500
|
function useDisableZoomEvents(node) {
|
|
971
1501
|
const map = useMap();
|
|
972
1502
|
useEffect(() => {
|
|
@@ -982,6 +1512,186 @@ function useDisableZoomEvents(node) {
|
|
|
982
1512
|
});
|
|
983
1513
|
}, [map, node]);
|
|
984
1514
|
}
|
|
1515
|
+
function LayersTool() {
|
|
1516
|
+
const { columns, rows, rowKeyGetter, rowActionsGetter } = useMaster();
|
|
1517
|
+
const [divRef, setDivRef] = useStateRef(null);
|
|
1518
|
+
useDisableZoomEvents(divRef);
|
|
1519
|
+
return /* @__PURE__ */ jsx("div", { ref: setDivRef, style: { position: "relative", height: "100%" }, children: /* @__PURE__ */ jsx(
|
|
1520
|
+
DataGrid,
|
|
1521
|
+
{
|
|
1522
|
+
id: "layers",
|
|
1523
|
+
columns,
|
|
1524
|
+
rows,
|
|
1525
|
+
rowActionsGetter,
|
|
1526
|
+
rowKeyGetter,
|
|
1527
|
+
withActions: true,
|
|
1528
|
+
actionsProps: {
|
|
1529
|
+
withRowsCount: false,
|
|
1530
|
+
withSettings: false,
|
|
1531
|
+
withPager: false,
|
|
1532
|
+
withLocalFilters: false
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
) });
|
|
1536
|
+
}
|
|
1537
|
+
function MapSourcesTool() {
|
|
1538
|
+
const { getLabel } = useModuleDictionary();
|
|
1539
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
1540
|
+
const currentMapSourceId = useMapStore((state) => state.currentMapSourceId, shallow);
|
|
1541
|
+
const mapSources = useMapStore((state) => {
|
|
1542
|
+
return state.mapSourcesIds.map((id) => ({
|
|
1543
|
+
id,
|
|
1544
|
+
dictionaryId: state.hashMapSources[id].dictionaryId,
|
|
1545
|
+
iconUrl: state.hashMapSources[id].iconUrl,
|
|
1546
|
+
hasBicyclingLayer: state.hashMapSources[id].hasBicyclingLayer,
|
|
1547
|
+
hasTrafficLayer: state.hashMapSources[id].hasTrafficLayer,
|
|
1548
|
+
hasTransitLayer: state.hashMapSources[id].hasTransitLayer,
|
|
1549
|
+
roadSeletedOptions: state.hashMapSources[id].roadSelectedOptions
|
|
1550
|
+
}));
|
|
1551
|
+
}, shallow);
|
|
1552
|
+
const { setCurrentMapSource, setMapSourceRoadOptions: setMapSourceRoadMapOptions } = useMapStore(
|
|
1553
|
+
(state) => state.mapActions,
|
|
1554
|
+
shallow
|
|
1555
|
+
);
|
|
1556
|
+
const [divRef, setDivRef] = useStateRef(null);
|
|
1557
|
+
useDisableZoomEvents(divRef);
|
|
1558
|
+
const handleChange = (event) => {
|
|
1559
|
+
setCurrentMapSource(event.target.value);
|
|
1560
|
+
};
|
|
1561
|
+
return /* @__PURE__ */ jsx("div", { className: mapClasses.mapSourcesRoot, ref: setDivRef, children: /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
|
|
1562
|
+
RadioGroup,
|
|
1563
|
+
{
|
|
1564
|
+
"aria-labelledby": "demo-controlled-radio-buttons-group",
|
|
1565
|
+
name: "controlled-radio-buttons-group",
|
|
1566
|
+
value: currentMapSourceId,
|
|
1567
|
+
onChange: handleChange,
|
|
1568
|
+
children: mapSources.map((mapSourceOption) => /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOption, children: [
|
|
1569
|
+
/* @__PURE__ */ jsx(
|
|
1570
|
+
FormControlLabel,
|
|
1571
|
+
{
|
|
1572
|
+
className: "",
|
|
1573
|
+
value: mapSourceOption.id,
|
|
1574
|
+
control: /* @__PURE__ */ jsx(Radio, {}),
|
|
1575
|
+
label: /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOptionIconLabel, children: [
|
|
1576
|
+
/* @__PURE__ */ jsx(
|
|
1577
|
+
Icon,
|
|
1578
|
+
{
|
|
1579
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${mapSourceOption.iconUrl}`
|
|
1580
|
+
}
|
|
1581
|
+
),
|
|
1582
|
+
/* @__PURE__ */ jsx("span", { children: getLabel(mapSourceOption.dictionaryId) })
|
|
1583
|
+
] })
|
|
1584
|
+
}
|
|
1585
|
+
),
|
|
1586
|
+
(mapSourceOption.hasBicyclingLayer || mapSourceOption.hasTrafficLayer || mapSourceOption.hasTransitLayer) && /* @__PURE__ */ jsxs(
|
|
1587
|
+
"div",
|
|
1588
|
+
{
|
|
1589
|
+
className: clsx(
|
|
1590
|
+
mapClasses.mapSourcesOptionRoadOptions,
|
|
1591
|
+
currentMapSourceId !== mapSourceOption.id ? mapClasses.disabled : mapClasses.active
|
|
1592
|
+
),
|
|
1593
|
+
children: [
|
|
1594
|
+
mapSourceOption.hasTrafficLayer && /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOptionRoadOptionsCheck, children: [
|
|
1595
|
+
/* @__PURE__ */ jsx(
|
|
1596
|
+
CheckBox,
|
|
1597
|
+
{
|
|
1598
|
+
disabled: currentMapSourceId !== mapSourceOption.id,
|
|
1599
|
+
checked: mapSourceOption.roadSeletedOptions?.trafficLayer || false,
|
|
1600
|
+
onChange: (_e, checked) => {
|
|
1601
|
+
setMapSourceRoadMapOptions({ trafficLayer: checked });
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
),
|
|
1605
|
+
/* @__PURE__ */ jsx(
|
|
1606
|
+
Icon,
|
|
1607
|
+
{
|
|
1608
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_SOURCE_ROAD_TRAFFIC}`
|
|
1609
|
+
}
|
|
1610
|
+
)
|
|
1611
|
+
] }),
|
|
1612
|
+
mapSourceOption.hasTransitLayer && /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOptionRoadOptionsCheck, children: [
|
|
1613
|
+
/* @__PURE__ */ jsx(
|
|
1614
|
+
CheckBox,
|
|
1615
|
+
{
|
|
1616
|
+
disabled: currentMapSourceId !== mapSourceOption.id,
|
|
1617
|
+
checked: mapSourceOption.roadSeletedOptions?.transitLayer || false,
|
|
1618
|
+
onChange: (_e, checked) => {
|
|
1619
|
+
setMapSourceRoadMapOptions({ transitLayer: checked });
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
),
|
|
1623
|
+
/* @__PURE__ */ jsx(
|
|
1624
|
+
Icon,
|
|
1625
|
+
{
|
|
1626
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_SOURCE_ROAD_TRANSIT}`
|
|
1627
|
+
}
|
|
1628
|
+
)
|
|
1629
|
+
] }),
|
|
1630
|
+
mapSourceOption.hasBicyclingLayer && /* @__PURE__ */ jsxs("div", { className: mapClasses.mapSourcesOptionRoadOptionsCheck, children: [
|
|
1631
|
+
/* @__PURE__ */ jsx(
|
|
1632
|
+
CheckBox,
|
|
1633
|
+
{
|
|
1634
|
+
disabled: currentMapSourceId !== mapSourceOption.id,
|
|
1635
|
+
checked: mapSourceOption.roadSeletedOptions?.bicyclingLayer || false,
|
|
1636
|
+
label: "Bycicle",
|
|
1637
|
+
onChange: (_e, checked) => {
|
|
1638
|
+
setMapSourceRoadMapOptions({ bicyclingLayer: checked });
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
),
|
|
1642
|
+
/* @__PURE__ */ jsx(
|
|
1643
|
+
Icon,
|
|
1644
|
+
{
|
|
1645
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_SOURCE_ROAD_BICYCLING}`
|
|
1646
|
+
}
|
|
1647
|
+
)
|
|
1648
|
+
] })
|
|
1649
|
+
]
|
|
1650
|
+
}
|
|
1651
|
+
)
|
|
1652
|
+
] }, mapSourceOption.dictionaryId))
|
|
1653
|
+
}
|
|
1654
|
+
) }) });
|
|
1655
|
+
}
|
|
1656
|
+
function LayersButton(props) {
|
|
1657
|
+
const { type } = props;
|
|
1658
|
+
const [open, setOpen] = useState(null);
|
|
1659
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
1660
|
+
const theme = useTheme();
|
|
1661
|
+
const handleOpen = (event) => {
|
|
1662
|
+
setOpen(event.currentTarget);
|
|
1663
|
+
};
|
|
1664
|
+
const handleClose = () => {
|
|
1665
|
+
setOpen(null);
|
|
1666
|
+
};
|
|
1667
|
+
return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
1668
|
+
/* @__PURE__ */ jsx(
|
|
1669
|
+
IconButton,
|
|
1670
|
+
{
|
|
1671
|
+
onClick: handleOpen,
|
|
1672
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${type === "MapSources" ? MAP_ICONS.MAP_SOURCES_TOOL : MAP_ICONS.MAP_LAYERS_TOOL}`
|
|
1673
|
+
}
|
|
1674
|
+
),
|
|
1675
|
+
/* @__PURE__ */ jsx(
|
|
1676
|
+
Popover,
|
|
1677
|
+
{
|
|
1678
|
+
className: type === "MapSources" ? mapClasses.mapSourcesPopoverRoot : mapClasses.layersPopoverRoot,
|
|
1679
|
+
arrowType: "no-arrow",
|
|
1680
|
+
open: Boolean(open),
|
|
1681
|
+
anchorEl: open,
|
|
1682
|
+
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1683
|
+
onClose: handleClose,
|
|
1684
|
+
sx: {
|
|
1685
|
+
...type === "MapSources" ? theme.components?.M4LMapMapSources?.styleOverrides : theme.components?.M4LMapLayers?.styleOverrides
|
|
1686
|
+
},
|
|
1687
|
+
disableAutoFocus: true,
|
|
1688
|
+
disableRestoreFocus: true,
|
|
1689
|
+
disableEnforceFocus: true,
|
|
1690
|
+
children: type === "MapSources" ? /* @__PURE__ */ jsx(MapSourcesTool, {}) : /* @__PURE__ */ jsx(LayersTool, {})
|
|
1691
|
+
}
|
|
1692
|
+
)
|
|
1693
|
+
] });
|
|
1694
|
+
}
|
|
985
1695
|
function TopLeftTools() {
|
|
986
1696
|
return /* @__PURE__ */ jsxs(Control, { position: "topleft", prepend: true, className: mapClasses.topLeftToolsRoot, children: [
|
|
987
1697
|
/* @__PURE__ */ jsx(LayersButton, { type: "MapSources" }),
|
|
@@ -1403,10 +2113,6 @@ const PolylineWithArrows = ({
|
|
|
1403
2113
|
}, [map, enableEdit]);
|
|
1404
2114
|
return /* @__PURE__ */ jsx(Polyline, { positions, ref: polylineRef, ...other });
|
|
1405
2115
|
};
|
|
1406
|
-
function bearingRawToCSS(gpsBearing, offsetRotate) {
|
|
1407
|
-
const rotation = -((360 + offsetRotate - gpsBearing) % 360);
|
|
1408
|
-
return rotation;
|
|
1409
|
-
}
|
|
1410
2116
|
const CommonFeatureRender = (props) => {
|
|
1411
2117
|
const { id, layerId } = props;
|
|
1412
2118
|
const feature = useMapStore((state) => {
|
|
@@ -1628,11 +2334,14 @@ const CommonFeatureRender = (props) => {
|
|
|
1628
2334
|
};
|
|
1629
2335
|
export {
|
|
1630
2336
|
CommonFeatureRender as C,
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
2337
|
+
LABEL_BK_COLOR_DEFAULT as L,
|
|
2338
|
+
MAP_ZINDEX_OVER_MAP as M,
|
|
2339
|
+
LABEL_COLOR_DEFAULT as a,
|
|
2340
|
+
MAP_DICCTIONARY as b,
|
|
2341
|
+
Map$1 as c,
|
|
2342
|
+
MapProvider as d,
|
|
2343
|
+
MapContext as e,
|
|
2344
|
+
MarkerFeatureRender as f,
|
|
1636
2345
|
mapClasses as m,
|
|
1637
2346
|
useMapStore as u
|
|
1638
2347
|
};
|