@mapcomponents/react-maplibre 0.1.84 → 0.1.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/components/MlCenterPosition/MlCenterPosition.d.ts +0 -2
- package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +0 -2
- package/dist/components/MlFeatureEditor/MlFeatureEditor.d.ts +1 -1
- package/dist/components/MlFeatureEditor/MlFeatureEditor.stories.d.ts +14 -14
- package/dist/components/MlFollowGps/MlFollowGps.d.ts +0 -1
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +1 -1
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +3 -2
- package/dist/components/MlNavigationTools/MlNavigationTools.d.ts +1 -1
- package/dist/components/MlNavigationTools/MlNavigationTools.stories.d.ts +27 -19
- package/dist/components/MlScaleReference/MlScaleReference.stories.d.ts +13 -13
- package/dist/components/MlThreeJsLayer/MlThreeJsLayer.d.ts +1 -1
- package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.stories.d.ts +1 -1
- package/dist/components/MlWmsLoader/utils/WMSLinks.d.ts +1 -0
- package/dist/decorators/GeoJsonMapDecorator.d.ts +2 -0
- package/dist/hooks/useAddImage/useAddImage.d.ts +20 -0
- package/dist/hooks/useAddImage/useAddImage.stories.d.ts +14 -0
- package/dist/hooks/useFeatureEditor/utils/FeatureEditorStyle.d.ts +88 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +604 -284
- package/dist/index.esm.js.map +1 -1
- package/dist/ui_components/LayerList/LayerList.d.ts +3 -3
- package/dist/ui_components/LayerList/LayerListFolder.d.ts +4 -4
- package/dist/ui_components/LayerList/LayerListItem.d.ts +3 -3
- package/dist/ui_components/LayerList/LayerListItemFactory.d.ts +1 -1
- package/dist/ui_components/LayerList/util/LayerListItemVectorLayer.d.ts +24 -4
- package/dist/ui_components/LayerList/util/LayerPropertyForm.d.ts +4 -4
- package/dist/ui_components/LayerList/util/input/ColorPicker.d.ts +4 -4
- package/dist/ui_components/MapcomponentsTheme.d.ts +8 -0
- package/dist/ui_components/UploadButton.d.ts +1 -0
- package/package.json +5 -6
- /package/dist/hooks/{useFeatureEditor.d.ts → useFeatureEditor/useFeatureEditor.d.ts} +0 -0
package/dist/index.esm.js
CHANGED
|
@@ -9,7 +9,7 @@ var uuid = require('uuid');
|
|
|
9
9
|
require('maplibre-gl/dist/maplibre-gl.css');
|
|
10
10
|
var PropTypes = require('prop-types');
|
|
11
11
|
var material = require('@mui/material');
|
|
12
|
-
var
|
|
12
|
+
var FilterCenterFocusIcon = require('@mui/icons-material/FilterCenterFocus');
|
|
13
13
|
var PrinterIcon = require('@mui/icons-material/Print');
|
|
14
14
|
var Button = require('@mui/material/Button');
|
|
15
15
|
var jsPDF = require('jspdf');
|
|
@@ -18,6 +18,7 @@ var Moveable = require('react-moveable');
|
|
|
18
18
|
var turf = require('@turf/turf');
|
|
19
19
|
require('@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css');
|
|
20
20
|
var MapboxDraw = require('@mapbox/mapbox-gl-draw');
|
|
21
|
+
var GpsFixedIcon = require('@mui/icons-material/GpsFixed');
|
|
21
22
|
var ButtonGroup = require('@mui/material/ButtonGroup');
|
|
22
23
|
var ControlPointIcon = require('@mui/icons-material/ControlPoint');
|
|
23
24
|
var RemoveCircleOutlineIcon = require('@mui/icons-material/RemoveCircleOutline');
|
|
@@ -26,6 +27,7 @@ var Divider = require('@mui/material/Divider');
|
|
|
26
27
|
var useMediaQuery = require('@mui/material/useMediaQuery');
|
|
27
28
|
var syncMove = require('@mapbox/mapbox-gl-sync-move');
|
|
28
29
|
var Paper = require('@mui/material/Paper');
|
|
30
|
+
var xmldom = require('@xmldom/xmldom');
|
|
29
31
|
var helpers = require('@turf/helpers');
|
|
30
32
|
var WMSCapabilities = require('wms-capabilities');
|
|
31
33
|
var InfoIcon = require('@mui/icons-material/Info');
|
|
@@ -46,11 +48,9 @@ var StopIcon = require('@mui/icons-material/Stop');
|
|
|
46
48
|
var FastForwardIcon = require('@mui/icons-material/FastForward');
|
|
47
49
|
var FastRewindIcon = require('@mui/icons-material/FastRewind');
|
|
48
50
|
var d3 = require('d3');
|
|
49
|
-
var TuneIcon = require('@mui/icons-material/Tune');
|
|
50
|
-
var reactColor = require('react-color');
|
|
51
51
|
var system = require('@mui/system');
|
|
52
|
-
var
|
|
53
|
-
var
|
|
52
|
+
var reactColor = require('react-color');
|
|
53
|
+
var TuneIcon = require('@mui/icons-material/Tune');
|
|
54
54
|
var PlaylistAddIcon = require('@mui/icons-material/PlaylistAdd');
|
|
55
55
|
var DynamicFeedIcon = require('@mui/icons-material/DynamicFeed');
|
|
56
56
|
var AppBar = require('@mui/material/AppBar');
|
|
@@ -93,7 +93,7 @@ var maplibregl__default = /*#__PURE__*/_interopDefaultLegacy(maplibregl);
|
|
|
93
93
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
94
94
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
95
95
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
96
|
-
var
|
|
96
|
+
var FilterCenterFocusIcon__default = /*#__PURE__*/_interopDefaultLegacy(FilterCenterFocusIcon);
|
|
97
97
|
var PrinterIcon__default = /*#__PURE__*/_interopDefaultLegacy(PrinterIcon);
|
|
98
98
|
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
99
99
|
var jsPDF__default = /*#__PURE__*/_interopDefaultLegacy(jsPDF);
|
|
@@ -101,6 +101,7 @@ var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
|
101
101
|
var Moveable__default = /*#__PURE__*/_interopDefaultLegacy(Moveable);
|
|
102
102
|
var turf__namespace = /*#__PURE__*/_interopNamespace(turf);
|
|
103
103
|
var MapboxDraw__default = /*#__PURE__*/_interopDefaultLegacy(MapboxDraw);
|
|
104
|
+
var GpsFixedIcon__default = /*#__PURE__*/_interopDefaultLegacy(GpsFixedIcon);
|
|
104
105
|
var ButtonGroup__default = /*#__PURE__*/_interopDefaultLegacy(ButtonGroup);
|
|
105
106
|
var ControlPointIcon__default = /*#__PURE__*/_interopDefaultLegacy(ControlPointIcon);
|
|
106
107
|
var RemoveCircleOutlineIcon__default = /*#__PURE__*/_interopDefaultLegacy(RemoveCircleOutlineIcon);
|
|
@@ -109,6 +110,7 @@ var Divider__default = /*#__PURE__*/_interopDefaultLegacy(Divider);
|
|
|
109
110
|
var useMediaQuery__default = /*#__PURE__*/_interopDefaultLegacy(useMediaQuery);
|
|
110
111
|
var syncMove__default = /*#__PURE__*/_interopDefaultLegacy(syncMove);
|
|
111
112
|
var Paper__default = /*#__PURE__*/_interopDefaultLegacy(Paper);
|
|
113
|
+
var xmldom__namespace = /*#__PURE__*/_interopNamespace(xmldom);
|
|
112
114
|
var WMSCapabilities__default = /*#__PURE__*/_interopDefaultLegacy(WMSCapabilities);
|
|
113
115
|
var InfoIcon__default = /*#__PURE__*/_interopDefaultLegacy(InfoIcon);
|
|
114
116
|
var List__default = /*#__PURE__*/_interopDefaultLegacy(List);
|
|
@@ -128,8 +130,6 @@ var FastForwardIcon__default = /*#__PURE__*/_interopDefaultLegacy(FastForwardIco
|
|
|
128
130
|
var FastRewindIcon__default = /*#__PURE__*/_interopDefaultLegacy(FastRewindIcon);
|
|
129
131
|
var d3__namespace = /*#__PURE__*/_interopNamespace(d3);
|
|
130
132
|
var TuneIcon__default = /*#__PURE__*/_interopDefaultLegacy(TuneIcon);
|
|
131
|
-
var ArrowCircleDownIcon__default = /*#__PURE__*/_interopDefaultLegacy(ArrowCircleDownIcon);
|
|
132
|
-
var ArrowCircleUpIcon__default = /*#__PURE__*/_interopDefaultLegacy(ArrowCircleUpIcon);
|
|
133
133
|
var PlaylistAddIcon__default = /*#__PURE__*/_interopDefaultLegacy(PlaylistAddIcon);
|
|
134
134
|
var DynamicFeedIcon__default = /*#__PURE__*/_interopDefaultLegacy(DynamicFeedIcon);
|
|
135
135
|
var AppBar__default = /*#__PURE__*/_interopDefaultLegacy(AppBar);
|
|
@@ -785,7 +785,18 @@ var getDesignTokens = function (mode) { return (__assign(__assign({}, (mode ===
|
|
|
785
785
|
},
|
|
786
786
|
topToolbar: { barColor: '#000' },
|
|
787
787
|
navigation: { navColor: '#313131', navHover: '#747577' },
|
|
788
|
-
|
|
788
|
+
GPS: {
|
|
789
|
+
GPSActiveColor: '#fff',
|
|
790
|
+
GPSInactiveColor: '#fff',
|
|
791
|
+
GPSActiveBackgroundColor: '#747577',
|
|
792
|
+
},
|
|
793
|
+
compass: {
|
|
794
|
+
compColor: '#313131',
|
|
795
|
+
compHover: '#747577',
|
|
796
|
+
compStroke: '#d3dce1',
|
|
797
|
+
compNorth: '#cf003f',
|
|
798
|
+
compSouth: '#d3dcf0',
|
|
799
|
+
},
|
|
789
800
|
}
|
|
790
801
|
: {
|
|
791
802
|
primary: {
|
|
@@ -798,7 +809,18 @@ var getDesignTokens = function (mode) { return (__assign(__assign({}, (mode ===
|
|
|
798
809
|
},
|
|
799
810
|
topToolbar: { barColor: '#fff' },
|
|
800
811
|
navigation: { navColor: '#fff', navHover: '#f5f5f5' },
|
|
801
|
-
|
|
812
|
+
GPS: {
|
|
813
|
+
GPSActiveColor: '#009EE0',
|
|
814
|
+
GPSInactiveColor: '#000',
|
|
815
|
+
GPSActiveBackgroundColor: '#fff',
|
|
816
|
+
},
|
|
817
|
+
compass: {
|
|
818
|
+
compColor: '#fff',
|
|
819
|
+
compHover: '#f5f5f5',
|
|
820
|
+
compStroke: '#009ee0',
|
|
821
|
+
compNorth: '#cf003f',
|
|
822
|
+
compSouth: '#d3dcf0',
|
|
823
|
+
},
|
|
802
824
|
})) })); };
|
|
803
825
|
var getTheme = function (mode) {
|
|
804
826
|
var _a;
|
|
@@ -1357,12 +1379,10 @@ var MlCenterPosition = function (props) {
|
|
|
1357
1379
|
zIndex: 1002,
|
|
1358
1380
|
color: !locationAccessDenied ? props.onColor : props.offColor,
|
|
1359
1381
|
}, onClick: centerCurrentLocation, disabled: locationAccessDenied },
|
|
1360
|
-
React__default["default"].createElement(
|
|
1382
|
+
React__default["default"].createElement(FilterCenterFocusIcon__default["default"], { sx: { fontSize: { xs: '1.4em', md: '1em' } } }))));
|
|
1361
1383
|
};
|
|
1362
1384
|
MlCenterPosition.defaultProps = {
|
|
1363
1385
|
mapId: undefined,
|
|
1364
|
-
onColor: '#ececec',
|
|
1365
|
-
offColor: '#666',
|
|
1366
1386
|
};
|
|
1367
1387
|
|
|
1368
1388
|
/**
|
|
@@ -2035,10 +2055,238 @@ MlCreatePdfForm.defaultProps = {
|
|
|
2035
2055
|
mapId: undefined,
|
|
2036
2056
|
};
|
|
2037
2057
|
|
|
2058
|
+
function featureEditorStyle() {
|
|
2059
|
+
var mediaIsMobile = material.useMediaQuery(function (theme) { return theme.breakpoints.down('md'); });
|
|
2060
|
+
var featureEditorStyle = [
|
|
2061
|
+
{
|
|
2062
|
+
id: 'gl-draw-polygon-fill-inactive',
|
|
2063
|
+
type: 'fill',
|
|
2064
|
+
filter: [
|
|
2065
|
+
'all',
|
|
2066
|
+
['==', 'active', 'false'],
|
|
2067
|
+
['==', '$type', 'Polygon'],
|
|
2068
|
+
['!=', 'mode', 'static'],
|
|
2069
|
+
],
|
|
2070
|
+
paint: {
|
|
2071
|
+
'fill-color': '#3bb2d0',
|
|
2072
|
+
'fill-outline-color': '#3bb2d0',
|
|
2073
|
+
'fill-opacity': 0.1,
|
|
2074
|
+
},
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
id: 'gl-draw-polygon-fill-active',
|
|
2078
|
+
type: 'fill',
|
|
2079
|
+
filter: ['all', ['==', 'active', 'true'], ['==', '$type', 'Polygon']],
|
|
2080
|
+
paint: {
|
|
2081
|
+
'fill-color': '#fbb03b',
|
|
2082
|
+
'fill-outline-color': '#fbb03b',
|
|
2083
|
+
'fill-opacity': 0.1,
|
|
2084
|
+
},
|
|
2085
|
+
},
|
|
2086
|
+
{
|
|
2087
|
+
id: 'gl-draw-polygon-midpoint',
|
|
2088
|
+
type: 'circle',
|
|
2089
|
+
filter: ['all', ['==', '$type', 'Point'], ['==', 'meta', 'midpoint']],
|
|
2090
|
+
paint: {
|
|
2091
|
+
'circle-radius': mediaIsMobile ? 7 : 5,
|
|
2092
|
+
'circle-color': '#fbb03b',
|
|
2093
|
+
},
|
|
2094
|
+
},
|
|
2095
|
+
{
|
|
2096
|
+
id: 'gl-draw-polygon-stroke-inactive',
|
|
2097
|
+
type: 'line',
|
|
2098
|
+
filter: [
|
|
2099
|
+
'all',
|
|
2100
|
+
['==', 'active', 'false'],
|
|
2101
|
+
['==', '$type', 'Polygon'],
|
|
2102
|
+
['!=', 'mode', 'static'],
|
|
2103
|
+
],
|
|
2104
|
+
layout: {
|
|
2105
|
+
'line-cap': 'round',
|
|
2106
|
+
'line-join': 'round',
|
|
2107
|
+
},
|
|
2108
|
+
paint: {
|
|
2109
|
+
'line-color': '#3bb2d0',
|
|
2110
|
+
'line-width': 2,
|
|
2111
|
+
},
|
|
2112
|
+
},
|
|
2113
|
+
{
|
|
2114
|
+
id: 'gl-draw-polygon-stroke-active',
|
|
2115
|
+
type: 'line',
|
|
2116
|
+
filter: ['all', ['==', 'active', 'true'], ['==', '$type', 'Polygon']],
|
|
2117
|
+
layout: {
|
|
2118
|
+
'line-cap': 'round',
|
|
2119
|
+
'line-join': 'round',
|
|
2120
|
+
},
|
|
2121
|
+
paint: {
|
|
2122
|
+
'line-color': '#fbb03b',
|
|
2123
|
+
'line-dasharray': [0.2, 2],
|
|
2124
|
+
'line-width': 2,
|
|
2125
|
+
},
|
|
2126
|
+
},
|
|
2127
|
+
{
|
|
2128
|
+
id: 'gl-draw-line-inactive',
|
|
2129
|
+
type: 'line',
|
|
2130
|
+
filter: [
|
|
2131
|
+
'all',
|
|
2132
|
+
['==', 'active', 'false'],
|
|
2133
|
+
['==', '$type', 'LineString'],
|
|
2134
|
+
['!=', 'mode', 'static'],
|
|
2135
|
+
],
|
|
2136
|
+
layout: {
|
|
2137
|
+
'line-cap': 'round',
|
|
2138
|
+
'line-join': 'round',
|
|
2139
|
+
},
|
|
2140
|
+
paint: {
|
|
2141
|
+
'line-color': '#3bb2d0',
|
|
2142
|
+
'line-width': 2,
|
|
2143
|
+
},
|
|
2144
|
+
},
|
|
2145
|
+
{
|
|
2146
|
+
id: 'gl-draw-line-active',
|
|
2147
|
+
type: 'line',
|
|
2148
|
+
filter: ['all', ['==', '$type', 'LineString'], ['==', 'active', 'true']],
|
|
2149
|
+
layout: {
|
|
2150
|
+
'line-cap': 'round',
|
|
2151
|
+
'line-join': 'round',
|
|
2152
|
+
},
|
|
2153
|
+
paint: {
|
|
2154
|
+
'line-color': '#fbb03b',
|
|
2155
|
+
'line-dasharray': [0.2, 2],
|
|
2156
|
+
'line-width': 2,
|
|
2157
|
+
},
|
|
2158
|
+
},
|
|
2159
|
+
{
|
|
2160
|
+
id: 'gl-draw-polygon-and-line-vertex-stroke-inactive',
|
|
2161
|
+
type: 'circle',
|
|
2162
|
+
filter: ['all', ['==', 'meta', 'vertex'], ['==', '$type', 'Point'], ['!=', 'mode', 'static']],
|
|
2163
|
+
paint: {
|
|
2164
|
+
'circle-radius': mediaIsMobile ? 8 : 6,
|
|
2165
|
+
'circle-color': '#fff',
|
|
2166
|
+
},
|
|
2167
|
+
},
|
|
2168
|
+
{
|
|
2169
|
+
id: 'gl-draw-polygon-and-line-vertex-inactive',
|
|
2170
|
+
type: 'circle',
|
|
2171
|
+
filter: ['all', ['==', 'meta', 'vertex'], ['==', '$type', 'Point'], ['!=', 'mode', 'static']],
|
|
2172
|
+
paint: {
|
|
2173
|
+
'circle-radius': mediaIsMobile ? 7 : 5,
|
|
2174
|
+
'circle-color': '#fbb03b',
|
|
2175
|
+
},
|
|
2176
|
+
},
|
|
2177
|
+
{
|
|
2178
|
+
id: 'gl-draw-point-point-stroke-inactive',
|
|
2179
|
+
type: 'circle',
|
|
2180
|
+
filter: [
|
|
2181
|
+
'all',
|
|
2182
|
+
['==', 'active', 'false'],
|
|
2183
|
+
['==', '$type', 'Point'],
|
|
2184
|
+
['==', 'meta', 'feature'],
|
|
2185
|
+
['!=', 'mode', 'static'],
|
|
2186
|
+
],
|
|
2187
|
+
paint: {
|
|
2188
|
+
'circle-radius': mediaIsMobile ? 10 : 9,
|
|
2189
|
+
'circle-opacity': 1,
|
|
2190
|
+
'circle-color': '#fff',
|
|
2191
|
+
},
|
|
2192
|
+
},
|
|
2193
|
+
{
|
|
2194
|
+
id: 'gl-draw-point-inactive',
|
|
2195
|
+
type: 'circle',
|
|
2196
|
+
filter: [
|
|
2197
|
+
'all',
|
|
2198
|
+
['==', 'active', 'false'],
|
|
2199
|
+
['==', '$type', 'Point'],
|
|
2200
|
+
['==', 'meta', 'feature'],
|
|
2201
|
+
['!=', 'mode', 'static'],
|
|
2202
|
+
],
|
|
2203
|
+
paint: {
|
|
2204
|
+
'circle-radius': mediaIsMobile ? 7.5 : 6.5,
|
|
2205
|
+
'circle-color': '#3bb2d0',
|
|
2206
|
+
},
|
|
2207
|
+
},
|
|
2208
|
+
{
|
|
2209
|
+
id: 'gl-draw-point-stroke-active',
|
|
2210
|
+
type: 'circle',
|
|
2211
|
+
filter: [
|
|
2212
|
+
'all',
|
|
2213
|
+
['==', '$type', 'Point'],
|
|
2214
|
+
['==', 'active', 'true'],
|
|
2215
|
+
['!=', 'meta', 'midpoint'],
|
|
2216
|
+
],
|
|
2217
|
+
paint: {
|
|
2218
|
+
'circle-radius': mediaIsMobile ? 11 : 10,
|
|
2219
|
+
'circle-color': '#fff',
|
|
2220
|
+
},
|
|
2221
|
+
},
|
|
2222
|
+
{
|
|
2223
|
+
id: 'gl-draw-point-active',
|
|
2224
|
+
type: 'circle',
|
|
2225
|
+
filter: [
|
|
2226
|
+
'all',
|
|
2227
|
+
['==', '$type', 'Point'],
|
|
2228
|
+
['!=', 'meta', 'midpoint'],
|
|
2229
|
+
['==', 'active', 'true'],
|
|
2230
|
+
],
|
|
2231
|
+
paint: {
|
|
2232
|
+
'circle-radius': mediaIsMobile ? 8.5 : 7.5,
|
|
2233
|
+
'circle-color': '#fbb03b',
|
|
2234
|
+
},
|
|
2235
|
+
},
|
|
2236
|
+
{
|
|
2237
|
+
id: 'gl-draw-polygon-fill-static',
|
|
2238
|
+
type: 'fill',
|
|
2239
|
+
filter: ['all', ['==', 'mode', 'static'], ['==', '$type', 'Polygon']],
|
|
2240
|
+
paint: {
|
|
2241
|
+
'fill-color': '#404040',
|
|
2242
|
+
'fill-outline-color': '#404040',
|
|
2243
|
+
'fill-opacity': 0.1,
|
|
2244
|
+
},
|
|
2245
|
+
},
|
|
2246
|
+
{
|
|
2247
|
+
id: 'gl-draw-polygon-stroke-static',
|
|
2248
|
+
type: 'line',
|
|
2249
|
+
filter: ['all', ['==', 'mode', 'static'], ['==', '$type', 'Polygon']],
|
|
2250
|
+
layout: {
|
|
2251
|
+
'line-cap': 'round',
|
|
2252
|
+
'line-join': 'round',
|
|
2253
|
+
},
|
|
2254
|
+
paint: {
|
|
2255
|
+
'line-color': '#404040',
|
|
2256
|
+
'line-width': 2,
|
|
2257
|
+
},
|
|
2258
|
+
},
|
|
2259
|
+
{
|
|
2260
|
+
id: 'gl-draw-line-static',
|
|
2261
|
+
type: 'line',
|
|
2262
|
+
filter: ['all', ['==', 'mode', 'static'], ['==', '$type', 'LineString']],
|
|
2263
|
+
layout: {
|
|
2264
|
+
'line-cap': 'round',
|
|
2265
|
+
'line-join': 'round',
|
|
2266
|
+
},
|
|
2267
|
+
paint: {
|
|
2268
|
+
'line-color': '#404040',
|
|
2269
|
+
'line-width': 2,
|
|
2270
|
+
},
|
|
2271
|
+
},
|
|
2272
|
+
{
|
|
2273
|
+
id: 'gl-draw-point-static',
|
|
2274
|
+
type: 'circle',
|
|
2275
|
+
filter: ['all', ['==', 'mode', 'static'], ['==', '$type', 'Point']],
|
|
2276
|
+
paint: {
|
|
2277
|
+
'circle-radius': mediaIsMobile ? 8.5 : 6.5,
|
|
2278
|
+
'circle-color': '#404040',
|
|
2279
|
+
},
|
|
2280
|
+
},
|
|
2281
|
+
];
|
|
2282
|
+
return featureEditorStyle;
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2038
2285
|
/**
|
|
2039
2286
|
* GeoJson Feature editor that allows to create or manipulate GeoJson data
|
|
2040
2287
|
*/
|
|
2041
2288
|
var useFeatureEditor = function (props) {
|
|
2289
|
+
console.log(featureEditorStyle());
|
|
2042
2290
|
var draw = React.useRef();
|
|
2043
2291
|
var mapHook = useMap({
|
|
2044
2292
|
mapId: props.mapId,
|
|
@@ -2047,11 +2295,11 @@ var useFeatureEditor = function (props) {
|
|
|
2047
2295
|
var drawToolsInitialized = React.useRef(false);
|
|
2048
2296
|
var _a = React.useState(false), drawToolsReady = _a[0], setDrawToolsReady = _a[1];
|
|
2049
2297
|
var _b = React.useState(), feature = _b[0], setFeature = _b[1];
|
|
2298
|
+
var style = featureEditorStyle();
|
|
2050
2299
|
var modeChangeHandler = React.useCallback(function (e) {
|
|
2051
2300
|
console.log('MlFeatureEditor mode change to ' + e.mode);
|
|
2052
2301
|
//setDrawMode(e.mode);
|
|
2053
|
-
if (typeof props.onFinish === 'function' &&
|
|
2054
|
-
(e.mode === 'simple_select')) {
|
|
2302
|
+
if (typeof props.onFinish === 'function' && e.mode === 'simple_select') {
|
|
2055
2303
|
props.onFinish();
|
|
2056
2304
|
}
|
|
2057
2305
|
}, [props.onFinish]);
|
|
@@ -2073,6 +2321,8 @@ var useFeatureEditor = function (props) {
|
|
|
2073
2321
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2074
2322
|
// @ts-ignore
|
|
2075
2323
|
modes: Object.assign({}, MapboxDraw__default["default"].modes),
|
|
2324
|
+
userProperties: true,
|
|
2325
|
+
styles: style,
|
|
2076
2326
|
});
|
|
2077
2327
|
mapHook.map.addControl(draw.current, 'top-left', mapHook.componentId);
|
|
2078
2328
|
mapHook.map.on('draw.modechange', modeChangeHandler, mapHook.componentId);
|
|
@@ -2124,7 +2374,7 @@ var useFeatureEditor = function (props) {
|
|
|
2124
2374
|
return {
|
|
2125
2375
|
feature: feature,
|
|
2126
2376
|
drawToolsReady: drawToolsReady,
|
|
2127
|
-
draw: draw.current
|
|
2377
|
+
draw: draw.current,
|
|
2128
2378
|
};
|
|
2129
2379
|
};
|
|
2130
2380
|
|
|
@@ -2510,13 +2760,37 @@ var MlFollowGps = function (props) {
|
|
|
2510
2760
|
}
|
|
2511
2761
|
return;
|
|
2512
2762
|
}, [mapHook.map, isFollowed, getLocationSuccess]);
|
|
2763
|
+
React.useEffect(function () {
|
|
2764
|
+
var _a, _b;
|
|
2765
|
+
if (accuracyGeoJson === null || accuracyGeoJson === void 0 ? void 0 : accuracyGeoJson.type) {
|
|
2766
|
+
var getBounds = (_a = mapHook.map) === null || _a === void 0 ? void 0 : _a.getBounds();
|
|
2767
|
+
var actualBounds = [
|
|
2768
|
+
getBounds === null || getBounds === void 0 ? void 0 : getBounds._ne.lng,
|
|
2769
|
+
getBounds === null || getBounds === void 0 ? void 0 : getBounds._ne.lat,
|
|
2770
|
+
getBounds === null || getBounds === void 0 ? void 0 : getBounds._sw.lng,
|
|
2771
|
+
getBounds === null || getBounds === void 0 ? void 0 : getBounds._sw.lat,
|
|
2772
|
+
];
|
|
2773
|
+
var accurancyBounds = turf.bbox(accuracyGeoJson);
|
|
2774
|
+
var contained = turf.booleanContains(turf.bboxPolygon(actualBounds), turf.bboxPolygon(accurancyBounds));
|
|
2775
|
+
if (contained === false) {
|
|
2776
|
+
(_b = mapHook.map) === null || _b === void 0 ? void 0 : _b.fitBounds(accurancyBounds, {
|
|
2777
|
+
padding: { top: 25, bottom: 25 },
|
|
2778
|
+
});
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
}, [accuracyGeoJson]);
|
|
2513
2782
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2514
2783
|
isFollowed && userLocationGeoJson && (React__default["default"].createElement(MlGeoJsonLayer, { geojson: accuracyGeoJson, type: 'fill', paint: __assign({ 'fill-color': '#cbd300', 'fill-opacity': 0.3 }, props.accuracyPaint), insertBeforeLayer: props.insertBeforeLayer })),
|
|
2515
2784
|
isFollowed && orientationCone && (React__default["default"].createElement(MlGeoJsonLayer, { geojson: orientationCone, type: 'fill', paint: __assign({ 'fill-color': '#0000ff', 'fill-antialias': false, 'fill-opacity': 0.3 }, props.orientationConePaint), insertBeforeLayer: props.insertBeforeLayer })),
|
|
2516
2785
|
isFollowed && userLocationGeoJson && (React__default["default"].createElement(MlGeoJsonLayer, { geojson: userLocationGeoJson, type: 'circle', paint: __assign({ 'circle-color': '#009ee0', 'circle-radius': 5, 'circle-stroke-color': '#fafaff', 'circle-stroke-width': 1 }, props.circlePaint), insertBeforeLayer: props.insertBeforeLayer })),
|
|
2517
2786
|
React__default["default"].createElement(material.Button, { variant: "navtools", sx: {
|
|
2518
2787
|
zIndex: 1002,
|
|
2519
|
-
color: isFollowed
|
|
2788
|
+
color: isFollowed
|
|
2789
|
+
? function (theme) { return theme.palette.GPS.GPSActiveColor; }
|
|
2790
|
+
: function (theme) { return theme.palette.GPS.GPSInactiveColor; },
|
|
2791
|
+
backgroundColor: isFollowed
|
|
2792
|
+
? function (theme) { return theme.palette.GPS.GPSActiveBackgroundColor; }
|
|
2793
|
+
: function (theme) { return theme.palette.navigation.navColor; },
|
|
2520
2794
|
}, disabled: locationAccessDenied, onClick: function () {
|
|
2521
2795
|
setIsFollowed(!isFollowed);
|
|
2522
2796
|
} },
|
|
@@ -2524,7 +2798,6 @@ var MlFollowGps = function (props) {
|
|
|
2524
2798
|
};
|
|
2525
2799
|
MlFollowGps.defaultProps = {
|
|
2526
2800
|
mapId: undefined,
|
|
2527
|
-
onColor: '#ececec',
|
|
2528
2801
|
offColor: '#666',
|
|
2529
2802
|
showAccuracyCircle: true,
|
|
2530
2803
|
showUserLocation: true,
|
|
@@ -2660,7 +2933,7 @@ var SvgCompassBackground = function SvgCompassBackground(props) {
|
|
|
2660
2933
|
})));
|
|
2661
2934
|
};
|
|
2662
2935
|
|
|
2663
|
-
var
|
|
2936
|
+
var BoxStyled$2 = material.styled(material.Box)(function (_a) {
|
|
2664
2937
|
var _b;
|
|
2665
2938
|
var theme = _a.theme;
|
|
2666
2939
|
return (_b = {
|
|
@@ -2673,7 +2946,7 @@ var StyleBox = material.styled('div')(function (_a) {
|
|
|
2673
2946
|
},
|
|
2674
2947
|
_b);
|
|
2675
2948
|
});
|
|
2676
|
-
var CompassBox = material.styled(
|
|
2949
|
+
var CompassBox = material.styled(material.Box)(function (_a) {
|
|
2677
2950
|
var _b;
|
|
2678
2951
|
var theme = _a.theme;
|
|
2679
2952
|
return (_b = {
|
|
@@ -2687,16 +2960,29 @@ var CompassBox = material.styled('div')(function (_a) {
|
|
|
2687
2960
|
},
|
|
2688
2961
|
_b.circle = {
|
|
2689
2962
|
fill: theme.palette.compass.compColor,
|
|
2963
|
+
stroke: theme.palette.compass.compStroke,
|
|
2964
|
+
},
|
|
2965
|
+
_b.path = {
|
|
2966
|
+
fill: theme.palette.compass.compStroke,
|
|
2690
2967
|
},
|
|
2691
2968
|
_b['&:hover circle'] = {
|
|
2692
2969
|
fill: theme.palette.compass.compHover,
|
|
2693
2970
|
},
|
|
2694
2971
|
_b);
|
|
2695
2972
|
});
|
|
2696
|
-
var NeedleBox = material.styled(
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2973
|
+
var NeedleBox = material.styled(material.Box)(function (_a) {
|
|
2974
|
+
var theme = _a.theme;
|
|
2975
|
+
return ({
|
|
2976
|
+
position: 'absolute',
|
|
2977
|
+
right: '21.4px',
|
|
2978
|
+
top: '6px',
|
|
2979
|
+
'path:nth-of-type(2)': {
|
|
2980
|
+
fill: theme.palette.compass.compSouth,
|
|
2981
|
+
},
|
|
2982
|
+
'path:nth-of-type(1)': {
|
|
2983
|
+
fill: theme.palette.compass.compNorth,
|
|
2984
|
+
},
|
|
2985
|
+
});
|
|
2700
2986
|
});
|
|
2701
2987
|
/**
|
|
2702
2988
|
* Navigation component that displays a compass component which indicates the current oriantation of the map it is registered for and offers controls to turn the bearing 90° left/right or reset north to point up.
|
|
@@ -2743,7 +3029,7 @@ var MlNavigationCompass = function (props) {
|
|
|
2743
3029
|
}
|
|
2744
3030
|
};
|
|
2745
3031
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2746
|
-
React__default["default"].createElement(
|
|
3032
|
+
React__default["default"].createElement(BoxStyled$2, { sx: __assign({}, props.style) },
|
|
2747
3033
|
React__default["default"].createElement(CompassBox, { onClick: rotate, sx: __assign({}, props.backgroundStyle) },
|
|
2748
3034
|
React__default["default"].createElement(SvgCompassBackground, null),
|
|
2749
3035
|
React__default["default"].createElement(NeedleBox, { onClick: rotate, sx: __assign({}, props.needleStyle) },
|
|
@@ -2768,36 +3054,34 @@ var MlNavigationTools = function (props) {
|
|
|
2768
3054
|
mapHook.map.on('pitchend', function () {
|
|
2769
3055
|
if (!mapHook.map)
|
|
2770
3056
|
return;
|
|
2771
|
-
setPitch(mapHook.map.
|
|
3057
|
+
setPitch(mapHook.map.getPitch());
|
|
2772
3058
|
}, mapHook.componentId);
|
|
2773
|
-
setPitch(mapHook.map.
|
|
3059
|
+
setPitch(mapHook.map.getPitch());
|
|
2774
3060
|
}, [mapHook.map, props.mapId]);
|
|
2775
3061
|
var zoomIn = React.useCallback(function () {
|
|
2776
3062
|
if (!mapHook.map)
|
|
2777
3063
|
return;
|
|
2778
|
-
if (mapHook.map.
|
|
2779
|
-
mapHook.map.
|
|
3064
|
+
if (mapHook.map.transform._zoom + 0.5 <= mapHook.map.transform._maxZoom) {
|
|
3065
|
+
mapHook.map.easeTo({ zoom: mapHook.map.transform._zoom + 0.5 });
|
|
2780
3066
|
}
|
|
2781
3067
|
}, [mapHook.map]);
|
|
2782
3068
|
var zoomOut = React.useCallback(function () {
|
|
2783
3069
|
if (!mapHook.map)
|
|
2784
3070
|
return;
|
|
2785
|
-
if (mapHook.map.
|
|
2786
|
-
mapHook.map.
|
|
3071
|
+
if (mapHook.map.transform._zoom - 0.5 >= mapHook.map.transform._minZoom) {
|
|
3072
|
+
mapHook.map.easeTo({ zoom: mapHook.map.transform._zoom - 0.5 });
|
|
2787
3073
|
}
|
|
2788
3074
|
}, [mapHook.map]);
|
|
2789
3075
|
var adjustPitch = React.useCallback(function () {
|
|
2790
3076
|
if (!mapHook.map)
|
|
2791
3077
|
return;
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
}
|
|
2796
|
-
mapHook.map.map.easeTo({ pitch: targetPitch });
|
|
3078
|
+
setPitch(mapHook.map.getPitch());
|
|
3079
|
+
var targetPitch = mapHook.map.getPitch() !== 0 ? 0 : 60;
|
|
3080
|
+
mapHook.map.easeTo({ pitch: targetPitch });
|
|
2797
3081
|
}, [mapHook.map]);
|
|
2798
|
-
return (React__default["default"].createElement(Box__default["default"], { sx: __assign(__assign({ zIndex: 501, position: 'absolute', display: 'flex', flexDirection: 'column', right: mediaIsMobile ? '15px' : '25px', bottom: mediaIsMobile ? '20px' : '30px' }, (mediaIsMobile ? { margin: '80px 10px
|
|
3082
|
+
return (React__default["default"].createElement(Box__default["default"], { sx: __assign(__assign({ zIndex: 501, position: 'absolute', display: 'flex', flexDirection: 'column', right: mediaIsMobile ? '15px' : '25px', bottom: mediaIsMobile ? '20px' : '30px' }, (mediaIsMobile ? { margin: '80px 10px 50px 10px' } : { marginTop: '50px' })), props.sx) },
|
|
2799
3083
|
React__default["default"].createElement(MlNavigationCompass, null),
|
|
2800
|
-
props.show3DButton && (React__default["default"].createElement(Button__default["default"], { variant: "navtools", onClick: adjustPitch }, pitch ? '
|
|
3084
|
+
props.show3DButton && (React__default["default"].createElement(Button__default["default"], { variant: "navtools", onClick: adjustPitch }, pitch < 59 ? '3D' : '2D')),
|
|
2801
3085
|
props.showFollowGpsButton && React__default["default"].createElement(MlFollowGps, null),
|
|
2802
3086
|
props.showCenterLocationButton && React__default["default"].createElement(MlCenterPosition, null),
|
|
2803
3087
|
React__default["default"].createElement(ButtonGroup__default["default"], { orientation: "vertical", sx: {
|
|
@@ -3134,6 +3418,25 @@ var MlLayerSwipe = function (props) {
|
|
|
3134
3418
|
document.removeEventListener('mousemove', onMove);
|
|
3135
3419
|
document.removeEventListener('mouseup', onMouseUp);
|
|
3136
3420
|
};
|
|
3421
|
+
function adjustWindowSize() {
|
|
3422
|
+
var clipWidth = mapContext.maps[props.map2Id].getContainer().style.clip.split(',')[1].replace('px', '');
|
|
3423
|
+
var canvasWidth = mapContext.maps[props.map1Id].getCanvas().getBoundingClientRect().width;
|
|
3424
|
+
if (parseFloat(clipWidth) < canvasWidth) {
|
|
3425
|
+
var newPosition = parseFloat(((clipWidth / canvasWidth) * 100).toFixed(2));
|
|
3426
|
+
setSwipeX(newPosition);
|
|
3427
|
+
}
|
|
3428
|
+
else {
|
|
3429
|
+
var newClip = 'rect(0, ' + canvasWidth / 2 + 'px, 999em, 0)';
|
|
3430
|
+
mapContext.maps[props.map2Id].getContainer().style.clip = newClip;
|
|
3431
|
+
setSwipeX(50);
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
React.useEffect(function () {
|
|
3435
|
+
window.addEventListener('resize', adjustWindowSize);
|
|
3436
|
+
return function () {
|
|
3437
|
+
window.removeEventListener('resize', adjustWindowSize);
|
|
3438
|
+
};
|
|
3439
|
+
}, [mapContext]);
|
|
3137
3440
|
return (React__default["default"].createElement("div", { style: __assign({ position: 'absolute', left: swipeX + '%', top: '50%', borderRadius: '50%', width: '100px', height: '100px', background: '#0066ff', border: '3px solid #eaebf1', cursor: 'pointer', zIndex: '110', marginLeft: '-50px', marginTop: '-50px', textAlign: 'center', lineHeight: '91px', fontSize: '2em', color: '#fafafa', userSelect: 'none' }, props.buttonStyle), onTouchStart: onDown, onMouseDown: onDown }));
|
|
3138
3441
|
};
|
|
3139
3442
|
MlLayerSwipe.defaultProps = {
|
|
@@ -3634,7 +3937,7 @@ var toGeoJSON = function () {
|
|
|
3634
3937
|
if (x) {
|
|
3635
3938
|
norm(x);
|
|
3636
3939
|
}
|
|
3637
|
-
return x && x.textContent ||
|
|
3940
|
+
return x && x.textContent || '';
|
|
3638
3941
|
}
|
|
3639
3942
|
// get the contents of multiple text nodes, if present
|
|
3640
3943
|
function getMulti(x, ys) {
|
|
@@ -3653,11 +3956,11 @@ var toGeoJSON = function () {
|
|
|
3653
3956
|
}
|
|
3654
3957
|
// get one coordinate from a coordinate array, if any
|
|
3655
3958
|
function coord1(v) {
|
|
3656
|
-
return numarray(v.replace(removeSpace,
|
|
3959
|
+
return numarray(v.replace(removeSpace, '').split(','));
|
|
3657
3960
|
}
|
|
3658
3961
|
// get all coordinates from a coordinate array as [[],[]]
|
|
3659
3962
|
function coord(v) {
|
|
3660
|
-
var coords = v.replace(trimSpace,
|
|
3963
|
+
var coords = v.replace(trimSpace, '').split(splitSpace),
|
|
3661
3964
|
o = [];
|
|
3662
3965
|
for (var i = 0; i < coords.length; i++) {
|
|
3663
3966
|
o.push(coord1(coords[i]));
|
|
@@ -3665,11 +3968,11 @@ var toGeoJSON = function () {
|
|
|
3665
3968
|
return o;
|
|
3666
3969
|
}
|
|
3667
3970
|
function coordPair(x) {
|
|
3668
|
-
var ll = [attrf(x,
|
|
3669
|
-
ele = get1(x,
|
|
3971
|
+
var ll = [attrf(x, 'lon'), attrf(x, 'lat')],
|
|
3972
|
+
ele = get1(x, 'ele'),
|
|
3670
3973
|
// handle namespaced attribute in browser
|
|
3671
|
-
heartRate = get1(x,
|
|
3672
|
-
time = get1(x,
|
|
3974
|
+
heartRate = get1(x, 'gpxtpx:hr') || get1(x, 'hr'),
|
|
3975
|
+
time = get1(x, 'time'),
|
|
3673
3976
|
e;
|
|
3674
3977
|
if (ele) {
|
|
3675
3978
|
e = parseFloat(nodeVal(ele));
|
|
@@ -3687,22 +3990,21 @@ var toGeoJSON = function () {
|
|
|
3687
3990
|
// create a new feature collection parent object
|
|
3688
3991
|
function fc() {
|
|
3689
3992
|
return {
|
|
3690
|
-
type:
|
|
3993
|
+
type: 'FeatureCollection',
|
|
3691
3994
|
features: []
|
|
3692
3995
|
};
|
|
3693
3996
|
}
|
|
3694
3997
|
var serializer;
|
|
3695
|
-
if (typeof XMLSerializer !==
|
|
3998
|
+
if (typeof XMLSerializer !== 'undefined') {
|
|
3696
3999
|
/* istanbul ignore next */
|
|
3697
4000
|
serializer = new XMLSerializer();
|
|
3698
4001
|
} else {
|
|
3699
|
-
var isNodeEnv = (typeof process === "undefined" ? "undefined" : _typeof(process)) ===
|
|
3700
|
-
var isTitaniumEnv = (typeof Titanium === "undefined" ? "undefined" : _typeof(Titanium)) ===
|
|
3701
|
-
if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) ===
|
|
3702
|
-
|
|
3703
|
-
serializer = new (require("xmldom").XMLSerializer)();
|
|
4002
|
+
var isNodeEnv = (typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object' && !process.browser;
|
|
4003
|
+
var isTitaniumEnv = (typeof Titanium === "undefined" ? "undefined" : _typeof(Titanium)) === 'object';
|
|
4004
|
+
if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && (isNodeEnv || isTitaniumEnv)) {
|
|
4005
|
+
serializer = xmldom__namespace.XMLSerializer;
|
|
3704
4006
|
} else {
|
|
3705
|
-
throw new Error(
|
|
4007
|
+
throw new Error('Unable to initialize serializer');
|
|
3706
4008
|
}
|
|
3707
4009
|
}
|
|
3708
4010
|
function xml2str(str) {
|
|
@@ -3722,32 +4024,32 @@ var toGeoJSON = function () {
|
|
|
3722
4024
|
styleMapIndex = {},
|
|
3723
4025
|
// atomic geospatial types supported by KML - MultiGeometry is
|
|
3724
4026
|
// handled separately
|
|
3725
|
-
geotypes = [
|
|
4027
|
+
geotypes = ['Polygon', 'LineString', 'Point', 'Track', 'gx:Track'],
|
|
3726
4028
|
// all root placemarks in the file
|
|
3727
|
-
placemarks = get(doc,
|
|
3728
|
-
styles = get(doc,
|
|
3729
|
-
styleMaps = get(doc,
|
|
4029
|
+
placemarks = get(doc, 'Placemark'),
|
|
4030
|
+
styles = get(doc, 'Style'),
|
|
4031
|
+
styleMaps = get(doc, 'StyleMap');
|
|
3730
4032
|
for (var k = 0; k < styles.length; k++) {
|
|
3731
4033
|
var hash = okhash(xml2str(styles[k])).toString(16);
|
|
3732
|
-
styleIndex[
|
|
4034
|
+
styleIndex['#' + attr(styles[k], 'id')] = hash;
|
|
3733
4035
|
styleByHash[hash] = styles[k];
|
|
3734
4036
|
}
|
|
3735
4037
|
for (var l = 0; l < styleMaps.length; l++) {
|
|
3736
|
-
styleIndex[
|
|
3737
|
-
var pairs = get(styleMaps[l],
|
|
4038
|
+
styleIndex['#' + attr(styleMaps[l], 'id')] = okhash(xml2str(styleMaps[l])).toString(16);
|
|
4039
|
+
var pairs = get(styleMaps[l], 'Pair');
|
|
3738
4040
|
var pairsMap = {};
|
|
3739
4041
|
for (var m = 0; m < pairs.length; m++) {
|
|
3740
|
-
pairsMap[nodeVal(get1(pairs[m],
|
|
4042
|
+
pairsMap[nodeVal(get1(pairs[m], 'key'))] = nodeVal(get1(pairs[m], 'styleUrl'));
|
|
3741
4043
|
}
|
|
3742
|
-
styleMapIndex[
|
|
4044
|
+
styleMapIndex['#' + attr(styleMaps[l], 'id')] = pairsMap;
|
|
3743
4045
|
}
|
|
3744
4046
|
for (var j = 0; j < placemarks.length; j++) {
|
|
3745
4047
|
gj.features = gj.features.concat(getPlacemark(placemarks[j]));
|
|
3746
4048
|
}
|
|
3747
4049
|
function kmlColor(v) {
|
|
3748
4050
|
var color, opacity;
|
|
3749
|
-
v = v ||
|
|
3750
|
-
if (v.substr(0, 1) ===
|
|
4051
|
+
v = v || '';
|
|
4052
|
+
if (v.substr(0, 1) === '#') {
|
|
3751
4053
|
v = v.substr(1);
|
|
3752
4054
|
}
|
|
3753
4055
|
if (v.length === 6 || v.length === 3) {
|
|
@@ -3755,20 +4057,20 @@ var toGeoJSON = function () {
|
|
|
3755
4057
|
}
|
|
3756
4058
|
if (v.length === 8) {
|
|
3757
4059
|
opacity = parseInt(v.substr(0, 2), 16) / 255;
|
|
3758
|
-
color =
|
|
4060
|
+
color = '#' + v.substr(6, 2) + v.substr(4, 2) + v.substr(2, 2);
|
|
3759
4061
|
}
|
|
3760
4062
|
return [color, isNaN(opacity) ? undefined : opacity];
|
|
3761
4063
|
}
|
|
3762
4064
|
function gxCoord(v) {
|
|
3763
|
-
return numarray(v.split(
|
|
4065
|
+
return numarray(v.split(' '));
|
|
3764
4066
|
}
|
|
3765
4067
|
function gxCoords(root) {
|
|
3766
|
-
var elems = get(root,
|
|
4068
|
+
var elems = get(root, 'coord'),
|
|
3767
4069
|
coords = [],
|
|
3768
4070
|
times = [];
|
|
3769
|
-
if (elems.length === 0) elems = get(root,
|
|
4071
|
+
if (elems.length === 0) elems = get(root, 'gx:coord');
|
|
3770
4072
|
for (var i = 0; i < elems.length; i++) coords.push(gxCoord(nodeVal(elems[i])));
|
|
3771
|
-
var timeElems = get(root,
|
|
4073
|
+
var timeElems = get(root, 'when');
|
|
3772
4074
|
for (var j = 0; j < timeElems.length; j++) times.push(nodeVal(timeElems[j]));
|
|
3773
4075
|
return {
|
|
3774
4076
|
coords: coords,
|
|
@@ -3783,44 +4085,44 @@ var toGeoJSON = function () {
|
|
|
3783
4085
|
k,
|
|
3784
4086
|
geoms = [],
|
|
3785
4087
|
coordTimes = [];
|
|
3786
|
-
if (get1(root,
|
|
3787
|
-
return getGeometry(get1(root,
|
|
4088
|
+
if (get1(root, 'MultiGeometry')) {
|
|
4089
|
+
return getGeometry(get1(root, 'MultiGeometry'));
|
|
3788
4090
|
}
|
|
3789
|
-
if (get1(root,
|
|
3790
|
-
return getGeometry(get1(root,
|
|
4091
|
+
if (get1(root, 'MultiTrack')) {
|
|
4092
|
+
return getGeometry(get1(root, 'MultiTrack'));
|
|
3791
4093
|
}
|
|
3792
|
-
if (get1(root,
|
|
3793
|
-
return getGeometry(get1(root,
|
|
4094
|
+
if (get1(root, 'gx:MultiTrack')) {
|
|
4095
|
+
return getGeometry(get1(root, 'gx:MultiTrack'));
|
|
3794
4096
|
}
|
|
3795
4097
|
for (i = 0; i < geotypes.length; i++) {
|
|
3796
4098
|
geomNodes = get(root, geotypes[i]);
|
|
3797
4099
|
if (geomNodes) {
|
|
3798
4100
|
for (j = 0; j < geomNodes.length; j++) {
|
|
3799
4101
|
geomNode = geomNodes[j];
|
|
3800
|
-
if (geotypes[i] ===
|
|
4102
|
+
if (geotypes[i] === 'Point') {
|
|
3801
4103
|
geoms.push({
|
|
3802
|
-
type:
|
|
3803
|
-
coordinates: coord1(nodeVal(get1(geomNode,
|
|
4104
|
+
type: 'Point',
|
|
4105
|
+
coordinates: coord1(nodeVal(get1(geomNode, 'coordinates')))
|
|
3804
4106
|
});
|
|
3805
|
-
} else if (geotypes[i] ===
|
|
4107
|
+
} else if (geotypes[i] === 'LineString') {
|
|
3806
4108
|
geoms.push({
|
|
3807
|
-
type:
|
|
3808
|
-
coordinates: coord(nodeVal(get1(geomNode,
|
|
4109
|
+
type: 'LineString',
|
|
4110
|
+
coordinates: coord(nodeVal(get1(geomNode, 'coordinates')))
|
|
3809
4111
|
});
|
|
3810
|
-
} else if (geotypes[i] ===
|
|
3811
|
-
var rings = get(geomNode,
|
|
4112
|
+
} else if (geotypes[i] === 'Polygon') {
|
|
4113
|
+
var rings = get(geomNode, 'LinearRing'),
|
|
3812
4114
|
coords = [];
|
|
3813
4115
|
for (k = 0; k < rings.length; k++) {
|
|
3814
|
-
coords.push(coord(nodeVal(get1(rings[k],
|
|
4116
|
+
coords.push(coord(nodeVal(get1(rings[k], 'coordinates'))));
|
|
3815
4117
|
}
|
|
3816
4118
|
geoms.push({
|
|
3817
|
-
type:
|
|
4119
|
+
type: 'Polygon',
|
|
3818
4120
|
coordinates: coords
|
|
3819
4121
|
});
|
|
3820
|
-
} else if (geotypes[i] ===
|
|
4122
|
+
} else if (geotypes[i] === 'Track' || geotypes[i] === 'gx:Track') {
|
|
3821
4123
|
var track = gxCoords(geomNode);
|
|
3822
4124
|
geoms.push({
|
|
3823
|
-
type:
|
|
4125
|
+
type: 'LineString',
|
|
3824
4126
|
coordinates: track.coords
|
|
3825
4127
|
});
|
|
3826
4128
|
if (track.times.length) coordTimes.push(track.times);
|
|
@@ -3837,22 +4139,22 @@ var toGeoJSON = function () {
|
|
|
3837
4139
|
var geomsAndTimes = getGeometry(root),
|
|
3838
4140
|
i,
|
|
3839
4141
|
properties = {},
|
|
3840
|
-
name = nodeVal(get1(root,
|
|
3841
|
-
address = nodeVal(get1(root,
|
|
3842
|
-
styleUrl = nodeVal(get1(root,
|
|
3843
|
-
description = nodeVal(get1(root,
|
|
3844
|
-
timeSpan = get1(root,
|
|
3845
|
-
timeStamp = get1(root,
|
|
3846
|
-
extendedData = get1(root,
|
|
3847
|
-
lineStyle = get1(root,
|
|
3848
|
-
polyStyle = get1(root,
|
|
3849
|
-
visibility = get1(root,
|
|
4142
|
+
name = nodeVal(get1(root, 'name')),
|
|
4143
|
+
address = nodeVal(get1(root, 'address')),
|
|
4144
|
+
styleUrl = nodeVal(get1(root, 'styleUrl')),
|
|
4145
|
+
description = nodeVal(get1(root, 'description')),
|
|
4146
|
+
timeSpan = get1(root, 'TimeSpan'),
|
|
4147
|
+
timeStamp = get1(root, 'TimeStamp'),
|
|
4148
|
+
extendedData = get1(root, 'ExtendedData'),
|
|
4149
|
+
lineStyle = get1(root, 'LineStyle'),
|
|
4150
|
+
polyStyle = get1(root, 'PolyStyle'),
|
|
4151
|
+
visibility = get1(root, 'visibility');
|
|
3850
4152
|
if (!geomsAndTimes.geoms.length) return [];
|
|
3851
4153
|
if (name) properties.name = name;
|
|
3852
4154
|
if (address) properties.address = address;
|
|
3853
4155
|
if (styleUrl) {
|
|
3854
|
-
if (styleUrl[0] !==
|
|
3855
|
-
styleUrl =
|
|
4156
|
+
if (styleUrl[0] !== '#') {
|
|
4157
|
+
styleUrl = '#' + styleUrl;
|
|
3856
4158
|
}
|
|
3857
4159
|
properties.styleUrl = styleUrl;
|
|
3858
4160
|
if (styleIndex[styleUrl]) {
|
|
@@ -3865,13 +4167,13 @@ var toGeoJSON = function () {
|
|
|
3865
4167
|
// Try to populate the lineStyle or polyStyle since we got the style hash
|
|
3866
4168
|
var style = styleByHash[properties.styleHash];
|
|
3867
4169
|
if (style) {
|
|
3868
|
-
if (!lineStyle) lineStyle = get1(style,
|
|
3869
|
-
if (!polyStyle) polyStyle = get1(style,
|
|
3870
|
-
var iconStyle = get1(style,
|
|
4170
|
+
if (!lineStyle) lineStyle = get1(style, 'LineStyle');
|
|
4171
|
+
if (!polyStyle) polyStyle = get1(style, 'PolyStyle');
|
|
4172
|
+
var iconStyle = get1(style, 'IconStyle');
|
|
3871
4173
|
if (iconStyle) {
|
|
3872
|
-
var icon = get1(iconStyle,
|
|
4174
|
+
var icon = get1(iconStyle, 'Icon');
|
|
3873
4175
|
if (icon) {
|
|
3874
|
-
var href = nodeVal(get1(icon,
|
|
4176
|
+
var href = nodeVal(get1(icon, 'href'));
|
|
3875
4177
|
if (href) properties.icon = href;
|
|
3876
4178
|
}
|
|
3877
4179
|
}
|
|
@@ -3879,44 +4181,44 @@ var toGeoJSON = function () {
|
|
|
3879
4181
|
}
|
|
3880
4182
|
if (description) properties.description = description;
|
|
3881
4183
|
if (timeSpan) {
|
|
3882
|
-
var begin = nodeVal(get1(timeSpan,
|
|
3883
|
-
var end = nodeVal(get1(timeSpan,
|
|
4184
|
+
var begin = nodeVal(get1(timeSpan, 'begin'));
|
|
4185
|
+
var end = nodeVal(get1(timeSpan, 'end'));
|
|
3884
4186
|
properties.timespan = {
|
|
3885
4187
|
begin: begin,
|
|
3886
4188
|
end: end
|
|
3887
4189
|
};
|
|
3888
4190
|
}
|
|
3889
4191
|
if (timeStamp) {
|
|
3890
|
-
properties.timestamp = nodeVal(get1(timeStamp,
|
|
4192
|
+
properties.timestamp = nodeVal(get1(timeStamp, 'when'));
|
|
3891
4193
|
}
|
|
3892
4194
|
if (lineStyle) {
|
|
3893
|
-
var linestyles = kmlColor(nodeVal(get1(lineStyle,
|
|
4195
|
+
var linestyles = kmlColor(nodeVal(get1(lineStyle, 'color'))),
|
|
3894
4196
|
color = linestyles[0],
|
|
3895
4197
|
opacity = linestyles[1],
|
|
3896
|
-
width = parseFloat(nodeVal(get1(lineStyle,
|
|
4198
|
+
width = parseFloat(nodeVal(get1(lineStyle, 'width')));
|
|
3897
4199
|
if (color) properties.stroke = color;
|
|
3898
|
-
if (!isNaN(opacity)) properties[
|
|
3899
|
-
if (!isNaN(width)) properties[
|
|
4200
|
+
if (!isNaN(opacity)) properties['stroke-opacity'] = opacity;
|
|
4201
|
+
if (!isNaN(width)) properties['stroke-width'] = width;
|
|
3900
4202
|
}
|
|
3901
4203
|
if (polyStyle) {
|
|
3902
|
-
var polystyles = kmlColor(nodeVal(get1(polyStyle,
|
|
4204
|
+
var polystyles = kmlColor(nodeVal(get1(polyStyle, 'color'))),
|
|
3903
4205
|
pcolor = polystyles[0],
|
|
3904
4206
|
popacity = polystyles[1],
|
|
3905
|
-
fill = nodeVal(get1(polyStyle,
|
|
3906
|
-
outline = nodeVal(get1(polyStyle,
|
|
4207
|
+
fill = nodeVal(get1(polyStyle, 'fill')),
|
|
4208
|
+
outline = nodeVal(get1(polyStyle, 'outline'));
|
|
3907
4209
|
if (pcolor) properties.fill = pcolor;
|
|
3908
|
-
if (!isNaN(popacity)) properties[
|
|
3909
|
-
if (fill) properties[
|
|
3910
|
-
if (outline) properties[
|
|
4210
|
+
if (!isNaN(popacity)) properties['fill-opacity'] = popacity;
|
|
4211
|
+
if (fill) properties['fill-opacity'] = fill === '1' ? properties['fill-opacity'] || 1 : 0;
|
|
4212
|
+
if (outline) properties['stroke-opacity'] = outline === '1' ? properties['stroke-opacity'] || 1 : 0;
|
|
3911
4213
|
}
|
|
3912
4214
|
if (extendedData) {
|
|
3913
|
-
var datas = get(extendedData,
|
|
3914
|
-
simpleDatas = get(extendedData,
|
|
4215
|
+
var datas = get(extendedData, 'Data'),
|
|
4216
|
+
simpleDatas = get(extendedData, 'SimpleData');
|
|
3915
4217
|
for (i = 0; i < datas.length; i++) {
|
|
3916
|
-
properties[datas[i].getAttribute(
|
|
4218
|
+
properties[datas[i].getAttribute('name')] = nodeVal(get1(datas[i], 'value'));
|
|
3917
4219
|
}
|
|
3918
4220
|
for (i = 0; i < simpleDatas.length; i++) {
|
|
3919
|
-
properties[simpleDatas[i].getAttribute(
|
|
4221
|
+
properties[simpleDatas[i].getAttribute('name')] = nodeVal(simpleDatas[i]);
|
|
3920
4222
|
}
|
|
3921
4223
|
}
|
|
3922
4224
|
if (visibility) {
|
|
@@ -3926,23 +4228,23 @@ var toGeoJSON = function () {
|
|
|
3926
4228
|
properties.coordTimes = geomsAndTimes.coordTimes.length === 1 ? geomsAndTimes.coordTimes[0] : geomsAndTimes.coordTimes;
|
|
3927
4229
|
}
|
|
3928
4230
|
var feature = {
|
|
3929
|
-
type:
|
|
4231
|
+
type: 'Feature',
|
|
3930
4232
|
geometry: geomsAndTimes.geoms.length === 1 ? geomsAndTimes.geoms[0] : {
|
|
3931
|
-
type:
|
|
4233
|
+
type: 'GeometryCollection',
|
|
3932
4234
|
geometries: geomsAndTimes.geoms
|
|
3933
4235
|
},
|
|
3934
4236
|
properties: properties
|
|
3935
4237
|
};
|
|
3936
|
-
if (attr(root,
|
|
4238
|
+
if (attr(root, 'id')) feature.id = attr(root, 'id');
|
|
3937
4239
|
return [feature];
|
|
3938
4240
|
}
|
|
3939
4241
|
return gj;
|
|
3940
4242
|
},
|
|
3941
4243
|
gpx: function gpx(doc) {
|
|
3942
4244
|
var i,
|
|
3943
|
-
tracks = get(doc,
|
|
3944
|
-
routes = get(doc,
|
|
3945
|
-
waypoints = get(doc,
|
|
4245
|
+
tracks = get(doc, 'trk'),
|
|
4246
|
+
routes = get(doc, 'rte'),
|
|
4247
|
+
waypoints = get(doc, 'wpt'),
|
|
3946
4248
|
// a feature collection
|
|
3947
4249
|
gj = fc(),
|
|
3948
4250
|
feature;
|
|
@@ -3986,13 +4288,13 @@ var toGeoJSON = function () {
|
|
|
3986
4288
|
};
|
|
3987
4289
|
}
|
|
3988
4290
|
function getTrack(node) {
|
|
3989
|
-
var segments = get(node,
|
|
4291
|
+
var segments = get(node, 'trkseg'),
|
|
3990
4292
|
track = [],
|
|
3991
4293
|
times = [],
|
|
3992
4294
|
heartRates = [],
|
|
3993
4295
|
line;
|
|
3994
4296
|
for (var i = 0; i < segments.length; i++) {
|
|
3995
|
-
line = getPoints(segments[i],
|
|
4297
|
+
line = getPoints(segments[i], 'trkpt');
|
|
3996
4298
|
if (line) {
|
|
3997
4299
|
if (line.line) track.push(line.line);
|
|
3998
4300
|
if (line.times && line.times.length) times.push(line.times);
|
|
@@ -4012,28 +4314,28 @@ var toGeoJSON = function () {
|
|
|
4012
4314
|
}
|
|
4013
4315
|
if (track.length === 0) return;
|
|
4014
4316
|
var properties = getProperties(node);
|
|
4015
|
-
extend(properties, getLineStyle(get1(node,
|
|
4317
|
+
extend(properties, getLineStyle(get1(node, 'extensions')));
|
|
4016
4318
|
if (times.length) properties.coordTimes = track.length === 1 ? times[0] : times;
|
|
4017
4319
|
if (heartRates.length) properties.heartRates = track.length === 1 ? heartRates[0] : heartRates;
|
|
4018
4320
|
return {
|
|
4019
|
-
type:
|
|
4321
|
+
type: 'Feature',
|
|
4020
4322
|
properties: properties,
|
|
4021
4323
|
geometry: {
|
|
4022
|
-
type: track.length === 1 ?
|
|
4324
|
+
type: track.length === 1 ? 'LineString' : 'MultiLineString',
|
|
4023
4325
|
coordinates: track.length === 1 ? track[0] : track
|
|
4024
4326
|
}
|
|
4025
4327
|
};
|
|
4026
4328
|
}
|
|
4027
4329
|
function getRoute(node) {
|
|
4028
|
-
var line = getPoints(node,
|
|
4330
|
+
var line = getPoints(node, 'rtept');
|
|
4029
4331
|
if (!line.line) return;
|
|
4030
4332
|
var prop = getProperties(node);
|
|
4031
|
-
extend(prop, getLineStyle(get1(node,
|
|
4333
|
+
extend(prop, getLineStyle(get1(node, 'extensions')));
|
|
4032
4334
|
var routeObj = {
|
|
4033
|
-
type:
|
|
4335
|
+
type: 'Feature',
|
|
4034
4336
|
properties: prop,
|
|
4035
4337
|
geometry: {
|
|
4036
|
-
type:
|
|
4338
|
+
type: 'LineString',
|
|
4037
4339
|
coordinates: line.line
|
|
4038
4340
|
}
|
|
4039
4341
|
};
|
|
@@ -4041,12 +4343,12 @@ var toGeoJSON = function () {
|
|
|
4041
4343
|
}
|
|
4042
4344
|
function getPoint(node) {
|
|
4043
4345
|
var prop = getProperties(node);
|
|
4044
|
-
extend(prop, getMulti(node, [
|
|
4346
|
+
extend(prop, getMulti(node, ['sym']));
|
|
4045
4347
|
return {
|
|
4046
|
-
type:
|
|
4348
|
+
type: 'Feature',
|
|
4047
4349
|
properties: prop,
|
|
4048
4350
|
geometry: {
|
|
4049
|
-
type:
|
|
4351
|
+
type: 'Point',
|
|
4050
4352
|
coordinates: coordPair(node).coordinates
|
|
4051
4353
|
}
|
|
4052
4354
|
};
|
|
@@ -4054,28 +4356,28 @@ var toGeoJSON = function () {
|
|
|
4054
4356
|
function getLineStyle(extensions) {
|
|
4055
4357
|
var style = {};
|
|
4056
4358
|
if (extensions) {
|
|
4057
|
-
var lineStyle = get1(extensions,
|
|
4359
|
+
var lineStyle = get1(extensions, 'line');
|
|
4058
4360
|
if (lineStyle) {
|
|
4059
|
-
var color = nodeVal(get1(lineStyle,
|
|
4060
|
-
opacity = parseFloat(nodeVal(get1(lineStyle,
|
|
4061
|
-
width = parseFloat(nodeVal(get1(lineStyle,
|
|
4361
|
+
var color = nodeVal(get1(lineStyle, 'color')),
|
|
4362
|
+
opacity = parseFloat(nodeVal(get1(lineStyle, 'opacity'))),
|
|
4363
|
+
width = parseFloat(nodeVal(get1(lineStyle, 'width')));
|
|
4062
4364
|
if (color) style.stroke = color;
|
|
4063
|
-
if (!isNaN(opacity)) style[
|
|
4365
|
+
if (!isNaN(opacity)) style['stroke-opacity'] = opacity;
|
|
4064
4366
|
// GPX width is in mm, convert to px with 96 px per inch
|
|
4065
|
-
if (!isNaN(width)) style[
|
|
4367
|
+
if (!isNaN(width)) style['stroke-width'] = width * 96 / 25.4;
|
|
4066
4368
|
}
|
|
4067
4369
|
}
|
|
4068
4370
|
return style;
|
|
4069
4371
|
}
|
|
4070
4372
|
function getProperties(node) {
|
|
4071
|
-
var prop = getMulti(node, [
|
|
4072
|
-
links = get(node,
|
|
4373
|
+
var prop = getMulti(node, ['name', 'cmt', 'desc', 'type', 'time', 'keywords']),
|
|
4374
|
+
links = get(node, 'link');
|
|
4073
4375
|
if (links.length) prop.links = [];
|
|
4074
4376
|
for (var i = 0, link; i < links.length; i++) {
|
|
4075
4377
|
link = {
|
|
4076
|
-
href: attr(links[i],
|
|
4378
|
+
href: attr(links[i], 'href')
|
|
4077
4379
|
};
|
|
4078
|
-
extend(link, getMulti(links[i], [
|
|
4380
|
+
extend(link, getMulti(links[i], ['text', 'type']));
|
|
4079
4381
|
prop.links.push(link);
|
|
4080
4382
|
}
|
|
4081
4383
|
return prop;
|
|
@@ -6216,8 +6518,79 @@ SimpleDataProvider.propTypes = {
|
|
|
6216
6518
|
children: PropTypes__default["default"].node.isRequired
|
|
6217
6519
|
};
|
|
6218
6520
|
|
|
6521
|
+
var ListStyled$1 = material.styled(material.List)({
|
|
6522
|
+
marginTop: '15px',
|
|
6523
|
+
});
|
|
6219
6524
|
function LayerList(props) {
|
|
6220
|
-
return
|
|
6525
|
+
return React__default["default"].createElement(ListStyled$1, null, props === null || props === void 0 ? void 0 : props.children);
|
|
6526
|
+
}
|
|
6527
|
+
|
|
6528
|
+
var ListItemStyled$1 = system.styled(material.ListItem)({
|
|
6529
|
+
paddingRight: 0,
|
|
6530
|
+
paddingLeft: 0,
|
|
6531
|
+
paddingTop: 0,
|
|
6532
|
+
paddingBottom: '4px',
|
|
6533
|
+
});
|
|
6534
|
+
var ListItemIconStyled = system.styled(material.ListItemIcon)({
|
|
6535
|
+
minWidth: '30px',
|
|
6536
|
+
});
|
|
6537
|
+
var IconButtonStyled$1 = system.styled(material.IconButton)({
|
|
6538
|
+
marginRight: '0px',
|
|
6539
|
+
padding: '0px',
|
|
6540
|
+
});
|
|
6541
|
+
var CheckboxStyled$1 = system.styled(material.Checkbox)({
|
|
6542
|
+
padding: 0,
|
|
6543
|
+
marginRight: '5px',
|
|
6544
|
+
});
|
|
6545
|
+
var BoxStyled$1 = system.styled(system.Box)(function (_a) {
|
|
6546
|
+
var open = _a.open;
|
|
6547
|
+
return ({
|
|
6548
|
+
display: open ? 'block' : 'none',
|
|
6549
|
+
});
|
|
6550
|
+
});
|
|
6551
|
+
var ListStyled = system.styled(material.List)({
|
|
6552
|
+
marginLeft: '50px',
|
|
6553
|
+
});
|
|
6554
|
+
function LayerListFolder(_a) {
|
|
6555
|
+
var _b = _a.visible, visible = _b === void 0 ? true : _b, name = _a.name, children = _a.children, setVisible = _a.setVisible;
|
|
6556
|
+
var _c = React.useState(false), open = _c[0], setOpen = _c[1];
|
|
6557
|
+
var _d = React.useState(true), localVisible = _d[0], setLocalVisible = _d[1];
|
|
6558
|
+
var _visible = React.useMemo(function () {
|
|
6559
|
+
if (!visible) {
|
|
6560
|
+
return false;
|
|
6561
|
+
}
|
|
6562
|
+
return localVisible;
|
|
6563
|
+
}, [visible, localVisible]);
|
|
6564
|
+
var _children = React.useMemo(function () {
|
|
6565
|
+
if (children) {
|
|
6566
|
+
if (Array.isArray(children)) {
|
|
6567
|
+
return children.map(function (element) {
|
|
6568
|
+
return React__default["default"].cloneElement(element, {
|
|
6569
|
+
visible: _visible,
|
|
6570
|
+
});
|
|
6571
|
+
});
|
|
6572
|
+
}
|
|
6573
|
+
return React__default["default"].cloneElement(children, {
|
|
6574
|
+
visible: _visible,
|
|
6575
|
+
});
|
|
6576
|
+
}
|
|
6577
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
6578
|
+
}, [_visible]);
|
|
6579
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6580
|
+
React__default["default"].createElement(ListItemStyled$1, null,
|
|
6581
|
+
React__default["default"].createElement(ListItemIconStyled, null,
|
|
6582
|
+
React__default["default"].createElement(IconButtonStyled$1, { edge: "end", "aria-label": "open", onClick: function () { return setOpen(!open); } }, open ? React__default["default"].createElement(iconsMaterial.ExpandMore, null) : React__default["default"].createElement(iconsMaterial.KeyboardArrowRight, null)),
|
|
6583
|
+
React__default["default"].createElement(CheckboxStyled$1, { disabled: setVisible ? false : !visible, checked: setVisible ? visible : localVisible, onClick: function () {
|
|
6584
|
+
if (setVisible) {
|
|
6585
|
+
setVisible(function (val) { return !val; });
|
|
6586
|
+
}
|
|
6587
|
+
else {
|
|
6588
|
+
setLocalVisible(function (val) { return !val; });
|
|
6589
|
+
}
|
|
6590
|
+
} })),
|
|
6591
|
+
React__default["default"].createElement(material.ListItemText, { primary: name, variant: "layerlist" })),
|
|
6592
|
+
React__default["default"].createElement(BoxStyled$1, { open: open },
|
|
6593
|
+
React__default["default"].createElement(ListStyled, { disablePadding: true }, _children))));
|
|
6221
6594
|
}
|
|
6222
6595
|
|
|
6223
6596
|
var converters = {
|
|
@@ -6279,6 +6652,15 @@ function PaintPropsColorPicker(_a) {
|
|
|
6279
6652
|
} }));
|
|
6280
6653
|
}
|
|
6281
6654
|
|
|
6655
|
+
var PaperStyled = material.styled(material.Paper)({
|
|
6656
|
+
marginLeft: '-100px',
|
|
6657
|
+
marginRight: '-21px',
|
|
6658
|
+
paddingLeft: '53px',
|
|
6659
|
+
borderRadius: '0px',
|
|
6660
|
+
});
|
|
6661
|
+
var BoxStyled = material.styled(material.Box)({
|
|
6662
|
+
marginLeft: '61px',
|
|
6663
|
+
});
|
|
6282
6664
|
var mapPropKeyToFormInputType = {
|
|
6283
6665
|
'circle-color': 'colorpicker',
|
|
6284
6666
|
'circle-radius': 'slider',
|
|
@@ -6316,7 +6698,6 @@ var inputPropsByPropKey = {
|
|
|
6316
6698
|
function LayerPropertyForm(_a) {
|
|
6317
6699
|
var _b = _a.paintProps, paintProps = _b === void 0 ? {} : _b, setPaintProps = _a.setPaintProps;
|
|
6318
6700
|
var key = React.useRef(Math.round(Math.random() * 10000000000));
|
|
6319
|
-
//const onChange = (event) => {};
|
|
6320
6701
|
var getFormInputByType = React.useCallback(function (key) {
|
|
6321
6702
|
if (mapPropKeyToFormInputTypeKeys.indexOf(key) !== -1 &&
|
|
6322
6703
|
(typeof paintProps[key] === 'number' || typeof paintProps[key] === 'string')) {
|
|
@@ -6355,68 +6736,27 @@ function LayerPropertyForm(_a) {
|
|
|
6355
6736
|
return null;
|
|
6356
6737
|
}, [paintProps]);
|
|
6357
6738
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6358
|
-
React__default["default"].createElement(
|
|
6359
|
-
marginLeft: '-100px',
|
|
6360
|
-
marginRight: '-21px',
|
|
6361
|
-
paddingLeft: '81px',
|
|
6362
|
-
borderRadius: '0px',
|
|
6363
|
-
} },
|
|
6739
|
+
React__default["default"].createElement(PaperStyled, null,
|
|
6364
6740
|
React__default["default"].createElement(material.ListItem, { key: key + '_paintPropForm' },
|
|
6365
|
-
React__default["default"].createElement(
|
|
6366
|
-
marginLeft: '61px',
|
|
6367
|
-
} }, Object.keys(paintProps).map(function (el) { return getFormInputByType(el); }))))));
|
|
6368
|
-
}
|
|
6369
|
-
|
|
6370
|
-
function LayerListFolder(_a) {
|
|
6371
|
-
var _b = _a.visible, visible = _b === void 0 ? true : _b, name = _a.name, children = _a.children, setVisible = _a.setVisible;
|
|
6372
|
-
var _c = React.useState(false), open = _c[0], setOpen = _c[1];
|
|
6373
|
-
var _d = React.useState(true), localVisible = _d[0], setLocalVisible = _d[1];
|
|
6374
|
-
var _visible = React.useMemo(function () {
|
|
6375
|
-
if (!visible) {
|
|
6376
|
-
return false;
|
|
6377
|
-
}
|
|
6378
|
-
return localVisible;
|
|
6379
|
-
}, [visible, localVisible]);
|
|
6380
|
-
var _children = React.useMemo(function () {
|
|
6381
|
-
if (children) {
|
|
6382
|
-
if (Array.isArray(children)) {
|
|
6383
|
-
return children.map(function (element) {
|
|
6384
|
-
return React__default["default"].cloneElement(element, {
|
|
6385
|
-
visible: _visible,
|
|
6386
|
-
});
|
|
6387
|
-
});
|
|
6388
|
-
}
|
|
6389
|
-
return React__default["default"].cloneElement(children, {
|
|
6390
|
-
visible: _visible,
|
|
6391
|
-
});
|
|
6392
|
-
}
|
|
6393
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
6394
|
-
}, [_visible]);
|
|
6395
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6396
|
-
React__default["default"].createElement(material.ListItem, { className: 'listItemFolder', sx: {
|
|
6397
|
-
paddingRight: 0,
|
|
6398
|
-
paddingLeft: 0,
|
|
6399
|
-
paddingTop: 0,
|
|
6400
|
-
paddingBottom: '4px',
|
|
6401
|
-
} },
|
|
6402
|
-
React__default["default"].createElement(material.ListItemIcon, { sx: { minWidth: '30px' } },
|
|
6403
|
-
React__default["default"].createElement(material.IconButton, { sx: {
|
|
6404
|
-
marginRight: '0px',
|
|
6405
|
-
padding: '0px',
|
|
6406
|
-
}, edge: "end", "aria-label": "open", onClick: function () { return setOpen(!open); } }, open ? React__default["default"].createElement(iconsMaterial.ExpandMore, null) : React__default["default"].createElement(iconsMaterial.KeyboardArrowRight, null)),
|
|
6407
|
-
React__default["default"].createElement(material.Checkbox, { disabled: setVisible ? false : !visible, checked: setVisible ? visible : localVisible, sx: { padding: 0, marginRight: '5px' }, onClick: function () {
|
|
6408
|
-
if (setVisible) {
|
|
6409
|
-
setVisible(function (val) { return !val; });
|
|
6410
|
-
}
|
|
6411
|
-
else {
|
|
6412
|
-
setLocalVisible(function (val) { return !val; });
|
|
6413
|
-
}
|
|
6414
|
-
} })),
|
|
6415
|
-
React__default["default"].createElement(material.ListItemText, { primary: name, variant: "layerlist" })),
|
|
6416
|
-
React__default["default"].createElement(system.Box, { sx: { display: open ? 'block' : 'none' } },
|
|
6417
|
-
React__default["default"].createElement(material.List, { component: "div", disablePadding: true, sx: { marginLeft: '25px' } }, _children))));
|
|
6741
|
+
React__default["default"].createElement(BoxStyled, null, Object.keys(paintProps).map(function (el) { return getFormInputByType(el); }))))));
|
|
6418
6742
|
}
|
|
6419
6743
|
|
|
6744
|
+
var ListItemStyled = material.styled(material.ListItem)(function (configurable) { return ({
|
|
6745
|
+
paddingRight: configurable ? '56px' : 0,
|
|
6746
|
+
paddingLeft: 0,
|
|
6747
|
+
paddingTop: 0,
|
|
6748
|
+
paddingBottom: '4px',
|
|
6749
|
+
}); });
|
|
6750
|
+
var TuneIconButton$1 = material.styled(material.IconButton)({
|
|
6751
|
+
padding: '4px',
|
|
6752
|
+
marginTop: '-3px',
|
|
6753
|
+
});
|
|
6754
|
+
var CheckboxListItemIcon = material.styled(material.ListItemIcon)({
|
|
6755
|
+
minWidth: '30px',
|
|
6756
|
+
});
|
|
6757
|
+
var CheckboxStyled = material.styled(material.Checkbox)({
|
|
6758
|
+
padding: 0,
|
|
6759
|
+
});
|
|
6420
6760
|
function LayerListItemVectorLayer(_a) {
|
|
6421
6761
|
var configurable = _a.configurable, vtProps = _a.vtProps, setVtProps = _a.setVtProps, id = _a.id, props = __rest(_a, ["configurable", "vtProps", "setVtProps", "id"]);
|
|
6422
6762
|
var _b = React.useState(false), paintPropsFormVisible = _b[0], setPaintPropsFormVisible = _b[1];
|
|
@@ -6452,19 +6792,14 @@ function LayerListItemVectorLayer(_a) {
|
|
|
6452
6792
|
}
|
|
6453
6793
|
}, [paintProps, id, setVtProps, vtProps]);
|
|
6454
6794
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6455
|
-
React__default["default"].createElement(
|
|
6456
|
-
paddingRight: configurable ? '56px' : 0,
|
|
6457
|
-
paddingLeft: 0,
|
|
6458
|
-
paddingTop: 0,
|
|
6459
|
-
paddingBottom: '4px',
|
|
6460
|
-
}, secondaryAction: configurable ? (React__default["default"].createElement(material.IconButton, { edge: "end", "aria-label": "comments", onClick: function () {
|
|
6795
|
+
React__default["default"].createElement(ListItemStyled, { key: id, secondaryAction: configurable ? (React__default["default"].createElement(TuneIconButton$1, { edge: "end", "aria-label": "comments", onClick: function () {
|
|
6461
6796
|
setPaintPropsFormVisible(function (current) {
|
|
6462
6797
|
return !current;
|
|
6463
6798
|
});
|
|
6464
|
-
}
|
|
6799
|
+
} },
|
|
6465
6800
|
React__default["default"].createElement(TuneIcon__default["default"], null))) : undefined },
|
|
6466
|
-
React__default["default"].createElement(
|
|
6467
|
-
React__default["default"].createElement(
|
|
6801
|
+
React__default["default"].createElement(CheckboxListItemIcon, null,
|
|
6802
|
+
React__default["default"].createElement(CheckboxStyled, { checked: visible, onClick: function () {
|
|
6468
6803
|
setVisible(function (val) { return !val; });
|
|
6469
6804
|
} })),
|
|
6470
6805
|
React__default["default"].createElement(material.ListItemText, { primary: vtProps.layers[id].id, variant: "layerlist" })),
|
|
@@ -6474,6 +6809,13 @@ LayerListItemVectorLayer.defaultProps = {
|
|
|
6474
6809
|
configurable: true,
|
|
6475
6810
|
};
|
|
6476
6811
|
|
|
6812
|
+
var TuneIconButton = material.styled(material.IconButton)({
|
|
6813
|
+
padding: '4px',
|
|
6814
|
+
marginTop: '-3px',
|
|
6815
|
+
});
|
|
6816
|
+
var DeleteIconButton = material.styled(material.IconButton)({
|
|
6817
|
+
marginLeft: '20px',
|
|
6818
|
+
});
|
|
6477
6819
|
function LayerListItem(_a) {
|
|
6478
6820
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
6479
6821
|
var layerComponent = _a.layerComponent, visible = _a.visible, type = _a.type, name = _a.name, description = _a.description, configurable = _a.configurable, setLayerState = _a.setLayerState, props = __rest(_a, ["layerComponent", "visible", "type", "name", "description", "configurable", "setLayerState"]);
|
|
@@ -6553,35 +6895,16 @@ function LayerListItem(_a) {
|
|
|
6553
6895
|
return undefined;
|
|
6554
6896
|
}, [layerComponent]);
|
|
6555
6897
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6556
|
-
!((_f = layerComponent === null || layerComponent === void 0 ? void 0 : layerComponent.props) === null || _f === void 0 ? void 0 : _f.layers) && (React__default["default"].createElement(
|
|
6898
|
+
!((_f = layerComponent === null || layerComponent === void 0 ? void 0 : layerComponent.props) === null || _f === void 0 ? void 0 : _f.layers) && (React__default["default"].createElement(ListItemStyled, { sx: __assign({}, props.listItemSx), secondaryAction: configurable && ((_g = Object.keys(paintProps)) === null || _g === void 0 ? void 0 : _g.length) > 0 ? (React__default["default"].createElement(React__default["default"].Fragment, null, props === null || props === void 0 ? void 0 :
|
|
6557
6899
|
props.buttons,
|
|
6558
|
-
React__default["default"].createElement(
|
|
6900
|
+
React__default["default"].createElement(TuneIconButton, { edge: 'end', "aria-label": "settings", onClick: function () {
|
|
6559
6901
|
setPaintPropsFormVisible(function (current) {
|
|
6560
6902
|
return !current;
|
|
6561
6903
|
});
|
|
6562
|
-
}
|
|
6563
|
-
React__default["default"].createElement(
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
if (typeof setLayerState === 'function') {
|
|
6567
|
-
setShowDeletionConfirmationDialog(true);
|
|
6568
|
-
}
|
|
6569
|
-
}, sx: {
|
|
6570
|
-
padding: '4px',
|
|
6571
|
-
marginTop: '-3px',
|
|
6572
|
-
} },
|
|
6573
|
-
React__default["default"].createElement(DeleteIcon__default["default"], null)),
|
|
6574
|
-
showDeletionConfirmationDialog && (React__default["default"].createElement(ConfirmDialog, { open: showDeletionConfirmationDialog, onConfirm: function () {
|
|
6575
|
-
if (typeof setLayerState === 'function') {
|
|
6576
|
-
deletedRef.current = true;
|
|
6577
|
-
setLayerState(false);
|
|
6578
|
-
setShowDeletionConfirmationDialog(false);
|
|
6579
|
-
}
|
|
6580
|
-
}, onCancel: function () {
|
|
6581
|
-
setShowDeletionConfirmationDialog(false);
|
|
6582
|
-
}, title: "Delete layer", text: "Are you sure you want to delete this layer?" })))))) : undefined },
|
|
6583
|
-
React__default["default"].createElement(material.ListItemIcon, { sx: { minWidth: '30px' } },
|
|
6584
|
-
React__default["default"].createElement(material.Checkbox, { disabled: !visible, checked: localVisible, sx: { padding: 0 }, onClick: function () {
|
|
6904
|
+
} },
|
|
6905
|
+
React__default["default"].createElement(iconsMaterial.Tune, null)))) : undefined },
|
|
6906
|
+
React__default["default"].createElement(CheckboxListItemIcon, null,
|
|
6907
|
+
React__default["default"].createElement(CheckboxStyled, { disabled: !visible, checked: localVisible, onClick: function () {
|
|
6585
6908
|
setLocalVisible(function (val) { return !val; });
|
|
6586
6909
|
} })),
|
|
6587
6910
|
React__default["default"].createElement(material.ListItemText, { variant: "layerlist", primary: name, secondary: description, primaryTypographyProps: { overflow: 'hidden' } }))),
|
|
@@ -6589,7 +6912,24 @@ function LayerListItem(_a) {
|
|
|
6589
6912
|
!((_h = layerComponent === null || layerComponent === void 0 ? void 0 : layerComponent.props) === null || _h === void 0 ? void 0 : _h.layers) &&
|
|
6590
6913
|
Object.keys(paintProps).length > 0 &&
|
|
6591
6914
|
configurable &&
|
|
6592
|
-
paintPropsFormVisible && (React__default["default"].createElement(
|
|
6915
|
+
paintPropsFormVisible && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6916
|
+
props.showDeleteButton && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6917
|
+
React__default["default"].createElement(DeleteIconButton, { edge: "end", "aria-label": "delete", onClick: function () {
|
|
6918
|
+
if (typeof setLayerState === 'function') {
|
|
6919
|
+
setShowDeletionConfirmationDialog(true);
|
|
6920
|
+
}
|
|
6921
|
+
} },
|
|
6922
|
+
React__default["default"].createElement(iconsMaterial.Delete, null)),
|
|
6923
|
+
showDeletionConfirmationDialog && (React__default["default"].createElement(ConfirmDialog, { open: showDeletionConfirmationDialog, onConfirm: function () {
|
|
6924
|
+
if (typeof setLayerState === 'function') {
|
|
6925
|
+
deletedRef.current = true;
|
|
6926
|
+
setLayerState(false);
|
|
6927
|
+
setShowDeletionConfirmationDialog(false);
|
|
6928
|
+
}
|
|
6929
|
+
}, onCancel: function () {
|
|
6930
|
+
setShowDeletionConfirmationDialog(false);
|
|
6931
|
+
}, title: "Delete layer", text: "Are you sure you want to delete this layer?" })))),
|
|
6932
|
+
React__default["default"].createElement(LayerPropertyForm, { paintProps: paintProps, setPaintProps: setPaintProps, layerType: layerType }))),
|
|
6593
6933
|
((_j = layerComponent === null || layerComponent === void 0 ? void 0 : layerComponent.props) === null || _j === void 0 ? void 0 : _j.layers) && (React__default["default"].createElement(LayerListFolder, { visible: localVisible, setVisible: setLocalVisible, name: name }, (_m = (_l = (_k = layerComponent === null || layerComponent === void 0 ? void 0 : layerComponent.props) === null || _k === void 0 ? void 0 : _k.layers) === null || _l === void 0 ? void 0 : _l.map) === null || _m === void 0 ? void 0 : _m.call(_l, function (_el, idx) { return (React__default["default"].createElement(LayerListItemVectorLayer, { vtProps: layerComponent === null || layerComponent === void 0 ? void 0 : layerComponent.props, setVtProps: setLayerState, id: '' + idx, key: '' + idx, visibleMaster: _visible })); })))));
|
|
6594
6934
|
}
|
|
6595
6935
|
LayerListItem.defaultProps = {
|
|
@@ -6599,6 +6939,14 @@ LayerListItem.defaultProps = {
|
|
|
6599
6939
|
buttons: React__default["default"].createElement(React__default["default"].Fragment, null),
|
|
6600
6940
|
};
|
|
6601
6941
|
|
|
6942
|
+
var IconButtonStyled = material.styled(material.IconButton)({
|
|
6943
|
+
padding: '4px',
|
|
6944
|
+
marginTop: '-3px',
|
|
6945
|
+
background: 'none',
|
|
6946
|
+
'&:hover': {
|
|
6947
|
+
background: 'none',
|
|
6948
|
+
},
|
|
6949
|
+
});
|
|
6602
6950
|
function LayerListItemFactory(props) {
|
|
6603
6951
|
var _a, _b;
|
|
6604
6952
|
var layerContext = useLayerContext();
|
|
@@ -6623,7 +6971,7 @@ function LayerListItemFactory(props) {
|
|
|
6623
6971
|
return layerContext.setLayers;
|
|
6624
6972
|
}, [props.setLayers, layerContext.setLayers]);
|
|
6625
6973
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6626
|
-
React__default["default"].createElement(MlOrderLayers, { layerIds: orderLayers, insertBeforeLayer:
|
|
6974
|
+
React__default["default"].createElement(MlOrderLayers, { layerIds: orderLayers, insertBeforeLayer: "_background" }),
|
|
6627
6975
|
((_a = layerContext === null || layerContext === void 0 ? void 0 : layerContext.symbolLayers) === null || _a === void 0 ? void 0 : _a.length) > 0 && (React__default["default"].createElement(LayerListItem, { key: 'background_labels', layerComponent: React__default["default"].createElement(MlVectorTileLayer, __assign({}, layerContext.vtLayerConfig, { layers: layerContext.symbolLayers, mapId: props === null || props === void 0 ? void 0 : props.mapId, insertBeforeLayer: 'order-labels' })), setLayerState: function (state) {
|
|
6628
6976
|
return layerContext.setSymbolLayers(state === null || state === void 0 ? void 0 : state.layers);
|
|
6629
6977
|
}, visible: true, configurable: true, type: "layer", name: "Labels" })),
|
|
@@ -6635,28 +6983,14 @@ function LayerListItemFactory(props) {
|
|
|
6635
6983
|
case 'geojson':
|
|
6636
6984
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6637
6985
|
React__default["default"].createElement(LayerListItem, { key: layer.id, name: (layer === null || layer === void 0 ? void 0 : layer.name) || ((_a = layer === null || layer === void 0 ? void 0 : layer.config) === null || _a === void 0 ? void 0 : _a.type) + ' layer' || 'unnamed layer', layerComponent: React__default["default"].createElement(MlGeoJsonLayer, __assign({}, layer.config, { mapId: props === null || props === void 0 ? void 0 : props.mapId, layerId: layer.id, insertBeforeLayer: 'content_order_' + (layers.length - 1 - idx) })), buttons: React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6638
|
-
React__default["default"].createElement(
|
|
6986
|
+
React__default["default"].createElement(IconButtonStyled, { disabled: idx === layers.length - 1, onClick: function () {
|
|
6639
6987
|
layerContext.moveDown(layer.id || '');
|
|
6640
|
-
}, sx: {
|
|
6641
|
-
padding: '4px',
|
|
6642
|
-
marginTop: '-3px',
|
|
6643
|
-
background: 'none',
|
|
6644
|
-
"&:hover": {
|
|
6645
|
-
background: "none"
|
|
6646
|
-
}
|
|
6647
6988
|
} },
|
|
6648
|
-
React__default["default"].createElement(
|
|
6649
|
-
React__default["default"].createElement(
|
|
6989
|
+
React__default["default"].createElement(iconsMaterial.ArrowCircleDown, null)),
|
|
6990
|
+
React__default["default"].createElement(IconButtonStyled, { disabled: idx === 0, onClick: function () {
|
|
6650
6991
|
layerContext.moveUp(layer.id || '');
|
|
6651
|
-
}, sx: {
|
|
6652
|
-
padding: '4px',
|
|
6653
|
-
marginTop: '-3px',
|
|
6654
|
-
background: 'none',
|
|
6655
|
-
"&:hover": {
|
|
6656
|
-
background: "none"
|
|
6657
|
-
}
|
|
6658
6992
|
} },
|
|
6659
|
-
React__default["default"].createElement(
|
|
6993
|
+
React__default["default"].createElement(iconsMaterial.ArrowCircleUp, null))), setLayerState: function (layerConfig) {
|
|
6660
6994
|
return setLayers === null || setLayers === void 0 ? void 0 : setLayers(function (current) {
|
|
6661
6995
|
var _layers = __spreadArray([], current, true);
|
|
6662
6996
|
if (layerConfig === false) {
|
|
@@ -6692,28 +7026,14 @@ function LayerListItemFactory(props) {
|
|
|
6692
7026
|
return _layers;
|
|
6693
7027
|
});
|
|
6694
7028
|
}, showDeleteButton: true, buttons: React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6695
|
-
React__default["default"].createElement(
|
|
7029
|
+
React__default["default"].createElement(IconButtonStyled, { disabled: idx === layers.length - 1, onClick: function () {
|
|
6696
7030
|
layerContext.moveDown(layer.id || '');
|
|
6697
|
-
}, sx: {
|
|
6698
|
-
padding: '4px',
|
|
6699
|
-
marginTop: '-3px',
|
|
6700
|
-
background: 'none',
|
|
6701
|
-
"&:hover": {
|
|
6702
|
-
background: "none"
|
|
6703
|
-
}
|
|
6704
7031
|
} },
|
|
6705
|
-
React__default["default"].createElement(
|
|
6706
|
-
React__default["default"].createElement(
|
|
7032
|
+
React__default["default"].createElement(iconsMaterial.ArrowCircleDown, null)),
|
|
7033
|
+
React__default["default"].createElement(IconButtonStyled, { disabled: idx === 0, onClick: function () {
|
|
6707
7034
|
layerContext.moveUp(layer.id || '');
|
|
6708
|
-
}, sx: {
|
|
6709
|
-
padding: '4px',
|
|
6710
|
-
marginTop: '-3px',
|
|
6711
|
-
background: 'none',
|
|
6712
|
-
"&:hover": {
|
|
6713
|
-
background: "none"
|
|
6714
|
-
}
|
|
6715
7035
|
} },
|
|
6716
|
-
React__default["default"].createElement(
|
|
7036
|
+
React__default["default"].createElement(iconsMaterial.ArrowCircleUp, null))) }))));
|
|
6717
7037
|
default:
|
|
6718
7038
|
return null;
|
|
6719
7039
|
}
|
|
@@ -6877,7 +7197,7 @@ function TopToolbar(props) {
|
|
|
6877
7197
|
}, sx: {
|
|
6878
7198
|
display: { xs: 'block', sm: 'none' },
|
|
6879
7199
|
} },
|
|
6880
|
-
React__namespace.createElement(Box__default["default"], { sx: { paddingLeft: '10px', paddingRight: '10px' } }, props.buttons)))) : (''),
|
|
7200
|
+
React__namespace.createElement(Box__default["default"], { sx: { paddingLeft: '10px', paddingRight: '10px' }, onClick: handleCloseNavMenu }, props.buttons)))) : (''),
|
|
6881
7201
|
React__namespace.createElement(Box__default["default"], { sx: { marginRight: '25px', display: { xs: 'none', sm: 'flex' } } }, props.buttons))));
|
|
6882
7202
|
}
|
|
6883
7203
|
|
|
@@ -6999,7 +7319,7 @@ function UploadButton(props) {
|
|
|
6999
7319
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
7000
7320
|
props.buttonComponent ? (React__default["default"].cloneElement(props.buttonComponent, { onClick: upload })) : (React__default["default"].createElement(material.Button, { onClick: upload },
|
|
7001
7321
|
React__default["default"].createElement(FileCopy__default["default"], null))),
|
|
7002
|
-
React__default["default"].createElement("input", { ref: fileupload, onChange: fileUploadOnChange, type: "file", id: "input", multiple: true, style: { display: 'none' } })));
|
|
7322
|
+
React__default["default"].createElement("input", { ref: fileupload, onChange: fileUploadOnChange, type: "file", accept: props.accept, id: "input", multiple: true, style: { display: 'none' } })));
|
|
7003
7323
|
}
|
|
7004
7324
|
|
|
7005
7325
|
var SelectStylePopup = function (props) {
|