@cloud-app-dev/vidc 3.1.16 → 3.1.17
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/es/Api/index.js +0 -23
- package/es/AppContext/Sync.js +1 -15
- package/es/AppContext/index.js +21 -52
- package/es/AppContext/static.js +0 -7
- package/es/Auth/index.js +2 -5
- package/es/AutoExit/index.js +1 -5
- package/es/Box/BetweenBox/index.js +6 -8
- package/es/Box/InfoBox/index.js +6 -8
- package/es/Box/TwoColumnBox/index.js +8 -18
- package/es/Box/deps/grid-factory.js +0 -12
- package/es/Box/index.js +4 -6
- package/es/CheckGroupFixed/index.js +19 -34
- package/es/Config/index.js +0 -4
- package/es/Config/utils.js +3 -18
- package/es/ConfigContext/index.js +1 -3
- package/es/CustomRenderSelect/index.js +13 -29
- package/es/DisableMark/index.js +2 -2
- package/es/DomMove/index.js +24 -37
- package/es/DomMove/utils.js +3 -8
- package/es/Drag/DragAndDropItem.js +19 -37
- package/es/Drag/DropItem.js +5 -15
- package/es/Drawer/Demo.js +3 -17
- package/es/Drawer/Footer.js +3 -5
- package/es/Drawer/index.js +28 -50
- package/es/ErrorFallback/index.js +1 -3
- package/es/FullScreen/index.js +8 -18
- package/es/HightLevel/index.js +1 -5
- package/es/IconFont/index.js +5 -11
- package/es/ImageView/index.js +8 -20
- package/es/Input/index.js +14 -27
- package/es/InstanceHistory/index.js +0 -2
- package/es/LabelValue/index.js +8 -10
- package/es/List/DynamicGridList/Demo.js +0 -11
- package/es/List/DynamicGridList/index.js +16 -25
- package/es/List/DynamicList/index.js +23 -38
- package/es/List/GridList/Demo.js +3 -16
- package/es/List/GridList/hook.js +34 -65
- package/es/List/GridList/utils.js +0 -1
- package/es/List/VList/index.js +10 -20
- package/es/List/VList/utils.js +2 -3
- package/es/List/index.js +5 -7
- package/es/LoaderApp/index.js +5 -22
- package/es/LoaderApp/loader.js +5 -13
- package/es/LoaderApp/sandbox.back.js +16 -81
- package/es/LoaderApp/sandbox.js +8 -22
- package/es/LoaderApp/utils.js +20 -49
- package/es/LoaderScript/index.js +8 -19
- package/es/LoaderScript/utils.js +0 -51
- package/es/Map/BasicMap/AMapInstance.js +0 -10
- package/es/Map/BasicMap/LeafletInstance.js +11 -20
- package/es/Map/BasicMap/index.js +6 -28
- package/es/Map/ClusterLayer/hook.js +10 -32
- package/es/Map/ClusterLayer/index.js +2 -6
- package/es/Map/Config/index.js +8 -21
- package/es/Map/Config/utils.js +0 -6
- package/es/Map/Context/index.js +2 -22
- package/es/Map/FindPio/index.js +0 -2
- package/es/Map/InfoWindow/MakerLikeWindow.js +9 -28
- package/es/Map/InfoWindow/demo.js +5 -22
- package/es/Map/InfoWindow/index.js +13 -29
- package/es/Map/LevelCenter/DragMarker/index.js +5 -9
- package/es/Map/LevelCenter/demo.js +6 -16
- package/es/Map/LevelCenter/index.js +8 -15
- package/es/Map/LoaderMap/index.js +10 -10
- package/es/Map/MapDrawSelect/demo.js +12 -23
- package/es/Map/MapDrawSelect/index.js +14 -21
- package/es/Map/MouseTool/index.js +16 -26
- package/es/Map/MouseTool/useMouseTools.js +6 -29
- package/es/Map/ResetTools/index.js +4 -8
- package/es/Map/SinglePoint/index.js +6 -13
- package/es/Map/hook/useMapEvent.js +3 -7
- package/es/Map/hook/useMapType.js +1 -2
- package/es/Map/useMarker/index.js +10 -24
- package/es/Map/withMap/index.js +0 -2
- package/es/Modal/index.d.ts +1 -1
- package/es/Modal/index.js +29 -50
- package/es/Picture/component/DefaultRects/RectInfo.js +11 -25
- package/es/Picture/component/DefaultRects/index.js +3 -5
- package/es/Picture/component/DrawRect/index.js +6 -8
- package/es/Picture/component/RectMenu/index.js +10 -16
- package/es/Picture/component/RectMenu/utils.js +3 -6
- package/es/Picture/component/Tools/index.js +6 -8
- package/es/Picture/component/WheelScale/index.js +3 -6
- package/es/Picture/dragBound.js +4 -17
- package/es/Picture/index.js +46 -87
- package/es/Picture/loadCaptureRectImage.js +10 -26
- package/es/Picture/useDraw.js +20 -39
- package/es/Picture/utils.js +2 -11
- package/es/Player/api/index.js +14 -78
- package/es/Player/context.js +1 -2
- package/es/Player/contraller_bar/bar.js +5 -9
- package/es/Player/contraller_bar/contraller_event.js +5 -23
- package/es/Player/contraller_bar/index.js +7 -9
- package/es/Player/contraller_bar/left_bar.js +15 -27
- package/es/Player/contraller_bar/right_bar.js +7 -18
- package/es/Player/contraller_bar/time.js +6 -16
- package/es/Player/contraller_bar/useBarStatus.js +5 -16
- package/es/Player/contraller_bar/volume.js +6 -26
- package/es/Player/demo.js +59 -75
- package/es/Player/event/errorEvent.js +14 -39
- package/es/Player/event/eventName.js +1 -1
- package/es/Player/event/index.js +19 -53
- package/es/Player/fps_play.js +10 -27
- package/es/Player/frontend_player.js +10 -19
- package/es/Player/frontend_timeline.js +25 -47
- package/es/Player/iconfont.js +2 -5
- package/es/Player/live_heart.js +2 -14
- package/es/Player/message.js +9 -29
- package/es/Player/segment_player.js +39 -77
- package/es/Player/segment_timeline.js +42 -68
- package/es/Player/single_player.js +64 -87
- package/es/Player/style/iconfont.js +10 -17
- package/es/Player/timeline.js +11 -28
- package/es/Player/util.js +0 -21
- package/es/PlayerExt/demo.js +11 -21
- package/es/PlayerExt/index.js +18 -43
- package/es/Progress/index.js +3 -15
- package/es/ROI/demo.js +0 -2
- package/es/ROI/index.js +15 -22
- package/es/ScreenPlayer/Live.js +34 -67
- package/es/ScreenPlayer/LiveTools.js +21 -38
- package/es/ScreenPlayer/PlayerWithExt.js +43 -78
- package/es/ScreenPlayer/RatePick.js +1 -3
- package/es/ScreenPlayer/Record.js +50 -121
- package/es/ScreenPlayer/RecordTools.js +32 -54
- package/es/ScreenPlayer/ScreenSelect.js +1 -3
- package/es/ScreenPlayer/SegmentTimeLine.js +8 -12
- package/es/ScreenPlayer/TimeMode.js +1 -3
- package/es/ScreenPlayer/TimeSelect.js +11 -26
- package/es/ScreenPlayer/demo.js +3 -1
- package/es/ScreenPlayer/demo2.js +9 -24
- package/es/ScreenPlayer/useRecordList.js +7 -72
- package/es/ScreenPlayer/useTimeSlider.js +40 -132
- package/es/ScreenPlayer/useVideoFit.js +5 -18
- package/es/ScreenPlayer/utils.js +0 -8
- package/es/Service/fetch-adapter.js +2 -37
- package/es/Service/http.js +8 -27
- package/es/TableLayout/index.js +3 -7
- package/es/ThemeAntd/demo.js +0 -2
- package/es/Timeout/index.js +10 -26
- package/es/Tree/demo.js +0 -2
- package/es/Tree/index.js +14 -21
- package/es/useDrawROI/index.js +51 -105
- package/es/useEventEmitterHandle/index.js +2 -6
- package/es/useFullscreen/demo.js +6 -16
- package/es/useFullscreen/index.js +5 -25
- package/es/useHistory/index.js +0 -2
- package/es/useInfiniteScroll/index.js +14 -39
- package/es/useRafInterval/index.js +2 -26
- package/es/useSimpleState/index.js +5 -16
- package/es/useVirtualList/index.js +19 -57
- package/es/utils.js +0 -28
- package/package.json +1 -1
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
2
|
-
|
|
3
2
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4
|
-
|
|
5
3
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
6
|
-
|
|
7
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
-
|
|
9
5
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
|
|
11
6
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
-
|
|
13
7
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
14
|
-
|
|
15
8
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
16
|
-
|
|
17
9
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
|
-
|
|
19
10
|
/// <reference path="../AMap.d.ts" />
|
|
20
11
|
import React, { useContext, useEffect, useRef } from 'react';
|
|
21
12
|
import ReactDOM from 'react-dom';
|
|
@@ -23,23 +14,20 @@ import { mapContext } from '../Context';
|
|
|
23
14
|
import useMapType from '../hook/useMapType';
|
|
24
15
|
export default function InfoWindow(_ref) {
|
|
25
16
|
var children = _ref.children,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
visible = _ref.visible,
|
|
18
|
+
center = _ref.center,
|
|
19
|
+
width = _ref.width,
|
|
20
|
+
height = _ref.height;
|
|
31
21
|
var _useContext = useContext(mapContext),
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
instance = _useContext.instance;
|
|
34
23
|
var domref = useRef(null);
|
|
35
24
|
var infoWindowRef = useRef(null);
|
|
36
25
|
var type = useMapType();
|
|
37
26
|
useEffect(function () {
|
|
38
27
|
if (!instance.map) {
|
|
39
28
|
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
}
|
|
30
|
+
// leaflet下还未实现
|
|
43
31
|
if (type.AMap && !infoWindowRef.current) {
|
|
44
32
|
var infoWindow = new AMap.InfoWindow({
|
|
45
33
|
size: [width, height],
|
|
@@ -48,26 +36,22 @@ export default function InfoWindow(_ref) {
|
|
|
48
36
|
offset: [0, -32]
|
|
49
37
|
});
|
|
50
38
|
infoWindowRef.current = infoWindow;
|
|
51
|
-
}
|
|
52
|
-
|
|
39
|
+
}
|
|
40
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
41
|
}, [instance.map, visible, center]);
|
|
54
42
|
useEffect(function () {
|
|
55
43
|
var infoWindow = infoWindowRef.current;
|
|
56
|
-
|
|
57
44
|
if (!infoWindow || !center) {
|
|
58
45
|
return undefined;
|
|
59
46
|
}
|
|
60
|
-
|
|
61
47
|
if (type.AMap) {
|
|
62
48
|
var map = instance.map;
|
|
63
|
-
|
|
64
49
|
var lnglat = _construct(AMap.LngLat, _toConsumableArray(center));
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
50
|
+
map.setCenter(lnglat);
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
68
52
|
visible ? !infoWindow.getIsOpen() ? (infoWindow.close(), infoWindow.open(instance.map, lnglat)) : infoWindow.open(instance.map, lnglat) : infoWindow.close();
|
|
69
|
-
}
|
|
70
|
-
|
|
53
|
+
}
|
|
54
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
71
55
|
}, [visible, center, instance.map]);
|
|
72
56
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
73
57
|
ref: domref
|
|
@@ -3,15 +3,12 @@ import React, { useContext, useEffect } from 'react';
|
|
|
3
3
|
import useMarker from '../../useMarker';
|
|
4
4
|
import { createMapCenterIcon } from '../../icon';
|
|
5
5
|
import useMapType from '../../hook/useMapType';
|
|
6
|
-
|
|
7
6
|
function DragMarker(_ref) {
|
|
8
7
|
var center = _ref.center,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
title = _ref.title,
|
|
9
|
+
onChange = _ref.onChange;
|
|
12
10
|
var _useContext = useContext(mapContext),
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
instance = _useContext.instance;
|
|
15
12
|
var type = useMapType();
|
|
16
13
|
var marker = useMarker({
|
|
17
14
|
map: instance.map,
|
|
@@ -26,14 +23,14 @@ function DragMarker(_ref) {
|
|
|
26
23
|
if (!marker) {
|
|
27
24
|
return;
|
|
28
25
|
}
|
|
29
|
-
|
|
30
26
|
marker.on('dragend', function (e) {
|
|
31
27
|
var latlng = type.leaflet ? e.target.getLatLng() : e.target.getPosition();
|
|
32
28
|
instance.setCenter(latlng);
|
|
33
29
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
34
30
|
center: [latlng.getLng(), latlng.getLat()]
|
|
35
31
|
});
|
|
36
|
-
});
|
|
32
|
+
});
|
|
33
|
+
// instance.map.on('moveend', () => {
|
|
37
34
|
// const latlng = (type.leaflet ? marker.getLatLng() : marker.getPosition()) as LatLng;
|
|
38
35
|
// onChange?.({ center: [latlng.getLng(), latlng.getLat()] });
|
|
39
36
|
// });
|
|
@@ -41,5 +38,4 @@ function DragMarker(_ref) {
|
|
|
41
38
|
}, [marker]);
|
|
42
39
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
43
40
|
}
|
|
44
|
-
|
|
45
41
|
export default DragMarker;
|
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
import "antd/lib/config-provider/style";
|
|
2
2
|
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
|
-
|
|
4
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
-
|
|
6
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
-
|
|
8
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
-
|
|
10
6
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11
|
-
|
|
12
7
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
13
|
-
|
|
14
8
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
-
|
|
16
9
|
import React, { useEffect, useState } from 'react';
|
|
17
10
|
import LevelCenter from './index';
|
|
18
11
|
import deviceList from '../points.json';
|
|
19
|
-
|
|
20
12
|
var App = function App() {
|
|
21
13
|
var _useState = useState({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
center: [113, 30],
|
|
15
|
+
zoom: 10
|
|
16
|
+
}),
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
state = _useState2[0],
|
|
19
|
+
setState = _useState2[1];
|
|
29
20
|
useEffect(function () {
|
|
30
21
|
console.log(state);
|
|
31
22
|
}, [state]);
|
|
@@ -44,5 +35,4 @@ var App = function App() {
|
|
|
44
35
|
}
|
|
45
36
|
}))));
|
|
46
37
|
};
|
|
47
|
-
|
|
48
38
|
export default App;
|
|
@@ -7,37 +7,31 @@ import withMap from '../withMap';
|
|
|
7
7
|
import { mapContext } from '../Context';
|
|
8
8
|
import useMapEvent from '../hook/useMapEvent';
|
|
9
9
|
import "./index.css";
|
|
10
|
-
|
|
11
10
|
function LevelCenter(_ref) {
|
|
12
11
|
var center = _ref.center,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
zoom = _ref.zoom,
|
|
13
|
+
points = _ref.points,
|
|
14
|
+
onLevelCenterChange = _ref.onLevelCenterChange,
|
|
15
|
+
enableClick = _ref.enableClick,
|
|
16
|
+
children = _ref.children;
|
|
19
17
|
var _useContext = useContext(mapContext),
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
instance = _useContext.instance;
|
|
22
19
|
var defaultCenter = useMemo(function () {
|
|
23
20
|
return center || instance.config.center;
|
|
24
21
|
}, [center, instance]);
|
|
25
22
|
var defaultZoom = useMemo(function () {
|
|
26
23
|
return zoom || instance.config.zoom;
|
|
27
|
-
}, [zoom, instance]);
|
|
28
|
-
|
|
24
|
+
}, [zoom, instance]);
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
26
|
var mapRest = useCallback(function () {
|
|
30
27
|
return instance.setZoomAndCenter(defaultZoom, defaultCenter);
|
|
31
28
|
}, [defaultZoom, defaultCenter]);
|
|
32
|
-
|
|
33
29
|
_useMount(function () {
|
|
34
30
|
if (enableClick) {
|
|
35
31
|
instance.setCursor('pointer');
|
|
36
32
|
}
|
|
37
|
-
|
|
38
33
|
mapRest();
|
|
39
34
|
});
|
|
40
|
-
|
|
41
35
|
useMapEvent('click', function (event) {
|
|
42
36
|
if (enableClick) {
|
|
43
37
|
var _center = [event.lnglat.lng, event.lnglat.lat];
|
|
@@ -69,5 +63,4 @@ function LevelCenter(_ref) {
|
|
|
69
63
|
}
|
|
70
64
|
}), children);
|
|
71
65
|
}
|
|
72
|
-
|
|
73
66
|
export default withMap(LevelCenter, 'lv-center-map-container');
|
|
@@ -4,31 +4,32 @@ import Config from '../../Config';
|
|
|
4
4
|
import LoaderScript from '../../LoaderScript';
|
|
5
5
|
var L_SCRIPTS = [{
|
|
6
6
|
scripts: ['https://cdn.bootcdn.net/ajax/libs/leaflet/1.8.0/leaflet.min.js'],
|
|
7
|
-
styles: ['https://cdn.bootcdn.net/ajax/libs/leaflet/1.8.0/leaflet.min.css']
|
|
7
|
+
styles: ['https://cdn.bootcdn.net/ajax/libs/leaflet/1.8.0/leaflet.min.css']
|
|
8
|
+
// scripts: ['/statics/libs/map/leaflet/leaflet.min.js'],
|
|
8
9
|
// styles: ['/statics/libs/map/leaflet/leaflet.min.css'],
|
|
9
|
-
|
|
10
10
|
}, {
|
|
11
|
-
scripts: ['https://cdn.bootcdn.net/ajax/libs/leaflet.markercluster/1.5.3/leaflet.markercluster.min.js'
|
|
11
|
+
scripts: ['https://cdn.bootcdn.net/ajax/libs/leaflet.markercluster/1.5.3/leaflet.markercluster.min.js'
|
|
12
|
+
// '/statics/libs/map/leaflet/echarts-leaflet.js'
|
|
12
13
|
// '/statics/libs/map/leaflet/leaflet.markercluster.js'
|
|
13
14
|
],
|
|
14
|
-
|
|
15
|
+
|
|
16
|
+
styles: ['https://cdn.bootcdn.net/ajax/libs/leaflet.markercluster/1.5.3/MarkerCluster.min.css', 'https://cdn.bootcdn.net/ajax/libs/leaflet.markercluster/1.5.3/MarkerCluster.Default.min.css'
|
|
17
|
+
// '/statics/libs/map/leaflet/MarkerCluster.css'
|
|
15
18
|
// '/statics/libs/map/leaflet/MarkerCluster.Default.css'
|
|
16
19
|
]
|
|
17
20
|
}];
|
|
21
|
+
|
|
18
22
|
var AMAP_SCRIPTS = [{
|
|
19
23
|
scripts: ['https://webapi.amap.com/maps?v=2.0&key=2232e46c0b578b711e6e9851cb92dbfe']
|
|
20
24
|
}];
|
|
21
|
-
|
|
22
25
|
function EmptyParent(_ref) {
|
|
23
26
|
var children = _ref.children;
|
|
24
27
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
25
28
|
}
|
|
26
|
-
|
|
27
29
|
function LoaderMap(_a) {
|
|
28
30
|
var children = _a.children,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
MAP_GLABAL_KEY = _a.MAP_GLABAL_KEY,
|
|
32
|
+
props = __rest(_a, ["children", "MAP_GLABAL_KEY"]);
|
|
32
33
|
var glaobalKey = useMemo(function () {
|
|
33
34
|
return MAP_GLABAL_KEY ? MAP_GLABAL_KEY : Config.BSConfig.MAP_GLABAL_KEY || 'L';
|
|
34
35
|
}, [MAP_GLABAL_KEY]);
|
|
@@ -51,7 +52,6 @@ function LoaderMap(_a) {
|
|
|
51
52
|
glaobalKey: glaobalKey
|
|
52
53
|
})));
|
|
53
54
|
}
|
|
54
|
-
|
|
55
55
|
LoaderMap.defaultProps = {
|
|
56
56
|
MAP_GLABAL_KEY: 'AMap'
|
|
57
57
|
};
|
|
@@ -1,38 +1,28 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
-
|
|
9
5
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
7
|
import React, { useEffect, useState } from 'react';
|
|
14
8
|
import MapDrawSelect from './index';
|
|
15
9
|
import deviceList from '../points.json';
|
|
16
|
-
|
|
17
10
|
var App = function App() {
|
|
18
11
|
var _useState = useState([]),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
+
points = _useState2[0],
|
|
14
|
+
setPoints = _useState2[1];
|
|
23
15
|
var _useState3 = useState(),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
17
|
+
type = _useState4[0],
|
|
18
|
+
setType = _useState4[1];
|
|
28
19
|
var _useState5 = useState({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
zoom: null,
|
|
21
|
+
center: null
|
|
22
|
+
}),
|
|
23
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
24
|
+
state = _useState6[0],
|
|
25
|
+
setState = _useState6[1];
|
|
36
26
|
useEffect(function () {
|
|
37
27
|
setTimeout(function () {
|
|
38
28
|
setPoints(deviceList);
|
|
@@ -78,5 +68,4 @@ var App = function App() {
|
|
|
78
68
|
}, "\u6E05\u9664"))
|
|
79
69
|
}));
|
|
80
70
|
};
|
|
81
|
-
|
|
82
71
|
export default App;
|
|
@@ -7,42 +7,36 @@ import withMap from '../withMap';
|
|
|
7
7
|
import { mapContext } from '../Context';
|
|
8
8
|
import MouseTool from '../MouseTool';
|
|
9
9
|
import "./index.css";
|
|
10
|
-
|
|
11
10
|
function MapDrawSelect(_ref) {
|
|
12
11
|
var center = _ref.center,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
zoom = _ref.zoom,
|
|
13
|
+
points = _ref.points,
|
|
14
|
+
children = _ref.children,
|
|
15
|
+
drawUi = _ref.drawUi,
|
|
16
|
+
drawType = _ref.drawType,
|
|
17
|
+
selectCenter = _ref.selectCenter,
|
|
18
|
+
drawEnd = _ref.drawEnd,
|
|
19
|
+
onPointClick = _ref.onPointClick;
|
|
22
20
|
var _useContext = useContext(mapContext),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
instance = _useContext.instance;
|
|
22
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
23
|
var defaultCenter = useMemo(function () {
|
|
27
24
|
return center || instance.config.center;
|
|
28
|
-
}, [center]);
|
|
29
|
-
|
|
25
|
+
}, [center]);
|
|
26
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
27
|
var defaultZoom = useMemo(function () {
|
|
31
28
|
return zoom || instance.config.zoom;
|
|
32
|
-
}, [zoom]);
|
|
33
|
-
|
|
29
|
+
}, [zoom]);
|
|
30
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
31
|
var mapRest = useCallback(function () {
|
|
35
32
|
return instance.setZoomAndCenter(defaultZoom, defaultCenter);
|
|
36
33
|
}, [defaultZoom, defaultCenter]);
|
|
37
|
-
|
|
38
34
|
_useMount(function () {
|
|
39
35
|
return mapRest();
|
|
40
36
|
});
|
|
41
|
-
|
|
42
37
|
_useUpdateEffect(function () {
|
|
43
38
|
return instance.setZoomAndCenter(defaultZoom, defaultCenter);
|
|
44
39
|
}, [defaultZoom, defaultCenter]);
|
|
45
|
-
|
|
46
40
|
useEffect(function () {
|
|
47
41
|
if (selectCenter) {
|
|
48
42
|
instance.setZoomAndCenter(defaultZoom, selectCenter);
|
|
@@ -60,5 +54,4 @@ function MapDrawSelect(_ref) {
|
|
|
60
54
|
points: points
|
|
61
55
|
}), children);
|
|
62
56
|
}
|
|
63
|
-
|
|
64
57
|
export default withMap(MapDrawSelect, 'map-draw-select-container');
|
|
@@ -2,49 +2,39 @@ import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
|
2
2
|
import _nextTick from "@cloud-app-dev/utils/es/nextTick";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import useMouseTools from './useMouseTools';
|
|
5
|
-
|
|
6
5
|
function MouseTool(_ref) {
|
|
7
6
|
var ui = _ref.ui,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
drawType = _ref.drawType,
|
|
8
|
+
_ref$points = _ref.points,
|
|
9
|
+
points = _ref$points === void 0 ? [] : _ref$points,
|
|
10
|
+
drawEnd = _ref.drawEnd;
|
|
13
11
|
var _useMouseTools = useMouseTools(function (obj) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
selectPoints.push(item);
|
|
12
|
+
var selectPoints = [];
|
|
13
|
+
for (var i = 0; i < points.length; i++) {
|
|
14
|
+
var item = points[i];
|
|
15
|
+
if (item.longitude && item.latitude && obj.contains([item.longitude, item.latitude])) {
|
|
16
|
+
selectPoints.push(item);
|
|
17
|
+
}
|
|
21
18
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
draw = _useMouseTools.draw,
|
|
29
|
-
close = _useMouseTools.close;
|
|
30
|
-
|
|
19
|
+
_nextTick(function () {
|
|
20
|
+
return drawEnd === null || drawEnd === void 0 ? void 0 : drawEnd(selectPoints);
|
|
21
|
+
});
|
|
22
|
+
}),
|
|
23
|
+
draw = _useMouseTools.draw,
|
|
24
|
+
close = _useMouseTools.close;
|
|
31
25
|
_useUpdateEffect(function () {
|
|
32
26
|
switch (drawType) {
|
|
33
27
|
case 'clear':
|
|
34
28
|
close(true);
|
|
35
29
|
break;
|
|
36
|
-
|
|
37
30
|
case 'close':
|
|
38
31
|
close();
|
|
39
32
|
break;
|
|
40
|
-
|
|
41
33
|
default:
|
|
42
34
|
draw(drawType);
|
|
43
35
|
break;
|
|
44
36
|
}
|
|
45
37
|
}, [drawType]);
|
|
46
|
-
|
|
47
38
|
return /*#__PURE__*/React.createElement(React.Fragment, null, ui);
|
|
48
39
|
}
|
|
49
|
-
|
|
50
40
|
export default MouseTool;
|
|
@@ -1,34 +1,23 @@
|
|
|
1
1
|
import _useMount from "ahooks/es/useMount";
|
|
2
|
-
|
|
3
2
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
4
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
|
|
9
5
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
|
-
|
|
11
6
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
-
|
|
13
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
8
|
import { useContext, useEffect, useRef, useState } from 'react';
|
|
16
9
|
import { mapContext } from '../Context';
|
|
17
|
-
|
|
18
10
|
function useMouseTools(onDrawEnd) {
|
|
19
11
|
var _useState = useState({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
focusKey: Date.now()
|
|
13
|
+
}),
|
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
+
state = _useState2[0],
|
|
16
|
+
setState = _useState2[1];
|
|
26
17
|
var _useContext = useContext(mapContext),
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
instance = _useContext.instance;
|
|
29
19
|
var overlayersRef = useRef([]);
|
|
30
20
|
var mouseRef = useRef(null);
|
|
31
|
-
|
|
32
21
|
_useMount(function () {
|
|
33
22
|
var map = instance.map;
|
|
34
23
|
AMap.plugin(['AMap.MouseTool'], function () {
|
|
@@ -40,61 +29,49 @@ function useMouseTools(onDrawEnd) {
|
|
|
40
29
|
});
|
|
41
30
|
});
|
|
42
31
|
});
|
|
43
|
-
|
|
44
32
|
useEffect(function () {
|
|
45
33
|
if (!mouseRef.current) {
|
|
46
34
|
return undefined;
|
|
47
35
|
}
|
|
48
|
-
|
|
49
36
|
var fn = function fn(e) {
|
|
50
37
|
overlayersRef.current.push(e.obj);
|
|
51
38
|
onDrawEnd === null || onDrawEnd === void 0 ? void 0 : onDrawEnd(e.obj);
|
|
52
39
|
};
|
|
53
|
-
|
|
54
40
|
mouseRef.current.on('draw', fn);
|
|
55
41
|
return function () {
|
|
56
42
|
mouseRef.current.off('draw', fn);
|
|
57
43
|
};
|
|
58
44
|
}, [onDrawEnd, state.focusKey]);
|
|
59
|
-
|
|
60
45
|
var draw = function draw(type) {
|
|
61
46
|
if (!mouseRef.current) {
|
|
62
47
|
return;
|
|
63
48
|
}
|
|
64
|
-
|
|
65
49
|
switch (type) {
|
|
66
50
|
case 'rect':
|
|
67
51
|
mouseRef.current.rectangle();
|
|
68
52
|
break;
|
|
69
|
-
|
|
70
53
|
case 'polygon':
|
|
71
54
|
mouseRef.current.polygon();
|
|
72
55
|
break;
|
|
73
|
-
|
|
74
56
|
case 'circle':
|
|
75
57
|
mouseRef.current.circle();
|
|
76
58
|
}
|
|
77
59
|
};
|
|
78
|
-
|
|
79
60
|
var clear = function clear(objs) {
|
|
80
61
|
objs.forEach(function (obj) {
|
|
81
62
|
instance.map.remove(obj);
|
|
82
63
|
});
|
|
83
64
|
};
|
|
84
|
-
|
|
85
65
|
var close = function close(ifClear) {
|
|
86
66
|
if (!mouseRef.current) {
|
|
87
67
|
return;
|
|
88
68
|
}
|
|
89
|
-
|
|
90
69
|
mouseRef.current.close(ifClear);
|
|
91
70
|
};
|
|
92
|
-
|
|
93
71
|
return {
|
|
94
72
|
clear: clear,
|
|
95
73
|
draw: draw,
|
|
96
74
|
close: close
|
|
97
75
|
};
|
|
98
76
|
}
|
|
99
|
-
|
|
100
77
|
export default useMouseTools;
|
|
@@ -5,16 +5,13 @@ import { mapContext } from '../Context';
|
|
|
5
5
|
import IconFont from '../../IconFont';
|
|
6
6
|
import '../../Player/style/iconfont';
|
|
7
7
|
import "./index.css";
|
|
8
|
-
|
|
9
8
|
function ResetTools(_ref) {
|
|
10
9
|
var onMapReset = _ref.onMapReset,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
onMapZoom = _ref.onMapZoom,
|
|
11
|
+
_ref$className = _ref.className,
|
|
12
|
+
className = _ref$className === void 0 ? '' : _ref$className;
|
|
15
13
|
var _useContext = useContext(mapContext),
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
instance = _useContext.instance;
|
|
18
15
|
var mapReset = useCallback(function () {
|
|
19
16
|
return onMapReset ? onMapReset() : instance.mapReset();
|
|
20
17
|
}, []);
|
|
@@ -58,5 +55,4 @@ function ResetTools(_ref) {
|
|
|
58
55
|
type: "lm-player-S_Edit_LineMinus"
|
|
59
56
|
})))));
|
|
60
57
|
}
|
|
61
|
-
|
|
62
58
|
export default ResetTools;
|
|
@@ -7,30 +7,24 @@ import withMap from '../withMap';
|
|
|
7
7
|
import { mapContext } from '../Context';
|
|
8
8
|
import useMapEvent from '../hook/useMapEvent';
|
|
9
9
|
import "./index.css";
|
|
10
|
-
|
|
11
10
|
function SinglePoint(_ref) {
|
|
12
11
|
var center = _ref.center,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
points = _ref.points,
|
|
13
|
+
onCenterChange = _ref.onCenterChange,
|
|
14
|
+
enableClick = _ref.enableClick,
|
|
15
|
+
title = _ref.title,
|
|
16
|
+
children = _ref.children;
|
|
19
17
|
var _useContext = useContext(mapContext),
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
instance = _useContext.instance;
|
|
22
19
|
var mapRest = useCallback(function () {
|
|
23
20
|
return instance.setZoomAndCenter(instance.config.zoom, center !== null && center !== void 0 ? center : instance.config.center);
|
|
24
21
|
}, [center, instance]);
|
|
25
|
-
|
|
26
22
|
_useMount(function () {
|
|
27
23
|
if (enableClick) {
|
|
28
24
|
instance.setCursor('pointer');
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
mapRest();
|
|
32
27
|
});
|
|
33
|
-
|
|
34
28
|
useMapEvent('click', function (event) {
|
|
35
29
|
if (enableClick) {
|
|
36
30
|
var _center = [event.lnglat.lng, event.lnglat.lat];
|
|
@@ -55,5 +49,4 @@ function SinglePoint(_ref) {
|
|
|
55
49
|
}
|
|
56
50
|
}), children);
|
|
57
51
|
}
|
|
58
|
-
|
|
59
52
|
export default withMap(SinglePoint, 'single-point-map-container');
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import _useLatest from "ahooks/es/useLatest";
|
|
2
2
|
import { useContext, useEffect } from 'react';
|
|
3
3
|
import { mapContext } from '../Context';
|
|
4
|
-
|
|
5
4
|
function useMapEvent(type, fn) {
|
|
6
5
|
var fnRef = _useLatest(fn);
|
|
7
|
-
|
|
8
6
|
var _useContext = useContext(mapContext),
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
instance = _useContext.instance;
|
|
11
8
|
useEffect(function () {
|
|
12
9
|
var eventAction = function eventAction(event) {
|
|
13
10
|
fnRef.current(event);
|
|
14
11
|
};
|
|
15
|
-
|
|
16
12
|
instance.on(type, eventAction);
|
|
17
13
|
return function () {
|
|
18
14
|
return instance.off(type, eventAction);
|
|
19
|
-
};
|
|
15
|
+
};
|
|
16
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
20
17
|
}, [instance, type]);
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
export default useMapEvent;
|