@cloud-app-dev/vidc 3.2.11 → 3.2.14
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 +71 -0
- package/.editorconfig +0 -3
- package/.eslintrc.js +3 -0
- package/.fatherrc.ts +19 -0
- package/.husky/commit-msg +5 -0
- package/.husky/pre-commit +4 -0
- package/.prettierrc.js +16 -0
- package/README.md +14 -26
- package/es/Api/index.js +100 -30
- package/es/AppContext/Sync.js +19 -3
- package/es/AppContext/index.js +86 -42
- package/es/AppContext/static.js +7 -0
- package/es/Auth/index.js +11 -4
- package/es/AutoExit/index.js +11 -3
- package/es/Box/BetweenBox/index.js +19 -10
- package/es/Box/BetweenBox/{index.css → index.less} +0 -0
- package/es/Box/InfoBox/index.js +24 -18
- package/es/Box/InfoBox/index.less +22 -0
- package/es/Box/TwoColumnBox/index.js +42 -25
- package/es/Box/TwoColumnBox/index.less +70 -0
- package/es/Box/deps/grid-factory.d.ts +2 -2
- package/es/Box/deps/grid-factory.js +12 -0
- package/es/Box/index.js +29 -16
- package/es/Box/{index.css → index.less} +5 -4
- package/es/CheckGroupFixed/demo.d.ts +3 -0
- package/es/CheckGroupFixed/demo.js +28 -0
- package/es/CheckGroupFixed/index.js +117 -82
- package/es/CheckGroupFixed/index.less +50 -0
- package/es/Config/index.js +5 -1
- package/es/Config/utils.js +18 -3
- package/es/ConfigContext/index.js +8 -4
- package/es/CustomRenderSelect/index.js +71 -36
- package/es/CustomRenderSelect/index.less +25 -0
- package/es/DisableMark/index.js +14 -11
- package/es/DisableMark/{index.css → index.less} +0 -0
- package/es/DomMove/demo.js +14 -10
- package/es/DomMove/index.js +52 -30
- package/es/DomMove/utils.js +8 -3
- package/es/Drag/DragAndDropItem.js +44 -20
- package/es/Drag/DropItem.js +22 -6
- package/es/Drag/index.js +2 -2
- package/es/Drag/{index.css → index.less} +0 -0
- package/es/Drawer/Footer.js +22 -15
- package/es/Drawer/{Demo.d.ts → demo.d.ts} +0 -0
- package/es/Drawer/demo.js +109 -0
- package/es/Drawer/index.js +98 -60
- package/es/Drawer/index.less +42 -0
- package/es/ErrorFallback/index.js +23 -14
- package/es/FrontendPlayer/index.js +1 -1
- package/es/FullScreen/index.js +30 -17
- package/es/FullScreen/index.less +16 -0
- package/es/HightLevel/index.js +11 -4
- package/es/HightLevel/{index.css → index.less} +0 -0
- package/es/IconFont/index.js +39 -18
- package/es/ImageView/index.js +37 -13
- package/es/ImageView/index.less +10 -0
- package/es/Input/demo.d.ts +3 -0
- package/es/Input/demo.js +16 -0
- package/es/Input/index.js +46 -22
- package/es/Input/index.less +12 -0
- package/es/InstanceHistory/index.js +2 -0
- package/es/LabelValue/index.js +25 -18
- package/es/LabelValue/index.less +20 -0
- package/es/List/DynamicGridList/Demo.d.ts +1 -0
- package/es/List/DynamicGridList/Demo.js +52 -32
- package/es/List/DynamicGridList/index.d.ts +3 -3
- package/es/List/DynamicGridList/index.js +41 -26
- package/es/List/DynamicList/index.js +76 -56
- package/es/List/DynamicList/index.less +15 -0
- package/es/List/GridList/Demo.d.ts +1 -0
- package/es/List/GridList/Demo.js +60 -38
- package/es/List/GridList/hook.d.ts +1 -1
- package/es/List/GridList/hook.js +66 -35
- package/es/List/GridList/index.js +33 -29
- package/es/List/GridList/{index.css → index.less} +0 -0
- package/es/List/GridList/utils.d.ts +2 -2
- package/es/List/GridList/utils.js +1 -0
- package/es/List/VList/index.d.ts +1 -1
- package/es/List/VList/index.js +32 -19
- package/es/List/VList/{index.css → index.less} +0 -0
- package/es/List/VList/utils.d.ts +2 -2
- package/es/List/VList/utils.js +8 -6
- package/es/List/demo.d.ts +3 -0
- package/es/List/demo.js +26 -0
- package/es/List/index.d.ts +1 -1
- package/es/List/index.js +31 -23
- package/es/List/{index.css → index.less} +5 -4
- package/es/ListWithSizeAnimate/demo.d.ts +2 -0
- package/es/ListWithSizeAnimate/demo.js +19 -0
- package/es/ListWithSizeAnimate/index.d.ts +9 -0
- package/es/ListWithSizeAnimate/index.js +71 -0
- package/es/ListWithSizeAnimate/index.less +13 -0
- package/es/LoaderApp/index.js +59 -25
- package/es/LoaderApp/{index.css → index.less} +0 -0
- package/es/LoaderApp/loader.js +40 -23
- package/es/LoaderApp/sandbox.back.js +101 -24
- package/es/LoaderApp/sandbox.js +26 -9
- package/es/LoaderApp/utils.d.ts +1 -1
- package/es/LoaderApp/utils.js +68 -25
- package/es/LoaderScript/index.js +25 -10
- package/es/LoaderScript/utils.js +151 -87
- package/es/Map/BasicMap/AMapInstance.d.ts +1 -1
- package/es/Map/BasicMap/AMapInstance.js +25 -3
- package/es/Map/BasicMap/LeafletInstance.js +28 -11
- package/es/Map/BasicMap/index.js +67 -27
- package/es/Map/BasicMap/index.less +24 -0
- package/es/Map/ClusterLayer/hook.d.ts +2 -2
- package/es/Map/ClusterLayer/hook.js +51 -23
- package/es/Map/ClusterLayer/index.d.ts +1 -1
- package/es/Map/ClusterLayer/index.js +14 -6
- package/es/Map/ClusterLayer/index.less +27 -0
- package/es/Map/Config/index.js +44 -16
- package/es/Map/Config/utils.js +17 -3
- package/es/Map/Context/index.js +43 -9
- package/es/Map/FindPio/index.js +5 -2
- package/es/Map/FindPio/{index.css → index.less} +0 -0
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +1 -1
- package/es/Map/InfoWindow/MakerLikeWindow.js +41 -18
- package/es/Map/InfoWindow/demo.d.ts +1 -0
- package/es/Map/InfoWindow/demo.js +51 -29
- package/es/Map/InfoWindow/index.d.ts +1 -1
- package/es/Map/InfoWindow/index.js +39 -18
- package/es/Map/LevelCenter/DragMarker/index.js +16 -10
- package/es/Map/LevelCenter/demo.d.ts +1 -0
- package/es/Map/LevelCenter/demo.js +41 -22
- package/es/Map/LevelCenter/index.js +41 -29
- package/es/Map/LevelCenter/index.less +2 -0
- package/es/Map/LoaderMap/index.js +38 -22
- package/es/Map/MapDrawSelect/demo.d.ts +1 -0
- package/es/Map/MapDrawSelect/demo.js +65 -46
- package/es/Map/MapDrawSelect/index.js +43 -31
- package/es/Map/MapDrawSelect/index.less +2 -0
- package/es/Map/MouseTool/index.js +32 -18
- package/es/Map/MouseTool/useMouseTools.js +37 -8
- package/es/Map/ResetTools/index.js +58 -44
- package/es/Map/ResetTools/index.less +35 -0
- package/es/Map/SinglePoint/index.js +39 -27
- package/es/Map/SinglePoint/index.less +41 -0
- package/es/Map/hook/useMapEvent.js +8 -4
- package/es/Map/hook/useMapType.js +3 -2
- package/es/Map/index.d.ts +1 -0
- package/es/Map/index.js +11 -11
- package/es/Map/useMarker/index.d.ts +1 -1
- package/es/Map/useMarker/index.js +33 -13
- package/es/Map/{LevelCenter/index.css → useMarker/index.less} +0 -0
- package/es/Map/withMap/index.d.ts +1 -0
- package/es/Map/withMap/index.js +14 -4
- package/es/Modal/demo.d.ts +3 -0
- package/es/Modal/demo.js +106 -0
- package/es/Modal/index.js +94 -57
- package/es/Modal/index.less +45 -0
- package/es/Picture/component/DefaultRects/RectInfo.js +59 -37
- package/es/Picture/component/DefaultRects/index.js +46 -32
- package/es/Picture/component/DefaultRects/index.less +188 -0
- package/es/Picture/component/DrawRect/index.js +37 -24
- package/es/Picture/component/DrawRect/{index.css → index.less} +0 -0
- package/es/Picture/component/RectMenu/index.js +35 -26
- package/es/Picture/component/RectMenu/index.less +31 -0
- package/es/Picture/component/RectMenu/utils.js +6 -3
- package/es/Picture/component/Tools/index.js +91 -69
- package/es/Picture/component/Tools/index.less +43 -0
- package/es/Picture/component/WheelScale/index.js +9 -4
- package/es/Picture/demo.js +14 -11
- package/es/Picture/dragBound.d.ts +1 -1
- package/es/Picture/dragBound.js +17 -4
- package/es/Picture/index.d.ts +2 -2
- package/es/Picture/index.js +201 -137
- package/es/Picture/index.less +14 -0
- package/es/Picture/interface.d.ts +0 -6
- package/es/Picture/loadCaptureRectImage.d.ts +1 -1
- package/es/Picture/loadCaptureRectImage.js +39 -14
- package/es/Picture/useDraw.js +40 -20
- package/es/Picture/utils.d.ts +9 -9
- package/es/Picture/utils.js +18 -3
- package/es/Player/api/index.d.ts +3 -3
- package/es/Player/api/index.js +117 -82
- package/es/Player/context.js +21 -7
- package/es/Player/contraller_bar/bar.d.ts +1 -1
- package/es/Player/contraller_bar/bar.js +28 -10
- package/es/Player/contraller_bar/contraller_event.js +34 -12
- package/es/Player/contraller_bar/index.js +30 -22
- package/es/Player/contraller_bar/left_bar.js +62 -39
- package/es/Player/contraller_bar/right_bar.js +34 -18
- package/es/Player/contraller_bar/time.js +19 -8
- package/es/Player/contraller_bar/useBarStatus.js +29 -11
- package/es/Player/contraller_bar/volume.d.ts +1 -1
- package/es/Player/contraller_bar/volume.js +43 -21
- package/es/Player/demo.d.ts +1 -0
- package/es/Player/demo.js +258 -215
- package/es/Player/event/errorEvent.js +41 -16
- package/es/Player/event/eventName.js +12 -1
- package/es/Player/event/index.js +66 -24
- package/es/Player/fps_play.js +33 -15
- package/es/Player/frontend_player.js +42 -20
- package/es/Player/frontend_timeline.js +95 -55
- package/es/Player/iconfont.js +23 -8
- package/es/Player/index.js +1 -1
- package/es/Player/live_heart.js +15 -3
- package/es/Player/message.js +68 -37
- package/es/Player/segment_player.js +113 -62
- package/es/Player/segment_timeline.js +145 -97
- package/es/Player/single_player.js +153 -111
- package/es/Player/style/bar.less +39 -0
- package/es/Player/style/iconfont.js +17 -10
- package/es/Player/style/index.less +30 -0
- package/es/Player/style/message.less +50 -0
- package/es/Player/style/slider.less +103 -0
- package/es/Player/style/timeline.less +106 -0
- package/es/Player/style/volume.less +21 -0
- package/es/Player/timeline.d.ts +1 -1
- package/es/Player/timeline.js +59 -32
- package/es/Player/util.js +46 -7
- package/es/PlayerExt/demo.d.ts +1 -0
- package/es/PlayerExt/demo.js +145 -112
- package/es/PlayerExt/index.d.ts +2 -2
- package/es/PlayerExt/index.js +139 -87
- package/es/PlayerExt/{index.css → index.less} +0 -0
- package/es/Progress/index.js +18 -5
- package/es/Progress/index.less +20 -0
- package/es/ROI/demo.d.ts +1 -0
- package/es/ROI/demo.js +12 -8
- package/es/ROI/index.js +45 -35
- package/es/ROI/index.less +29 -0
- package/es/ScreenPlayer/Live.d.ts +2 -2
- package/es/ScreenPlayer/Live.js +172 -109
- package/es/ScreenPlayer/LiveTools.d.ts +2 -2
- package/es/ScreenPlayer/LiveTools.js +156 -116
- package/es/ScreenPlayer/PlayerWithExt.d.ts +2 -2
- package/es/ScreenPlayer/PlayerWithExt.js +172 -115
- package/es/ScreenPlayer/RatePick.js +35 -22
- package/es/ScreenPlayer/Record.d.ts +1 -1
- package/es/ScreenPlayer/Record.js +307 -192
- package/es/ScreenPlayer/RecordTools.d.ts +2 -2
- package/es/ScreenPlayer/RecordTools.js +201 -149
- package/es/ScreenPlayer/ScreenSelect.js +37 -28
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +1 -1
- package/es/ScreenPlayer/SegmentTimeLine.js +24 -17
- package/es/ScreenPlayer/TimeMode.js +22 -16
- package/es/ScreenPlayer/TimeSelect.js +86 -65
- package/es/ScreenPlayer/demo.js +16 -18
- package/es/ScreenPlayer/demo2.js +193 -178
- package/es/ScreenPlayer/index.d.ts +1 -0
- package/es/ScreenPlayer/index.js +3 -3
- package/es/ScreenPlayer/index.less +178 -0
- package/es/ScreenPlayer/interface.d.ts +2 -2
- package/es/ScreenPlayer/useTimeSlider.d.ts +8 -8
- package/es/ScreenPlayer/useTimeSlider.js +167 -60
- package/es/ScreenPlayer/useVideoFit.d.ts +1 -1
- package/es/ScreenPlayer/useVideoFit.js +18 -5
- package/es/ScreenPlayer/utils.d.ts +1 -1
- package/es/ScreenPlayer/utils.js +10 -1
- package/es/SegmentPlayer/index.js +1 -1
- package/es/Service/fetch-adapter.d.ts +1 -1
- package/es/Service/fetch-adapter.js +48 -5
- package/es/Service/http.js +46 -16
- package/es/Service/index.js +2 -2
- package/es/TableLayout/index.js +18 -12
- package/es/TableLayout/{index.css → index.less} +0 -0
- package/es/ThemeAntd/demo.d.ts +1 -0
- package/es/ThemeAntd/demo.js +126 -76
- package/es/ThemeAntd/{demo.css → demo.less} +4 -3
- package/es/ThemeAntd/index.js +6 -2
- package/es/ThemeAntd/index.less +16 -0
- package/es/ThemeAntd/style/button.less +67 -0
- package/es/ThemeAntd/style/checkbox.less +72 -0
- package/es/ThemeAntd/style/form.less +12 -0
- package/es/ThemeAntd/style/input.less +83 -0
- package/es/ThemeAntd/style/pagination.less +95 -0
- package/es/ThemeAntd/style/picker.less +106 -0
- package/es/ThemeAntd/style/popover.less +5 -0
- package/es/ThemeAntd/style/radio.less +87 -0
- package/es/ThemeAntd/style/{scrollbar.css → scrollbar.less} +4 -2
- package/es/ThemeAntd/style/select.less +81 -0
- package/es/ThemeAntd/style/table.less +57 -0
- package/es/ThemeAntd/style/tree.less +18 -0
- package/es/Timeout/index.js +36 -12
- package/es/Tree/demo.js +26 -21
- package/es/Tree/index.js +51 -30
- package/es/Tree/index.less +59 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +48 -47
- package/es/useDrawROI/index.js +130 -65
- package/es/useEventEmitterHandle/index.js +6 -2
- package/es/useFullscreen/demo.js +44 -27
- package/es/useFullscreen/index.js +30 -8
- package/es/useHistory/index.js +3 -1
- package/es/useInfiniteScroll/index.js +50 -19
- package/es/useRafInterval/index.js +28 -4
- package/es/useSimpleState/index.js +23 -6
- package/es/useVirtualList/index.js +58 -20
- package/es/utils.d.ts +1 -1
- package/es/utils.js +53 -14
- package/package.json +37 -32
- package/tsconfig.json +8 -32
- package/.eslintrc +0 -4
- package/.fatherrc.js +0 -25
- package/.prettierrc +0 -11
- package/.umirc.ts +0 -55
- package/clear-cache.sh +0 -4
- package/es/Box/InfoBox/index.css +0 -22
- package/es/Box/TwoColumnBox/index.css +0 -70
- package/es/CheckGroupFixed/index.css +0 -49
- package/es/CustomRenderSelect/index.css +0 -20
- package/es/Drawer/Demo.js +0 -59
- package/es/Drawer/index.css +0 -40
- package/es/FullScreen/index.css +0 -16
- package/es/ImageView/index.css +0 -10
- package/es/Input/index.css +0 -8
- package/es/LabelValue/index.css +0 -18
- package/es/List/DynamicList/index.css +0 -15
- package/es/Map/BasicMap/index.css +0 -24
- package/es/Map/ClusterLayer/index.css +0 -26
- package/es/Map/MapDrawSelect/index.css +0 -0
- package/es/Map/ResetTools/index.css +0 -32
- package/es/Map/SinglePoint/icon/Place_icon_OnLine_Hover.svg +0 -15
- package/es/Map/SinglePoint/icon/Place_icon_OnLine_Normal.svg +0 -15
- package/es/Map/SinglePoint/icon/Place_icon_OutLine_Hover.svg +0 -15
- package/es/Map/SinglePoint/icon/Place_icon_OutLine_Normal.svg +0 -15
- package/es/Map/SinglePoint/index.css +0 -29
- package/es/Map/useMarker/index.css +0 -0
- package/es/Modal/index.css +0 -43
- package/es/Picture/component/DefaultRects/index.css +0 -247
- package/es/Picture/component/RectMenu/index.css +0 -31
- package/es/Picture/component/Tools/index.css +0 -42
- package/es/Picture/index.css +0 -12
- package/es/Player/style/bar.css +0 -38
- package/es/Player/style/index.css +0 -30
- package/es/Player/style/message.css +0 -49
- package/es/Player/style/slider.css +0 -96
- package/es/Player/style/timeline.css +0 -99
- package/es/Player/style/volume.css +0 -19
- package/es/Progress/index.css +0 -20
- package/es/ROI/index.css +0 -29
- package/es/ScreenPlayer/index.css +0 -166
- package/es/ThemeAntd/index.css +0 -620
- package/es/ThemeAntd/style/button.css +0 -55
- package/es/ThemeAntd/style/checkbox.css +0 -64
- package/es/ThemeAntd/style/form.css +0 -10
- package/es/ThemeAntd/style/input.css +0 -68
- package/es/ThemeAntd/style/pagination.css +0 -82
- package/es/ThemeAntd/style/picker.css +0 -98
- package/es/ThemeAntd/style/popover.css +0 -3
- package/es/ThemeAntd/style/radio.css +0 -80
- package/es/ThemeAntd/style/select.css +0 -76
- package/es/ThemeAntd/style/table.css +0 -46
- package/es/ThemeAntd/style/tree.css +0 -16
- package/es/Tree/index.css +0 -64
package/es/Map/Context/index.js
CHANGED
|
@@ -1,46 +1,80 @@
|
|
|
1
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
|
+
|
|
3
|
+
var _excluded = ["forwardRef"];
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
2
15
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
+
|
|
3
17
|
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, descriptor.key, descriptor); } }
|
|
18
|
+
|
|
4
19
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
20
|
+
|
|
5
21
|
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); }
|
|
22
|
+
|
|
6
23
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
24
|
+
|
|
7
25
|
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); }; }
|
|
26
|
+
|
|
8
27
|
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); }
|
|
28
|
+
|
|
9
29
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
30
|
+
|
|
10
31
|
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; } }
|
|
32
|
+
|
|
11
33
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
|
-
|
|
34
|
+
|
|
13
35
|
import React from 'react';
|
|
36
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
37
|
export var mapContext = /*#__PURE__*/React.createContext(null);
|
|
15
38
|
export var Provider = mapContext.Provider;
|
|
16
39
|
export var Consumer = mapContext.Consumer;
|
|
40
|
+
|
|
17
41
|
function map(Component) {
|
|
18
42
|
var MapWithComponent = /*#__PURE__*/function (_React$Component) {
|
|
19
43
|
_inherits(MapWithComponent, _React$Component);
|
|
44
|
+
|
|
20
45
|
var _super = _createSuper(MapWithComponent);
|
|
46
|
+
|
|
21
47
|
function MapWithComponent() {
|
|
22
48
|
_classCallCheck(this, MapWithComponent);
|
|
49
|
+
|
|
23
50
|
return _super.apply(this, arguments);
|
|
24
51
|
}
|
|
52
|
+
|
|
25
53
|
_createClass(MapWithComponent, [{
|
|
26
54
|
key: "render",
|
|
27
55
|
value: function render() {
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
56
|
+
var _this$props = this.props,
|
|
57
|
+
forwardRef = _this$props.forwardRef,
|
|
58
|
+
props = _objectWithoutProperties(_this$props, _excluded);
|
|
59
|
+
|
|
60
|
+
return /*#__PURE__*/_jsx(Consumer, {
|
|
61
|
+
children: function children(context) {
|
|
62
|
+
return /*#__PURE__*/_jsx(Component, _objectSpread(_objectSpread(_objectSpread({}, props), context), {}, {
|
|
63
|
+
ref: forwardRef
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
35
66
|
});
|
|
36
67
|
}
|
|
37
68
|
}]);
|
|
69
|
+
|
|
38
70
|
return MapWithComponent;
|
|
39
71
|
}(React.Component);
|
|
72
|
+
|
|
40
73
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
41
|
-
return /*#__PURE__*/
|
|
74
|
+
return /*#__PURE__*/_jsx(MapWithComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
42
75
|
forwardRef: ref
|
|
43
76
|
}));
|
|
44
77
|
});
|
|
45
78
|
}
|
|
79
|
+
|
|
46
80
|
export default map;
|
package/es/Map/FindPio/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import "antd/lib/select/style";
|
|
2
2
|
import _Select from "antd/lib/select";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import "./index.
|
|
4
|
+
import "./index.less";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
5
7
|
function FindPio() {
|
|
6
|
-
return /*#__PURE__*/
|
|
8
|
+
return /*#__PURE__*/_jsx(_Select, {
|
|
7
9
|
className: "map-find-pio",
|
|
8
10
|
labelInValue: true,
|
|
9
11
|
notFoundContent: null,
|
|
@@ -11,4 +13,5 @@ function FindPio() {
|
|
|
11
13
|
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
|
|
12
14
|
});
|
|
13
15
|
}
|
|
16
|
+
|
|
14
17
|
export default FindPio;
|
|
File without changes
|
|
@@ -1,35 +1,50 @@
|
|
|
1
1
|
import _useUnmount from "ahooks/es/useUnmount";
|
|
2
|
+
|
|
2
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
|
+
|
|
3
5
|
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; } }
|
|
6
|
+
|
|
4
7
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
8
|
+
|
|
5
9
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
10
|
+
|
|
6
11
|
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."); }
|
|
12
|
+
|
|
7
13
|
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); }
|
|
14
|
+
|
|
8
15
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
16
|
+
|
|
9
17
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
18
|
+
|
|
10
19
|
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; }
|
|
20
|
+
|
|
11
21
|
/// <reference path="../AMap.d.ts" />
|
|
12
22
|
import React, { useContext, useEffect, useRef } from 'react';
|
|
13
23
|
import ReactDOM from 'react-dom';
|
|
14
|
-
import { mapContext } from
|
|
15
|
-
import useMapType from
|
|
24
|
+
import { mapContext } from "../Context";
|
|
25
|
+
import useMapType from "../hook/useMapType";
|
|
26
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
28
|
var maxIndex = 20;
|
|
17
29
|
export default function MakerLikeWindow(_ref) {
|
|
18
30
|
var children = _ref.children,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
visible = _ref.visible,
|
|
32
|
+
center = _ref.center,
|
|
33
|
+
width = _ref.width,
|
|
34
|
+
height = _ref.height;
|
|
35
|
+
|
|
23
36
|
var _useContext = useContext(mapContext),
|
|
24
|
-
|
|
37
|
+
instance = _useContext.instance;
|
|
38
|
+
|
|
25
39
|
var domref = useRef(null);
|
|
26
40
|
var markerRef = useRef(null);
|
|
27
41
|
var type = useMapType();
|
|
28
42
|
useEffect(function () {
|
|
29
43
|
if (!instance.map) {
|
|
30
44
|
return;
|
|
31
|
-
}
|
|
32
|
-
|
|
45
|
+
} // leaflet下还未实现
|
|
46
|
+
|
|
47
|
+
|
|
33
48
|
if (type.AMap && !markerRef.current) {
|
|
34
49
|
var marker = new AMap.Marker({
|
|
35
50
|
content: domref.current,
|
|
@@ -41,6 +56,7 @@ export default function MakerLikeWindow(_ref) {
|
|
|
41
56
|
markerRef.current = marker;
|
|
42
57
|
marker.on('click', function () {
|
|
43
58
|
maxIndex++;
|
|
59
|
+
|
|
44
60
|
if (marker.getzIndex() !== maxIndex) {
|
|
45
61
|
marker.setzIndex(maxIndex);
|
|
46
62
|
}
|
|
@@ -49,11 +65,14 @@ export default function MakerLikeWindow(_ref) {
|
|
|
49
65
|
}, [instance.map, visible, center]);
|
|
50
66
|
useEffect(function () {
|
|
51
67
|
var marker = markerRef.current;
|
|
68
|
+
|
|
52
69
|
if (!marker || !center) {
|
|
53
70
|
return undefined;
|
|
54
71
|
}
|
|
72
|
+
|
|
55
73
|
if (type.AMap) {
|
|
56
74
|
var lnglat = _construct(AMap.LngLat, _toConsumableArray(center));
|
|
75
|
+
|
|
57
76
|
if (visible) {
|
|
58
77
|
marker.setPosition(lnglat);
|
|
59
78
|
marker.setContent(domref.current);
|
|
@@ -65,20 +84,24 @@ export default function MakerLikeWindow(_ref) {
|
|
|
65
84
|
instance.map.remove(markerRef.current);
|
|
66
85
|
markerRef.current = null;
|
|
67
86
|
}
|
|
68
|
-
}
|
|
69
|
-
|
|
87
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
88
|
+
|
|
70
89
|
}, [visible, center, instance.map]);
|
|
90
|
+
|
|
71
91
|
_useUnmount(function () {
|
|
72
92
|
try {
|
|
73
93
|
instance.map.remove(markerRef.current);
|
|
74
94
|
markerRef.current = null;
|
|
75
95
|
} catch (_) {}
|
|
76
96
|
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
97
|
+
|
|
98
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
99
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
100
|
+
ref: domref,
|
|
101
|
+
style: {
|
|
102
|
+
width: width,
|
|
103
|
+
height: height
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
});
|
|
84
107
|
}
|
|
@@ -1,32 +1,47 @@
|
|
|
1
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
|
|
2
3
|
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."); }
|
|
4
|
+
|
|
3
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
|
|
4
7
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
+
|
|
5
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
|
|
6
11
|
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."); }
|
|
12
|
+
|
|
7
13
|
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); }
|
|
14
|
+
|
|
8
15
|
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; }
|
|
16
|
+
|
|
9
17
|
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; }
|
|
18
|
+
|
|
10
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
|
|
11
21
|
import React, { useState } from 'react';
|
|
12
|
-
import Map from
|
|
13
|
-
import ClusterLayer from
|
|
14
|
-
import InfoWindow from
|
|
15
|
-
import deviceList from
|
|
16
|
-
import Player from
|
|
22
|
+
import Map from "../BasicMap";
|
|
23
|
+
import ClusterLayer from "../ClusterLayer";
|
|
24
|
+
import InfoWindow from "./MakerLikeWindow";
|
|
25
|
+
import deviceList from "../points.json";
|
|
26
|
+
import Player from "../../Player";
|
|
27
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
+
|
|
17
30
|
var App = function App() {
|
|
18
31
|
var _useState = useState([]),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
state = _useState2[0],
|
|
34
|
+
setState = _useState2[1];
|
|
35
|
+
|
|
22
36
|
var addDeviceInfoWindow = function addDeviceInfoWindow(item) {
|
|
23
37
|
var longitude = item.longitude,
|
|
24
|
-
|
|
25
|
-
|
|
38
|
+
latitude = item.latitude,
|
|
39
|
+
cid = item.cid;
|
|
26
40
|
var arr = state;
|
|
27
41
|
var index = arr.findIndex(function (v) {
|
|
28
42
|
return v.cid === cid;
|
|
29
43
|
});
|
|
44
|
+
|
|
30
45
|
if (index === -1) {
|
|
31
46
|
arr.push({
|
|
32
47
|
visible: true,
|
|
@@ -35,32 +50,39 @@ var App = function App() {
|
|
|
35
50
|
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
|
|
36
51
|
});
|
|
37
52
|
}
|
|
53
|
+
|
|
38
54
|
if (index > -1 && !arr[index].visible) {
|
|
39
55
|
arr[index].visible = true;
|
|
40
56
|
}
|
|
57
|
+
|
|
41
58
|
setState(_toConsumableArray(arr));
|
|
42
59
|
};
|
|
43
|
-
|
|
60
|
+
|
|
61
|
+
return /*#__PURE__*/_jsx("div", {
|
|
44
62
|
style: {
|
|
45
63
|
width: '100%',
|
|
46
64
|
height: 800
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
},
|
|
66
|
+
children: /*#__PURE__*/_jsxs(Map, {
|
|
67
|
+
children: [/*#__PURE__*/_jsx(ClusterLayer, {
|
|
68
|
+
points: deviceList,
|
|
69
|
+
onPointClick: function onPointClick(point) {
|
|
70
|
+
return addDeviceInfoWindow(point);
|
|
71
|
+
}
|
|
72
|
+
}), state.map(function (item) {
|
|
73
|
+
return /*#__PURE__*/_jsx(InfoWindow, {
|
|
74
|
+
visible: item.visible,
|
|
75
|
+
center: item.center,
|
|
76
|
+
width: 200,
|
|
77
|
+
height: 100,
|
|
78
|
+
children: /*#__PURE__*/_jsx(Player, {
|
|
79
|
+
url: item.url,
|
|
80
|
+
hideContrallerBar: true
|
|
81
|
+
})
|
|
82
|
+
}, item.cid);
|
|
83
|
+
})]
|
|
84
|
+
})
|
|
85
|
+
});
|
|
65
86
|
};
|
|
87
|
+
|
|
66
88
|
export default App;
|
|
@@ -1,33 +1,48 @@
|
|
|
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
|
+
|
|
2
3
|
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
|
+
|
|
3
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
|
+
|
|
4
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
|
|
5
9
|
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
|
+
|
|
6
11
|
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
|
+
|
|
7
13
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
14
|
+
|
|
8
15
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
16
|
+
|
|
9
17
|
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
|
+
|
|
10
19
|
/// <reference path="../AMap.d.ts" />
|
|
11
20
|
import React, { useContext, useEffect, useRef } from 'react';
|
|
12
21
|
import ReactDOM from 'react-dom';
|
|
13
|
-
import { mapContext } from
|
|
14
|
-
import useMapType from
|
|
22
|
+
import { mapContext } from "../Context";
|
|
23
|
+
import useMapType from "../hook/useMapType";
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
27
|
export default function InfoWindow(_ref) {
|
|
16
28
|
var children = _ref.children,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
visible = _ref.visible,
|
|
30
|
+
center = _ref.center,
|
|
31
|
+
width = _ref.width,
|
|
32
|
+
height = _ref.height;
|
|
33
|
+
|
|
21
34
|
var _useContext = useContext(mapContext),
|
|
22
|
-
|
|
35
|
+
instance = _useContext.instance;
|
|
36
|
+
|
|
23
37
|
var domref = useRef(null);
|
|
24
38
|
var infoWindowRef = useRef(null);
|
|
25
39
|
var type = useMapType();
|
|
26
40
|
useEffect(function () {
|
|
27
41
|
if (!instance.map) {
|
|
28
42
|
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
43
|
+
} // leaflet下还未实现
|
|
44
|
+
|
|
45
|
+
|
|
31
46
|
if (type.AMap && !infoWindowRef.current) {
|
|
32
47
|
var infoWindow = new AMap.InfoWindow({
|
|
33
48
|
size: [width, height],
|
|
@@ -36,24 +51,30 @@ export default function InfoWindow(_ref) {
|
|
|
36
51
|
offset: [0, -32]
|
|
37
52
|
});
|
|
38
53
|
infoWindowRef.current = infoWindow;
|
|
39
|
-
}
|
|
40
|
-
|
|
54
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
|
+
|
|
41
56
|
}, [instance.map, visible, center]);
|
|
42
57
|
useEffect(function () {
|
|
43
58
|
var infoWindow = infoWindowRef.current;
|
|
59
|
+
|
|
44
60
|
if (!infoWindow || !center) {
|
|
45
61
|
return undefined;
|
|
46
62
|
}
|
|
63
|
+
|
|
47
64
|
if (type.AMap) {
|
|
48
65
|
var map = instance.map;
|
|
66
|
+
|
|
49
67
|
var lnglat = _construct(AMap.LngLat, _toConsumableArray(center));
|
|
50
|
-
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
68
|
+
|
|
69
|
+
map.setCenter(lnglat); // eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
70
|
+
|
|
52
71
|
visible ? !infoWindow.getIsOpen() ? (infoWindow.close(), infoWindow.open(instance.map, lnglat)) : infoWindow.open(instance.map, lnglat) : infoWindow.close();
|
|
53
|
-
}
|
|
54
|
-
|
|
72
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
|
+
|
|
55
74
|
}, [visible, center, instance.map]);
|
|
56
|
-
return /*#__PURE__*/
|
|
57
|
-
|
|
58
|
-
|
|
75
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
76
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
77
|
+
ref: domref
|
|
78
|
+
}), domref.current && /*#__PURE__*/ReactDOM.createPortal(children, domref.current)]
|
|
79
|
+
});
|
|
59
80
|
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { mapContext } from
|
|
1
|
+
import { mapContext } from "../../Context";
|
|
2
2
|
import React, { useContext, useEffect } from 'react';
|
|
3
|
-
import useMarker from
|
|
4
|
-
import { createMapCenterIcon } from
|
|
5
|
-
import useMapType from
|
|
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
|
+
|
|
6
9
|
function DragMarker(_ref) {
|
|
7
10
|
var center = _ref.center,
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
title = _ref.title,
|
|
12
|
+
onChange = _ref.onChange;
|
|
13
|
+
|
|
10
14
|
var _useContext = useContext(mapContext),
|
|
11
|
-
|
|
15
|
+
instance = _useContext.instance;
|
|
16
|
+
|
|
12
17
|
var type = useMapType();
|
|
13
18
|
var marker = useMarker({
|
|
14
19
|
map: instance.map,
|
|
@@ -23,19 +28,20 @@ function DragMarker(_ref) {
|
|
|
23
28
|
if (!marker) {
|
|
24
29
|
return;
|
|
25
30
|
}
|
|
31
|
+
|
|
26
32
|
marker.on('dragend', function (e) {
|
|
27
33
|
var latlng = type.leaflet ? e.target.getLatLng() : e.target.getPosition();
|
|
28
34
|
instance.setCenter(latlng);
|
|
29
35
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
30
36
|
center: [latlng.getLng(), latlng.getLat()]
|
|
31
37
|
});
|
|
32
|
-
});
|
|
33
|
-
// instance.map.on('moveend', () => {
|
|
38
|
+
}); // instance.map.on('moveend', () => {
|
|
34
39
|
// const latlng = (type.leaflet ? marker.getLatLng() : marker.getPosition()) as LatLng;
|
|
35
40
|
// onChange?.({ center: [latlng.getLng(), latlng.getLat()] });
|
|
36
41
|
// });
|
|
37
42
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
43
|
}, [marker]);
|
|
39
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/_jsx(_Fragment, {});
|
|
40
45
|
}
|
|
46
|
+
|
|
41
47
|
export default DragMarker;
|
|
@@ -1,38 +1,57 @@
|
|
|
1
1
|
import "antd/lib/config-provider/style";
|
|
2
2
|
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
|
+
|
|
4
|
+
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; }
|
|
5
|
+
|
|
6
|
+
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; }
|
|
7
|
+
|
|
8
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
|
|
3
10
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
|
|
4
12
|
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."); }
|
|
13
|
+
|
|
5
14
|
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); }
|
|
15
|
+
|
|
6
16
|
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; }
|
|
17
|
+
|
|
7
18
|
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; }
|
|
19
|
+
|
|
8
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
+
|
|
9
22
|
import React, { useEffect, useState } from 'react';
|
|
10
|
-
import LevelCenter from
|
|
11
|
-
import deviceList from
|
|
23
|
+
import LevelCenter from "./index";
|
|
24
|
+
import deviceList from "../points.json";
|
|
25
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
|
+
|
|
12
27
|
var App = function App() {
|
|
13
28
|
var _useState = useState({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
center: [113, 30],
|
|
30
|
+
zoom: 10
|
|
31
|
+
}),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
state = _useState2[0],
|
|
34
|
+
setState = _useState2[1];
|
|
35
|
+
|
|
20
36
|
useEffect(function () {
|
|
21
37
|
console.log(state);
|
|
22
38
|
}, [state]);
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
-
prefixCls: "cloudapp"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
return /*#__PURE__*/_jsx(_ConfigProvider, {
|
|
40
|
+
prefixCls: "cloudapp",
|
|
41
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
42
|
+
style: {
|
|
43
|
+
width: '100%',
|
|
44
|
+
height: 800
|
|
45
|
+
},
|
|
46
|
+
children: /*#__PURE__*/_jsx(LevelCenter, _objectSpread(_objectSpread({}, state), {}, {
|
|
47
|
+
enableClick: true,
|
|
48
|
+
points: deviceList,
|
|
49
|
+
onLevelCenterChange: function onLevelCenterChange(s) {
|
|
50
|
+
return setState(s);
|
|
51
|
+
}
|
|
52
|
+
}))
|
|
53
|
+
})
|
|
54
|
+
});
|
|
37
55
|
};
|
|
56
|
+
|
|
38
57
|
export default App;
|