@cloud-app-dev/vidc 4.0.15 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dumirc.ts +2 -18
- package/.eslintrc.js +3 -0
- package/.fatherrc.ts +0 -7
- package/es/AppContext/Sync.d.ts +1 -2
- package/es/AppContext/index.d.ts +10 -3
- package/es/AppContext/index.js +14 -4
- package/es/AppContext/interface.d.ts +1 -0
- package/es/CheckGroupFixed/demo.d.ts +1 -2
- package/es/CheckGroupFixed/demo.js +7 -12
- package/es/CheckGroupFixed/index.d.ts +7 -3
- package/es/CheckGroupFixed/index.js +9 -9
- package/es/CheckGroupFixed/style.d.ts +6 -0
- package/es/CheckGroupFixed/style.js +9 -0
- package/es/Config/index.js +1 -1
- package/es/CustomRenderSelect/index.d.ts +3 -2
- package/es/CustomRenderSelect/index.js +13 -10
- package/es/DBTools/index.js +1 -2
- package/es/DisableMark/index.d.ts +1 -2
- package/es/DisableMark/index.js +5 -2
- package/es/DomMove/demo.d.ts +1 -2
- package/es/DomMove/demo.js +0 -1
- package/es/DomMove/index.js +7 -8
- package/es/DynamicGridList/demo.d.ts +2 -0
- package/es/DynamicGridList/index.d.ts +1 -1
- package/es/DynamicGridList/index.js +3 -3
- package/es/DynamicList/demo.d.ts +1 -2
- package/es/DynamicList/demo.js +14 -19
- package/es/DynamicList/index.d.ts +1 -2
- package/es/DynamicList/index.js +10 -8
- package/es/ErrorFallback/index.d.ts +1 -2
- package/es/EventTools/index.d.ts +1 -1
- package/es/GridList/demo.d.ts +2 -0
- package/es/GridList/{Demo.js → demo.js} +1 -1
- package/es/GridList/hook.js +2 -2
- package/es/GridList/index.d.ts +0 -1
- package/es/GridList/index.js +5 -2
- package/es/HightLevel/index.d.ts +1 -2
- package/es/HightLevel/index.js +2 -3
- package/es/IconFont/index.d.ts +1 -1
- package/es/LabelValue/index.d.ts +1 -2
- package/es/LabelValue/index.js +5 -2
- package/es/List/demo.d.ts +1 -2
- package/es/List/demo.js +1 -2
- package/es/List/index.d.ts +2 -3
- package/es/List/index.js +25 -17
- package/es/ListWithSizeAnimate/demo.d.ts +1 -2
- package/es/ListWithSizeAnimate/index.d.ts +0 -1
- package/es/ListWithSizeAnimate/index.js +19 -10
- package/es/LoaderScript/index.d.ts +1 -1
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +1 -2
- package/es/Picture/component/DefaultRects/RectInfo.js +6 -4
- package/es/Picture/component/DefaultRects/index.d.ts +1 -3
- package/es/Picture/component/DefaultRects/index.js +5 -5
- package/es/Picture/component/DefaultRects/style.d.ts +10 -0
- package/es/Picture/component/DefaultRects/style.js +28 -0
- package/es/Picture/component/DrawRect/index.d.ts +1 -3
- package/es/Picture/component/DrawRect/index.js +6 -3
- package/es/Picture/component/RectMenu/index.d.ts +1 -3
- package/es/Picture/component/RectMenu/index.js +13 -8
- package/es/Picture/component/Tools/index.d.ts +1 -2
- package/es/Picture/component/Tools/index.js +21 -9
- package/es/Picture/component/Tools/style.d.ts +2 -0
- package/es/Picture/component/Tools/style.js +5 -0
- package/es/Picture/component/WheelScale/index.d.ts +1 -2
- package/es/Picture/demo.d.ts +1 -2
- package/es/Picture/demo.js +1 -1
- package/es/Picture/index.d.ts +1 -3
- package/es/Picture/index.js +21 -19
- package/es/Picture/useDraw.js +4 -4
- package/es/Player/api/index.d.ts +1 -1
- package/es/Player/api/index.js +44 -18
- package/es/Player/context.d.ts +1 -1
- package/es/Player/contraller_bar/bar.d.ts +1 -1
- package/es/Player/contraller_bar/bar.js +5 -1
- package/es/Player/contraller_bar/contraller_event.d.ts +1 -1
- package/es/Player/contraller_bar/contraller_event.js +4 -5
- package/es/Player/contraller_bar/index.d.ts +1 -2
- package/es/Player/contraller_bar/index.js +8 -2
- package/es/Player/contraller_bar/left_bar.d.ts +1 -1
- package/es/Player/contraller_bar/left_bar.js +12 -3
- package/es/Player/contraller_bar/right_bar.d.ts +1 -1
- package/es/Player/contraller_bar/right_bar.js +1 -2
- package/es/Player/contraller_bar/time.d.ts +1 -2
- package/es/Player/contraller_bar/time.js +5 -2
- package/es/Player/contraller_bar/volume.d.ts +1 -2
- package/es/Player/contraller_bar/volume.js +11 -6
- package/es/Player/demo.d.ts +1 -2
- package/es/Player/demo.js +41 -29
- package/es/Player/empty.d.ts +1 -2
- package/es/Player/empty.js +0 -1
- package/es/Player/event/index.d.ts +1 -1
- package/es/Player/event/index.js +4 -3
- package/es/Player/fps_play.d.ts +1 -2
- package/es/Player/fps_play.js +6 -2
- package/es/Player/frontend_player.d.ts +1 -2
- package/es/Player/frontend_player.js +4 -5
- package/es/Player/frontend_timeline.d.ts +1 -3
- package/es/Player/frontend_timeline.js +16 -8
- package/es/Player/iconfont.d.ts +1 -2
- package/es/Player/iconfont.js +1 -2
- package/es/Player/live_heart.js +8 -9
- package/es/Player/message.d.ts +2 -4
- package/es/Player/message.js +16 -7
- package/es/Player/player.d.ts +2 -0
- package/es/Player/segment_player.d.ts +1 -2
- package/es/Player/segment_player.js +4 -5
- package/es/Player/segment_timeline.d.ts +1 -3
- package/es/Player/segment_timeline.js +19 -9
- package/es/Player/single_player.d.ts +0 -1
- package/es/Player/single_player.js +18 -15
- package/es/Player/timeline.d.ts +5 -3
- package/es/Player/timeline.js +10 -4
- package/es/Player/util.d.ts +2 -2
- package/es/Player/util.js +2 -2
- package/es/PlayerExt/demo.d.ts +1 -2
- package/es/PlayerExt/demo.js +3 -3
- package/es/PlayerExt/index.d.ts +1 -2
- package/es/PlayerExt/index.js +10 -5
- package/es/Progress/index.d.ts +1 -3
- package/es/Progress/index.js +7 -3
- package/es/ROI/demo.d.ts +1 -2
- package/es/ROI/demo.js +1 -2
- package/es/ROI/index.d.ts +1 -2
- package/es/ROI/index.js +17 -7
- package/es/RefDrawer/Footer.d.ts +1 -1
- package/es/RefDrawer/index.d.ts +1 -1
- package/es/RefDrawer/index.js +2 -2
- package/es/RefModal/demo.d.ts +1 -2
- package/es/RefModal/index.d.ts +1 -1
- package/es/RefModal/index.js +2 -2
- package/es/ScreenPlayer/Live.d.ts +1 -3
- package/es/ScreenPlayer/Live.js +10 -11
- package/es/ScreenPlayer/LiveTools.d.ts +5 -1
- package/es/ScreenPlayer/LiveTools.js +14 -9
- package/es/ScreenPlayer/PlayerWithExt.d.ts +3 -3
- package/es/ScreenPlayer/PlayerWithExt.js +14 -13
- package/es/ScreenPlayer/RatePick.d.ts +1 -2
- package/es/ScreenPlayer/RatePick.js +9 -4
- package/es/ScreenPlayer/Record.d.ts +1 -3
- package/es/ScreenPlayer/Record.js +27 -22
- package/es/ScreenPlayer/RecordTools.d.ts +1 -1
- package/es/ScreenPlayer/RecordTools.js +11 -13
- package/es/ScreenPlayer/ScreenSelect.d.ts +1 -2
- package/es/ScreenPlayer/ScreenSelect.js +11 -3
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +1 -2
- package/es/ScreenPlayer/SegmentTimeLine.js +12 -6
- package/es/ScreenPlayer/TimeMode.d.ts +1 -2
- package/es/ScreenPlayer/TimeMode.js +7 -3
- package/es/ScreenPlayer/TimeSelect.d.ts +1 -2
- package/es/ScreenPlayer/TimeSelect.js +10 -5
- package/es/ScreenPlayer/containerStyle.d.ts +13 -0
- package/es/ScreenPlayer/containerStyle.js +32 -0
- package/es/ScreenPlayer/demo.d.ts +1 -2
- package/es/ScreenPlayer/demo.js +8 -13
- package/es/ScreenPlayer/demo2.d.ts +1 -2
- package/es/ScreenPlayer/demo2.js +112 -116
- package/es/ScreenPlayer/index.d.ts +2 -2
- package/es/ScreenPlayer/useTimeSlider.d.ts +2 -2
- package/es/ScreenPlayer/useTimeSlider.js +16 -15
- package/es/ScreenPlayer/useVideoFit.js +2 -2
- package/es/SocketEmitter/eventEmitter.d.ts +1 -1
- package/es/TableLayout/index.d.ts +1 -2
- package/es/TableLayout/index.js +7 -4
- package/es/Timeout/index.d.ts +1 -2
- package/es/Timeout/index.js +4 -5
- package/es/cache/index.d.ts +1 -1
- package/es/cache/index.js +21 -21
- package/es/index.d.ts +3 -11
- package/es/index.js +3 -11
- package/es/likeGo/index.d.ts +2 -0
- package/es/{Map/Config/utils.js → likeGo/index.js} +15 -49
- package/es/likeGoSync/index.d.ts +2 -0
- package/es/likeGoSync/index.js +10 -0
- package/es/logger/index.d.ts +4 -4
- package/es/nextTick/index.d.ts +1 -1
- package/es/nextTick/index.js +2 -6
- package/es/recorder/demo.d.ts +2 -0
- package/es/recorder/demo.js +200 -0
- package/es/recorder/index.d.ts +294 -0
- package/es/recorder/index.js +991 -0
- package/es/useDrawROI/index.js +8 -12
- package/es/useEventEmitterHandle/index.js +2 -2
- package/es/useInfiniteScroll/index.d.ts +1 -1
- package/es/useInfiniteScroll/index.js +8 -7
- package/es/useRafInterval/index.js +2 -2
- package/es/useSimpleState/index.js +3 -4
- package/es/useVirtualList/index.d.ts +1 -1
- package/es/useVirtualList/index.js +5 -8
- package/es/utils.d.ts +4 -4
- package/es/utils.js +1 -30
- package/es/uuid/index.d.ts +2 -1
- package/es/uuid/index.js +3 -12
- package/package.json +36 -37
- package/release-build.sh +3 -2
- package/scripts/{entry.js → entry.mjs} +4 -6
- package/{icon-fix.js → scripts/icon-fix.mjs} +4 -3
- package/tsconfig.json +1 -1
- package/es/Auth/index.d.ts +0 -8
- package/es/Auth/index.js +0 -18
- package/es/AutoExit/index.d.ts +0 -6
- package/es/AutoExit/index.js +0 -23
- package/es/CheckGroupFixed/index.less +0 -53
- package/es/ConfigContext/index.d.ts +0 -22
- package/es/ConfigContext/index.js +0 -25
- package/es/CustomRenderSelect/index.less +0 -25
- package/es/DisableMark/index.less +0 -9
- package/es/DynamicGridList/Demo.d.ts +0 -3
- package/es/DynamicList/index.less +0 -17
- package/es/FullScreen/index.d.ts +0 -22
- package/es/FullScreen/index.js +0 -36
- package/es/FullScreen/index.less +0 -18
- package/es/GridList/Demo.d.ts +0 -3
- package/es/GridList/index.less +0 -8
- package/es/HightLevel/index.less +0 -3
- package/es/ImageView/index.d.ts +0 -17
- package/es/ImageView/index.js +0 -58
- package/es/ImageView/index.less +0 -11
- package/es/LabelPlayer/111.png +0 -0
- package/es/LabelPlayer/demo.d.ts +0 -2
- package/es/LabelPlayer/demo.js +0 -123
- package/es/LabelPlayer/index.d.ts +0 -21
- package/es/LabelPlayer/index.js +0 -169
- package/es/LabelPlayer/index.less +0 -24
- package/es/LabelValue/index.less +0 -23
- package/es/List/index.less +0 -13
- package/es/ListWithSizeAnimate/index.less +0 -23
- package/es/Map/AMap.d.ts +0 -7109
- package/es/Map/BasicMap/AMapInstance.d.ts +0 -19
- package/es/Map/BasicMap/AMapInstance.js +0 -98
- package/es/Map/BasicMap/LeafletInstance.d.ts +0 -18
- package/es/Map/BasicMap/LeafletInstance.js +0 -111
- package/es/Map/BasicMap/index.d.ts +0 -9
- package/es/Map/BasicMap/index.js +0 -98
- package/es/Map/BasicMap/index.less +0 -29
- package/es/Map/ClusterLayer/demo.d.ts +0 -3
- package/es/Map/ClusterLayer/demo.js +0 -22
- package/es/Map/ClusterLayer/hook.d.ts +0 -5
- package/es/Map/ClusterLayer/hook.js +0 -124
- package/es/Map/ClusterLayer/index.d.ts +0 -6
- package/es/Map/ClusterLayer/index.js +0 -32
- package/es/Map/ClusterLayer/index.less +0 -29
- package/es/Map/ClusterLayer/props.d.ts +0 -8
- package/es/Map/Config/index.d.ts +0 -9
- package/es/Map/Config/index.js +0 -52
- package/es/Map/Config/utils.d.ts +0 -2
- package/es/Map/Context/index.d.ts +0 -11
- package/es/Map/Context/index.js +0 -56
- package/es/Map/FindPio/index.d.ts +0 -4
- package/es/Map/FindPio/index.js +0 -14
- package/es/Map/FindPio/index.less +0 -7
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +0 -4
- package/es/Map/InfoWindow/MakerLikeWindow.js +0 -113
- package/es/Map/InfoWindow/demo.d.ts +0 -3
- package/es/Map/InfoWindow/demo.js +0 -76
- package/es/Map/InfoWindow/index.d.ts +0 -11
- package/es/Map/InfoWindow/index.js +0 -67
- package/es/Map/LevelCenter/DragMarker/index.d.ts +0 -10
- package/es/Map/LevelCenter/DragMarker/index.js +0 -44
- package/es/Map/LevelCenter/demo.d.ts +0 -3
- package/es/Map/LevelCenter/demo.js +0 -46
- package/es/Map/LevelCenter/index.d.ts +0 -15
- package/es/Map/LevelCenter/index.js +0 -71
- package/es/Map/LoaderMap/index.d.ts +0 -12
- package/es/Map/LoaderMap/index.js +0 -71
- package/es/Map/MapDrawSelect/demo.d.ts +0 -3
- package/es/Map/MapDrawSelect/demo.js +0 -79
- package/es/Map/MapDrawSelect/index.d.ts +0 -15
- package/es/Map/MapDrawSelect/index.js +0 -62
- package/es/Map/MouseTool/index.d.ts +0 -10
- package/es/Map/MouseTool/index.js +0 -44
- package/es/Map/MouseTool/useMouseTools.d.ts +0 -7
- package/es/Map/MouseTool/useMouseTools.js +0 -83
- package/es/Map/ResetTools/index.d.ts +0 -10
- package/es/Map/ResetTools/index.js +0 -67
- package/es/Map/ResetTools/index.less +0 -39
- package/es/Map/SinglePoint/demo.d.ts +0 -3
- package/es/Map/SinglePoint/demo.js +0 -16
- package/es/Map/SinglePoint/index.d.ts +0 -27
- package/es/Map/SinglePoint/index.js +0 -57
- package/es/Map/SinglePoint/index.less +0 -41
- package/es/Map/hook/useMapEvent.d.ts +0 -2
- package/es/Map/hook/useMapEvent.js +0 -19
- package/es/Map/hook/useMapType.d.ts +0 -4
- package/es/Map/hook/useMapType.js +0 -12
- package/es/Map/icon.d.ts +0 -2
- package/es/Map/icon.js +0 -10
- package/es/Map/index.d.ts +0 -24
- package/es/Map/index.js +0 -25
- package/es/Map/interface.d.ts +0 -74
- package/es/Map/points.d.ts +0 -74
- package/es/Map/points.js +0 -1
- package/es/Map/useMarker/index.d.ts +0 -10
- package/es/Map/useMarker/index.js +0 -71
- package/es/Map/withMap/index.d.ts +0 -3
- package/es/Map/withMap/index.js +0 -18
- package/es/Picture/component/DefaultRects/index.less +0 -211
- package/es/Picture/component/DrawRect/index.less +0 -8
- package/es/Picture/component/RectMenu/index.less +0 -36
- package/es/Picture/component/Tools/index.less +0 -49
- package/es/Picture/index.less +0 -20
- package/es/Player/style/bar.less +0 -43
- package/es/Player/style/index.less +0 -34
- package/es/Player/style/message.less +0 -56
- package/es/Player/style/slider.less +0 -106
- package/es/Player/style/timeline.less +0 -116
- package/es/Player/style/volume.less +0 -24
- package/es/PlayerExt/index.less +0 -10
- package/es/Progress/index.less +0 -21
- package/es/ROI/index.less +0 -33
- package/es/ScreenPlayer/index.less +0 -335
- package/es/TableLayout/index.less +0 -4
- package/es/ThemeAntd/demo.d.ts +0 -4
- package/es/ThemeAntd/demo.js +0 -129
- package/es/ThemeAntd/demo.less +0 -20
- package/es/ThemeAntd/index.d.ts +0 -7
- package/es/ThemeAntd/index.js +0 -23
- package/es/ThemeAntd/index.less +0 -4
- package/es/VList/index.d.ts +0 -11
- package/es/VList/index.js +0 -42
- package/es/VList/index.less +0 -6
- package/es/VList/utils.d.ts +0 -14
- package/es/VList/utils.js +0 -17
- package/es/bigNumberTransformCN/index.d.ts +0 -5
- package/es/bigNumberTransformCN/index.js +0 -60
- package/es/useFullscreen/demo.d.ts +0 -2
- package/es/useFullscreen/demo.js +0 -48
- package/es/useFullscreen/index.d.ts +0 -12
- package/es/useFullscreen/index.js +0 -76
- /package/es/DynamicGridList/{Demo.js → demo.js} +0 -0
package/es/Map/Config/index.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["children", "MAP_GLABAL_KEY", "customConfig"];
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
-
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."); }
|
|
10
|
-
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); }
|
|
11
|
-
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; }
|
|
12
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
16
|
-
import React, { useEffect, useMemo, useState } from 'react';
|
|
17
|
-
import { queryMapConfig } from "./utils";
|
|
18
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
function Config(_ref) {
|
|
21
|
-
var children = _ref.children,
|
|
22
|
-
MAP_GLABAL_KEY = _ref.MAP_GLABAL_KEY,
|
|
23
|
-
customConfig = _ref.customConfig,
|
|
24
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
-
var _useState = useState(),
|
|
26
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
-
config = _useState2[0],
|
|
28
|
-
setConfig = _useState2[1];
|
|
29
|
-
var _useState3 = useState(false),
|
|
30
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
31
|
-
isInit = _useState4[0],
|
|
32
|
-
setInit = _useState4[1];
|
|
33
|
-
var extProps = useMemo(function () {
|
|
34
|
-
return config ? {
|
|
35
|
-
config: config
|
|
36
|
-
} : {};
|
|
37
|
-
}, [config]);
|
|
38
|
-
useEffect(function () {
|
|
39
|
-
queryMapConfig(MAP_GLABAL_KEY, customConfig).then(setConfig).then(function () {
|
|
40
|
-
return setInit(true);
|
|
41
|
-
});
|
|
42
|
-
}, [MAP_GLABAL_KEY]);
|
|
43
|
-
if (!isInit) {
|
|
44
|
-
return /*#__PURE__*/_jsx(_Fragment, {});
|
|
45
|
-
}
|
|
46
|
-
return /*#__PURE__*/_jsx(_Fragment, {
|
|
47
|
-
children: /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, props), extProps), {}, {
|
|
48
|
-
MAP_GLABAL_KEY: MAP_GLABAL_KEY
|
|
49
|
-
}))
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
export default Config;
|
package/es/Map/Config/utils.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IMapInstance } from '../interface';
|
|
3
|
-
export interface IContenxtProps {
|
|
4
|
-
instance: IMapInstance;
|
|
5
|
-
glaobalKey: 'L' | 'AMap';
|
|
6
|
-
}
|
|
7
|
-
export declare const mapContext: React.Context<IContenxtProps>;
|
|
8
|
-
export declare const Provider: React.Provider<IContenxtProps>;
|
|
9
|
-
export declare const Consumer: React.Consumer<IContenxtProps>;
|
|
10
|
-
declare function map(Component: new () => React.Component<any>): React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
|
11
|
-
export default map;
|
package/es/Map/Context/index.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["forwardRef"];
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
7
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
10
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
16
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
17
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
-
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; } }
|
|
19
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
20
|
-
import React from 'react';
|
|
21
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
-
export var mapContext = /*#__PURE__*/React.createContext(null);
|
|
23
|
-
export var Provider = mapContext.Provider;
|
|
24
|
-
export var Consumer = mapContext.Consumer;
|
|
25
|
-
function map(Component) {
|
|
26
|
-
var MapWithComponent = /*#__PURE__*/function (_React$Component) {
|
|
27
|
-
_inherits(MapWithComponent, _React$Component);
|
|
28
|
-
var _super = _createSuper(MapWithComponent);
|
|
29
|
-
function MapWithComponent() {
|
|
30
|
-
_classCallCheck(this, MapWithComponent);
|
|
31
|
-
return _super.apply(this, arguments);
|
|
32
|
-
}
|
|
33
|
-
_createClass(MapWithComponent, [{
|
|
34
|
-
key: "render",
|
|
35
|
-
value: function render() {
|
|
36
|
-
var _this$props = this.props,
|
|
37
|
-
forwardRef = _this$props.forwardRef,
|
|
38
|
-
props = _objectWithoutProperties(_this$props, _excluded);
|
|
39
|
-
return /*#__PURE__*/_jsx(Consumer, {
|
|
40
|
-
children: function children(context) {
|
|
41
|
-
return /*#__PURE__*/_jsx(Component, _objectSpread(_objectSpread(_objectSpread({}, props), context), {}, {
|
|
42
|
-
ref: forwardRef
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}]);
|
|
48
|
-
return MapWithComponent;
|
|
49
|
-
}(React.Component);
|
|
50
|
-
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
51
|
-
return /*#__PURE__*/_jsx(MapWithComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
52
|
-
forwardRef: ref
|
|
53
|
-
}));
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
export default map;
|
package/es/Map/FindPio/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Select } from 'antd';
|
|
3
|
-
import "./index.less";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
function FindPio() {
|
|
6
|
-
return /*#__PURE__*/_jsx(Select, {
|
|
7
|
-
className: "map-find-pio",
|
|
8
|
-
labelInValue: true,
|
|
9
|
-
notFoundContent: null,
|
|
10
|
-
filterOption: false,
|
|
11
|
-
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
export default FindPio;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import _useEventListener from "ahooks/es/useEventListener";
|
|
2
|
-
import _useUnmount from "ahooks/es/useUnmount";
|
|
3
|
-
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); }
|
|
4
|
-
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; } }
|
|
5
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
6
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
7
|
-
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."); }
|
|
8
|
-
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
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
-
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; }
|
|
12
|
-
/// <reference path="../AMap.d.ts" />
|
|
13
|
-
|
|
14
|
-
import React, { useContext, useEffect, useRef } from 'react';
|
|
15
|
-
import ReactDOM from 'react-dom';
|
|
16
|
-
import { mapContext } from "../Context";
|
|
17
|
-
import useMapType from "../hook/useMapType";
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
|
-
var maxIndex = 20;
|
|
21
|
-
export default function MakerLikeWindow(_ref) {
|
|
22
|
-
var children = _ref.children,
|
|
23
|
-
visible = _ref.visible,
|
|
24
|
-
center = _ref.center,
|
|
25
|
-
width = _ref.width,
|
|
26
|
-
height = _ref.height;
|
|
27
|
-
var _useContext = useContext(mapContext),
|
|
28
|
-
instance = _useContext.instance;
|
|
29
|
-
var domref = useRef(null);
|
|
30
|
-
var markerRef = useRef(null);
|
|
31
|
-
var type = useMapType();
|
|
32
|
-
useEffect(function () {
|
|
33
|
-
if (!instance.map) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
// leaflet下还未实现
|
|
37
|
-
|
|
38
|
-
if (type.AMap && !markerRef.current) {
|
|
39
|
-
var marker = new AMap.Marker({
|
|
40
|
-
content: domref.current,
|
|
41
|
-
visible: false,
|
|
42
|
-
zIndex: maxIndex,
|
|
43
|
-
map: instance.map,
|
|
44
|
-
offset: [-width * 0.5, -height - 32]
|
|
45
|
-
});
|
|
46
|
-
markerRef.current = marker;
|
|
47
|
-
marker.on('click', function () {
|
|
48
|
-
maxIndex++;
|
|
49
|
-
if (marker.getzIndex() !== maxIndex) {
|
|
50
|
-
marker.setzIndex(maxIndex);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}, [instance.map, visible, center]);
|
|
55
|
-
useEffect(function () {
|
|
56
|
-
var marker = markerRef.current;
|
|
57
|
-
if (!marker || !center) {
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
if (type.AMap) {
|
|
61
|
-
var lnglat = _construct(AMap.LngLat, _toConsumableArray(center));
|
|
62
|
-
if (visible) {
|
|
63
|
-
marker.setPosition(lnglat);
|
|
64
|
-
marker.setContent(domref.current);
|
|
65
|
-
ReactDOM.render(children, domref.current);
|
|
66
|
-
marker.show();
|
|
67
|
-
} else {
|
|
68
|
-
marker.hide();
|
|
69
|
-
ReactDOM.unmountComponentAtNode(domref.current);
|
|
70
|
-
instance.map.remove(markerRef.current);
|
|
71
|
-
markerRef.current = null;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
75
|
-
}, [visible, center, instance.map]);
|
|
76
|
-
_useUnmount(function () {
|
|
77
|
-
try {
|
|
78
|
-
instance.map.remove(markerRef.current);
|
|
79
|
-
markerRef.current = null;
|
|
80
|
-
} catch (_) {}
|
|
81
|
-
});
|
|
82
|
-
_useEventListener('mouseover', function () {
|
|
83
|
-
return instance.map.setStatus({
|
|
84
|
-
zoomEnable: false
|
|
85
|
-
});
|
|
86
|
-
}, {
|
|
87
|
-
target: domref
|
|
88
|
-
});
|
|
89
|
-
_useEventListener('mouseout', function () {
|
|
90
|
-
return instance.map.setStatus({
|
|
91
|
-
zoomEnable: true
|
|
92
|
-
});
|
|
93
|
-
}, {
|
|
94
|
-
target: domref
|
|
95
|
-
});
|
|
96
|
-
_useEventListener('wheel', function (e) {
|
|
97
|
-
if (domref.current) {
|
|
98
|
-
domref.current.scrollTop -= e.wheelDelta / 5;
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
target: domref
|
|
102
|
-
});
|
|
103
|
-
return /*#__PURE__*/_jsx(_Fragment, {
|
|
104
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
105
|
-
ref: domref,
|
|
106
|
-
style: {
|
|
107
|
-
width: width,
|
|
108
|
-
height: height,
|
|
109
|
-
overflow: 'auto'
|
|
110
|
-
}
|
|
111
|
-
})
|
|
112
|
-
});
|
|
113
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
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."); }
|
|
3
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
-
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
|
-
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
|
-
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; }
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import React, { useState } from 'react';
|
|
12
|
-
import Player from "../../Player";
|
|
13
|
-
import Map from "../BasicMap";
|
|
14
|
-
import ClusterLayer from "../ClusterLayer";
|
|
15
|
-
import deviceList from "../points";
|
|
16
|
-
import InfoWindow from "./MakerLikeWindow";
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
var App = function App() {
|
|
20
|
-
var _useState = useState([]),
|
|
21
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
-
state = _useState2[0],
|
|
23
|
-
setState = _useState2[1];
|
|
24
|
-
var addDeviceInfoWindow = function addDeviceInfoWindow(item) {
|
|
25
|
-
var longitude = item.longitude,
|
|
26
|
-
latitude = item.latitude,
|
|
27
|
-
cid = item.cid;
|
|
28
|
-
var arr = state;
|
|
29
|
-
var index = arr.findIndex(function (v) {
|
|
30
|
-
return v.cid === cid;
|
|
31
|
-
});
|
|
32
|
-
if (index === -1) {
|
|
33
|
-
arr.push({
|
|
34
|
-
visible: true,
|
|
35
|
-
center: [longitude, latitude],
|
|
36
|
-
cid: cid,
|
|
37
|
-
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
if (index > -1 && !arr[index].visible) {
|
|
41
|
-
arr[index].visible = true;
|
|
42
|
-
}
|
|
43
|
-
setState(_toConsumableArray(arr));
|
|
44
|
-
};
|
|
45
|
-
return /*#__PURE__*/_jsx("div", {
|
|
46
|
-
style: {
|
|
47
|
-
width: '100%',
|
|
48
|
-
height: 800
|
|
49
|
-
},
|
|
50
|
-
children: /*#__PURE__*/_jsxs(Map, {
|
|
51
|
-
children: [/*#__PURE__*/_jsx(ClusterLayer, {
|
|
52
|
-
points: deviceList,
|
|
53
|
-
onPointClick: function onPointClick(point) {
|
|
54
|
-
return addDeviceInfoWindow(point);
|
|
55
|
-
}
|
|
56
|
-
}), state.map(function (item) {
|
|
57
|
-
return /*#__PURE__*/_jsx(InfoWindow, {
|
|
58
|
-
visible: item.visible,
|
|
59
|
-
center: item.center,
|
|
60
|
-
width: 200,
|
|
61
|
-
height: 100,
|
|
62
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
63
|
-
style: {
|
|
64
|
-
height: '400px'
|
|
65
|
-
},
|
|
66
|
-
children: /*#__PURE__*/_jsx(Player, {
|
|
67
|
-
url: item.url,
|
|
68
|
-
hideContrallerBar: true
|
|
69
|
-
})
|
|
70
|
-
})
|
|
71
|
-
}, item.cid);
|
|
72
|
-
})]
|
|
73
|
-
})
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
export default App;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference path="../AMap.d.ts" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
export interface InfoWindowProps {
|
|
4
|
-
children: JSX.Element;
|
|
5
|
-
visible?: boolean;
|
|
6
|
-
center?: [number, number];
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
}
|
|
10
|
-
declare function InfoWindow({ children, visible, center, width, height }: InfoWindowProps): JSX.Element;
|
|
11
|
-
export default InfoWindow;
|
|
@@ -1,67 +0,0 @@
|
|
|
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
|
-
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; } }
|
|
3
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
4
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
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."); }
|
|
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); }
|
|
7
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
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; }
|
|
10
|
-
/* eslint-disable @typescript-eslint/triple-slash-reference */
|
|
11
|
-
/// <reference path="../AMap.d.ts" />
|
|
12
|
-
import React, { useContext, useEffect, useRef } from 'react';
|
|
13
|
-
import ReactDOM from 'react-dom';
|
|
14
|
-
import { mapContext } from "../Context";
|
|
15
|
-
import useMapType from "../hook/useMapType";
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
function InfoWindow(_ref) {
|
|
20
|
-
var children = _ref.children,
|
|
21
|
-
visible = _ref.visible,
|
|
22
|
-
center = _ref.center,
|
|
23
|
-
width = _ref.width,
|
|
24
|
-
height = _ref.height;
|
|
25
|
-
var _useContext = useContext(mapContext),
|
|
26
|
-
instance = _useContext.instance;
|
|
27
|
-
var domref = useRef(null);
|
|
28
|
-
var infoWindowRef = useRef();
|
|
29
|
-
var type = useMapType();
|
|
30
|
-
useEffect(function () {
|
|
31
|
-
if (!instance.map) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
// leaflet下还未实现
|
|
35
|
-
|
|
36
|
-
if (type.AMap && !infoWindowRef.current) {
|
|
37
|
-
var infoWindow = new AMap.InfoWindow({
|
|
38
|
-
size: [width, height],
|
|
39
|
-
content: domref.current,
|
|
40
|
-
autoMove: false,
|
|
41
|
-
offset: [0, -32]
|
|
42
|
-
});
|
|
43
|
-
infoWindowRef.current = infoWindow;
|
|
44
|
-
}
|
|
45
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
|
-
}, [instance.map, visible, center]);
|
|
47
|
-
useEffect(function () {
|
|
48
|
-
var infoWindow = infoWindowRef.current;
|
|
49
|
-
if (!infoWindow || !center) {
|
|
50
|
-
return undefined;
|
|
51
|
-
}
|
|
52
|
-
if (type.AMap) {
|
|
53
|
-
var map = instance.map;
|
|
54
|
-
var lnglat = _construct(AMap.LngLat, _toConsumableArray(center));
|
|
55
|
-
map.setCenter(lnglat);
|
|
56
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
57
|
-
visible ? !infoWindow.getIsOpen() ? (infoWindow.close(), infoWindow.open(instance.map, lnglat)) : infoWindow.open(instance.map, lnglat) : infoWindow.close();
|
|
58
|
-
}
|
|
59
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60
|
-
}, [visible, center, instance.map]);
|
|
61
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
62
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
63
|
-
ref: domref
|
|
64
|
-
}), domref.current && /*#__PURE__*/ReactDOM.createPortal(children, domref.current)]
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
export default InfoWindow;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface IDragMarkerProps {
|
|
3
|
-
center?: [number, number];
|
|
4
|
-
onChange?: (options: {
|
|
5
|
-
center: [number, number];
|
|
6
|
-
}) => void;
|
|
7
|
-
title?: string;
|
|
8
|
-
}
|
|
9
|
-
declare function DragMarker({ center, title, onChange }: IDragMarkerProps): JSX.Element;
|
|
10
|
-
export default DragMarker;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { mapContext } from "../../Context";
|
|
2
|
-
import React, { useContext, useEffect } from 'react';
|
|
3
|
-
import useMarker from "../../useMarker";
|
|
4
|
-
import { createMapCenterIcon } from "../../icon";
|
|
5
|
-
import useMapType from "../../hook/useMapType";
|
|
6
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
function DragMarker(_ref) {
|
|
9
|
-
var center = _ref.center,
|
|
10
|
-
title = _ref.title,
|
|
11
|
-
onChange = _ref.onChange;
|
|
12
|
-
var _useContext = useContext(mapContext),
|
|
13
|
-
instance = _useContext.instance;
|
|
14
|
-
var type = useMapType();
|
|
15
|
-
var marker = useMarker({
|
|
16
|
-
map: instance.map,
|
|
17
|
-
center: center,
|
|
18
|
-
createIcon: createMapCenterIcon,
|
|
19
|
-
options: {
|
|
20
|
-
draggable: true,
|
|
21
|
-
title: title
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
useEffect(function () {
|
|
25
|
-
if (!marker) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
marker.on('dragend', function (e) {
|
|
29
|
-
var latlng = type.leaflet ? e.target.getLatLng() : e.target.getPosition();
|
|
30
|
-
instance.setCenter(latlng);
|
|
31
|
-
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
32
|
-
center: [latlng.getLng(), latlng.getLat()]
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// instance.map.on('moveend', () => {
|
|
37
|
-
// const latlng = (type.leaflet ? marker.getLatLng() : marker.getPosition()) as LatLng;
|
|
38
|
-
// onChange?.({ center: [latlng.getLng(), latlng.getLat()] });
|
|
39
|
-
// });
|
|
40
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
|
-
}, [marker]);
|
|
42
|
-
return /*#__PURE__*/_jsx(_Fragment, {});
|
|
43
|
-
}
|
|
44
|
-
export default DragMarker;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
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."); }
|
|
9
|
-
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); }
|
|
10
|
-
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
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import { ConfigProvider } from 'antd';
|
|
14
|
-
import React, { useEffect, useState } from 'react';
|
|
15
|
-
import deviceList from "../points";
|
|
16
|
-
import LevelCenter from "./index";
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
var App = function App() {
|
|
19
|
-
var _useState = useState({
|
|
20
|
-
center: [113, 30],
|
|
21
|
-
zoom: 10
|
|
22
|
-
}),
|
|
23
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
-
state = _useState2[0],
|
|
25
|
-
setState = _useState2[1];
|
|
26
|
-
useEffect(function () {
|
|
27
|
-
console.log(state);
|
|
28
|
-
}, [state]);
|
|
29
|
-
return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
30
|
-
prefixCls: "cloudapp",
|
|
31
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
32
|
-
style: {
|
|
33
|
-
width: '100%',
|
|
34
|
-
height: 800
|
|
35
|
-
},
|
|
36
|
-
children: /*#__PURE__*/_jsx(LevelCenter, _objectSpread(_objectSpread({}, state), {}, {
|
|
37
|
-
enableClick: true,
|
|
38
|
-
points: deviceList,
|
|
39
|
-
onLevelCenterChange: function onLevelCenterChange(s) {
|
|
40
|
-
return setState(s);
|
|
41
|
-
}
|
|
42
|
-
}))
|
|
43
|
-
})
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
export default App;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { LatLng, MapPoint } from '../interface';
|
|
3
|
-
export interface ILevelCenter {
|
|
4
|
-
center?: [number, number];
|
|
5
|
-
zoom?: number;
|
|
6
|
-
points?: MapPoint[];
|
|
7
|
-
enableClick?: boolean;
|
|
8
|
-
onLevelCenterChange?: (options: {
|
|
9
|
-
center: [number, number] | LatLng;
|
|
10
|
-
zoom: number;
|
|
11
|
-
}) => void;
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
}
|
|
14
|
-
declare const _default: (props: ILevelCenter) => JSX.Element;
|
|
15
|
-
export default _default;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import _useMount from "ahooks/es/useMount";
|
|
2
|
-
import React, { useCallback, useContext, useMemo } from 'react';
|
|
3
|
-
import ClusterLayer from "../ClusterLayer";
|
|
4
|
-
import { mapContext } from "../Context";
|
|
5
|
-
import useMapEvent from "../hook/useMapEvent";
|
|
6
|
-
import ResetTools from "../ResetTools";
|
|
7
|
-
import withMap from "../withMap";
|
|
8
|
-
import DragMarker from "./DragMarker";
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
function LevelCenter(_ref) {
|
|
13
|
-
var center = _ref.center,
|
|
14
|
-
zoom = _ref.zoom,
|
|
15
|
-
points = _ref.points,
|
|
16
|
-
onLevelCenterChange = _ref.onLevelCenterChange,
|
|
17
|
-
enableClick = _ref.enableClick,
|
|
18
|
-
children = _ref.children;
|
|
19
|
-
var _useContext = useContext(mapContext),
|
|
20
|
-
instance = _useContext.instance;
|
|
21
|
-
var defaultCenter = useMemo(function () {
|
|
22
|
-
return center || instance.config.center;
|
|
23
|
-
}, [center, instance]);
|
|
24
|
-
var defaultZoom = useMemo(function () {
|
|
25
|
-
return zoom || instance.config.zoom;
|
|
26
|
-
}, [zoom, instance]);
|
|
27
|
-
|
|
28
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
|
-
var mapRest = useCallback(function () {
|
|
30
|
-
return instance.setZoomAndCenter(defaultZoom, defaultCenter);
|
|
31
|
-
}, [defaultZoom, defaultCenter]);
|
|
32
|
-
_useMount(function () {
|
|
33
|
-
if (enableClick) {
|
|
34
|
-
instance.setCursor('pointer');
|
|
35
|
-
}
|
|
36
|
-
mapRest();
|
|
37
|
-
});
|
|
38
|
-
useMapEvent('click', function (event) {
|
|
39
|
-
if (enableClick) {
|
|
40
|
-
var _center = [event.lnglat.lng, event.lnglat.lat];
|
|
41
|
-
instance.setCenter(_center);
|
|
42
|
-
onLevelCenterChange === null || onLevelCenterChange === void 0 ? void 0 : onLevelCenterChange({
|
|
43
|
-
center: _center,
|
|
44
|
-
zoom: instance.getZoom()
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
useMapEvent('zoomend', function () {
|
|
49
|
-
onLevelCenterChange === null || onLevelCenterChange === void 0 ? void 0 : onLevelCenterChange({
|
|
50
|
-
center: defaultCenter,
|
|
51
|
-
zoom: instance.getZoom()
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
55
|
-
children: [/*#__PURE__*/_jsx(ClusterLayer, {
|
|
56
|
-
points: points
|
|
57
|
-
}), /*#__PURE__*/_jsx(ResetTools, {
|
|
58
|
-
onMapReset: mapRest
|
|
59
|
-
}), /*#__PURE__*/_jsx(DragMarker, {
|
|
60
|
-
center: defaultCenter,
|
|
61
|
-
onChange: function onChange(_ref2) {
|
|
62
|
-
var center = _ref2.center;
|
|
63
|
-
return onLevelCenterChange === null || onLevelCenterChange === void 0 ? void 0 : onLevelCenterChange({
|
|
64
|
-
center: center,
|
|
65
|
-
zoom: instance.getZoom()
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}), children]
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
export default withMap(LevelCenter, 'lv-center-map-container');
|