@cloud-app-dev/vidc 4.0.15 → 4.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dumirc.ts +2 -18
- package/.fatherrc.ts +0 -1
- package/package.json +35 -31
- package/release-build.sh +1 -2
- package/es/AppContext/Sync.d.ts +0 -8
- package/es/AppContext/Sync.js +0 -44
- package/es/AppContext/index.d.ts +0 -10
- package/es/AppContext/index.js +0 -144
- package/es/AppContext/interface.d.ts +0 -41
- package/es/AppContext/static.d.ts +0 -8
- package/es/AppContext/static.js +0 -9
- 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/demo.d.ts +0 -3
- package/es/CheckGroupFixed/demo.js +0 -25
- package/es/CheckGroupFixed/index.d.ts +0 -18
- package/es/CheckGroupFixed/index.js +0 -150
- package/es/CheckGroupFixed/index.less +0 -53
- package/es/Config/index.d.ts +0 -4
- package/es/Config/index.js +0 -77
- package/es/Config/interface.d.ts +0 -65
- package/es/Config/utils.d.ts +0 -4
- package/es/Config/utils.js +0 -33
- package/es/ConfigContext/index.d.ts +0 -22
- package/es/ConfigContext/index.js +0 -25
- package/es/CustomRenderSelect/index.d.ts +0 -12
- package/es/CustomRenderSelect/index.js +0 -83
- package/es/CustomRenderSelect/index.less +0 -25
- package/es/DBTools/index.d.ts +0 -25
- package/es/DBTools/index.js +0 -337
- package/es/DisableMark/index.d.ts +0 -9
- package/es/DisableMark/index.js +0 -22
- package/es/DisableMark/index.less +0 -9
- package/es/DomMove/demo.d.ts +0 -2
- package/es/DomMove/demo.js +0 -20
- package/es/DomMove/index.d.ts +0 -16
- package/es/DomMove/index.js +0 -149
- package/es/DomMove/utils.d.ts +0 -8
- package/es/DomMove/utils.js +0 -33
- package/es/Drag/DragAndDropItem.d.ts +0 -4
- package/es/Drag/DragAndDropItem.js +0 -133
- package/es/Drag/DropItem.d.ts +0 -4
- package/es/Drag/DropItem.js +0 -50
- package/es/Drag/index.d.ts +0 -7
- package/es/Drag/index.js +0 -7
- package/es/Drag/interface.d.ts +0 -16
- package/es/DynamicGridList/Demo.d.ts +0 -3
- package/es/DynamicGridList/Demo.js +0 -86
- package/es/DynamicGridList/index.d.ts +0 -27
- package/es/DynamicGridList/index.js +0 -71
- package/es/DynamicList/demo.d.ts +0 -2
- package/es/DynamicList/demo.js +0 -50
- package/es/DynamicList/index.d.ts +0 -31
- package/es/DynamicList/index.js +0 -96
- package/es/DynamicList/index.less +0 -17
- package/es/DynamicList/interface.d.ts +0 -19
- package/es/DynamicList/utils.d.ts +0 -4
- package/es/DynamicList/utils.js +0 -6
- package/es/ErrorFallback/index.d.ts +0 -9
- package/es/ErrorFallback/index.js +0 -38
- package/es/ErrorFallback/inerface.d.ts +0 -48
- package/es/EventTools/index.d.ts +0 -3
- package/es/EventTools/index.js +0 -12
- package/es/FrontendPlayer/index.d.ts +0 -4
- package/es/FrontendPlayer/index.js +0 -2
- 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/Demo.js +0 -89
- package/es/GridList/data.d.ts +0 -16
- package/es/GridList/data.js +0 -609
- package/es/GridList/hook.d.ts +0 -13
- package/es/GridList/hook.js +0 -270
- package/es/GridList/index.d.ts +0 -15
- package/es/GridList/index.js +0 -48
- package/es/GridList/index.less +0 -8
- package/es/GridList/interface.d.ts +0 -59
- package/es/GridList/utils.d.ts +0 -9
- package/es/GridList/utils.js +0 -42
- package/es/HightLevel/index.d.ts +0 -9
- package/es/HightLevel/index.js +0 -21
- package/es/HightLevel/index.less +0 -3
- package/es/IconFont/index.d.ts +0 -12
- package/es/IconFont/index.js +0 -63
- package/es/ImageView/index.d.ts +0 -17
- package/es/ImageView/index.js +0 -58
- package/es/ImageView/index.less +0 -11
- package/es/InstanceHistory/index.d.ts +0 -3
- package/es/InstanceHistory/index.js +0 -7
- 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.d.ts +0 -15
- package/es/LabelValue/index.js +0 -32
- package/es/LabelValue/index.less +0 -23
- package/es/List/demo.d.ts +0 -3
- package/es/List/demo.js +0 -26
- package/es/List/index.d.ts +0 -28
- package/es/List/index.js +0 -30
- package/es/List/index.less +0 -13
- package/es/ListWithSizeAnimate/demo.d.ts +0 -2
- package/es/ListWithSizeAnimate/demo.js +0 -128
- package/es/ListWithSizeAnimate/index.d.ts +0 -14
- package/es/ListWithSizeAnimate/index.js +0 -97
- package/es/ListWithSizeAnimate/index.less +0 -23
- package/es/LoaderScript/index.d.ts +0 -47
- package/es/LoaderScript/index.js +0 -38
- package/es/LoaderScript/utils.d.ts +0 -13
- package/es/LoaderScript/utils.js +0 -179
- 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/Config/utils.js +0 -65
- 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/RectInfo.d.ts +0 -8
- package/es/Picture/component/DefaultRects/RectInfo.js +0 -88
- package/es/Picture/component/DefaultRects/index.d.ts +0 -13
- package/es/Picture/component/DefaultRects/index.js +0 -58
- package/es/Picture/component/DefaultRects/index.less +0 -211
- package/es/Picture/component/DefaultRects/utils.d.ts +0 -2
- package/es/Picture/component/DefaultRects/utils.js +0 -11
- package/es/Picture/component/DrawRect/index.d.ts +0 -13
- package/es/Picture/component/DrawRect/index.js +0 -51
- package/es/Picture/component/DrawRect/index.less +0 -8
- package/es/Picture/component/RectMenu/index.d.ts +0 -12
- package/es/Picture/component/RectMenu/index.js +0 -79
- package/es/Picture/component/RectMenu/index.less +0 -36
- package/es/Picture/component/RectMenu/utils.d.ts +0 -12
- package/es/Picture/component/RectMenu/utils.js +0 -19
- package/es/Picture/component/Tools/index.d.ts +0 -12
- package/es/Picture/component/Tools/index.js +0 -93
- package/es/Picture/component/Tools/index.less +0 -49
- package/es/Picture/component/WheelScale/index.d.ts +0 -7
- package/es/Picture/component/WheelScale/index.js +0 -29
- package/es/Picture/demo.d.ts +0 -2
- package/es/Picture/demo.js +0 -114
- package/es/Picture/index.d.ts +0 -19
- package/es/Picture/index.js +0 -354
- package/es/Picture/index.less +0 -20
- package/es/Picture/interface.d.ts +0 -196
- package/es/Picture/loadCaptureRectImage.d.ts +0 -3
- package/es/Picture/loadCaptureRectImage.js +0 -99
- package/es/Picture/useDraw.d.ts +0 -1
- package/es/Picture/useDraw.js +0 -103
- package/es/Picture/utils.d.ts +0 -26
- package/es/Picture/utils.js +0 -143
- package/es/Player/api/index.d.ts +0 -68
- package/es/Player/api/index.js +0 -283
- package/es/Player/context.d.ts +0 -21
- package/es/Player/context.js +0 -25
- package/es/Player/contraller_bar/bar.d.ts +0 -8
- package/es/Player/contraller_bar/bar.js +0 -28
- package/es/Player/contraller_bar/contraller_event.d.ts +0 -6
- package/es/Player/contraller_bar/contraller_event.js +0 -53
- package/es/Player/contraller_bar/index.d.ts +0 -14
- package/es/Player/contraller_bar/index.js +0 -33
- package/es/Player/contraller_bar/left_bar.d.ts +0 -10
- package/es/Player/contraller_bar/left_bar.js +0 -88
- package/es/Player/contraller_bar/right_bar.d.ts +0 -8
- package/es/Player/contraller_bar/right_bar.js +0 -37
- package/es/Player/contraller_bar/time.d.ts +0 -3
- package/es/Player/contraller_bar/time.js +0 -21
- package/es/Player/contraller_bar/useBarStatus.d.ts +0 -2
- package/es/Player/contraller_bar/useBarStatus.js +0 -43
- package/es/Player/contraller_bar/volume.d.ts +0 -9
- package/es/Player/contraller_bar/volume.js +0 -65
- package/es/Player/demo.d.ts +0 -3
- package/es/Player/demo.js +0 -277
- package/es/Player/empty.d.ts +0 -2
- package/es/Player/empty.js +0 -6
- package/es/Player/event/errorEvent.d.ts +0 -14
- package/es/Player/event/errorEvent.js +0 -88
- package/es/Player/event/eventName.d.ts +0 -18
- package/es/Player/event/eventName.js +0 -30
- package/es/Player/event/index.d.ts +0 -24
- package/es/Player/event/index.js +0 -204
- package/es/Player/fps_play.d.ts +0 -11
- package/es/Player/fps_play.js +0 -84
- package/es/Player/frontend_player.d.ts +0 -8
- package/es/Player/frontend_player.js +0 -72
- package/es/Player/frontend_timeline.d.ts +0 -10
- package/es/Player/frontend_timeline.js +0 -145
- package/es/Player/iconfont.d.ts +0 -5
- package/es/Player/iconfont.js +0 -22
- package/es/Player/index.d.ts +0 -2
- package/es/Player/index.js +0 -2
- package/es/Player/live_heart.d.ts +0 -8
- package/es/Player/live_heart.js +0 -46
- package/es/Player/message.d.ts +0 -5
- package/es/Player/message.js +0 -138
- package/es/Player/player.d.ts +0 -231
- package/es/Player/segment_player.d.ts +0 -9
- package/es/Player/segment_player.js +0 -230
- package/es/Player/segment_timeline.d.ts +0 -12
- package/es/Player/segment_timeline.js +0 -190
- package/es/Player/single_player.d.ts +0 -5
- package/es/Player/single_player.js +0 -275
- package/es/Player/style/bar.less +0 -43
- package/es/Player/style/iconfont.js +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/Player/timeline.d.ts +0 -5
- package/es/Player/timeline.js +0 -98
- package/es/Player/util.d.ts +0 -43
- package/es/Player/util.js +0 -189
- package/es/PlayerExt/demo.d.ts +0 -3
- package/es/PlayerExt/demo.js +0 -170
- package/es/PlayerExt/index.d.ts +0 -48
- package/es/PlayerExt/index.js +0 -207
- package/es/PlayerExt/index.less +0 -10
- package/es/Progress/index.d.ts +0 -12
- package/es/Progress/index.js +0 -56
- package/es/Progress/index.less +0 -21
- package/es/ROI/demo.d.ts +0 -3
- package/es/ROI/demo.js +0 -18
- package/es/ROI/index.d.ts +0 -33
- package/es/ROI/index.js +0 -57
- package/es/ROI/index.less +0 -33
- package/es/RefDrawer/Footer.d.ts +0 -9
- package/es/RefDrawer/Footer.js +0 -27
- package/es/RefDrawer/demo.d.ts +0 -3
- package/es/RefDrawer/demo.js +0 -32
- package/es/RefDrawer/index.d.ts +0 -26
- package/es/RefDrawer/index.js +0 -73
- package/es/RefModal/demo.d.ts +0 -3
- package/es/RefModal/demo.js +0 -32
- package/es/RefModal/index.d.ts +0 -17
- package/es/RefModal/index.js +0 -71
- package/es/ScreenPlayer/Live.d.ts +0 -10
- package/es/ScreenPlayer/Live.js +0 -220
- package/es/ScreenPlayer/LiveTools.d.ts +0 -29
- package/es/ScreenPlayer/LiveTools.js +0 -167
- package/es/ScreenPlayer/PlayerWithExt.d.ts +0 -34
- package/es/ScreenPlayer/PlayerWithExt.js +0 -240
- package/es/ScreenPlayer/RatePick.d.ts +0 -8
- package/es/ScreenPlayer/RatePick.js +0 -30
- package/es/ScreenPlayer/Record.d.ts +0 -10
- package/es/ScreenPlayer/Record.js +0 -447
- package/es/ScreenPlayer/RecordTools.d.ts +0 -38
- package/es/ScreenPlayer/RecordTools.js +0 -216
- package/es/ScreenPlayer/ScreenSelect.d.ts +0 -7
- package/es/ScreenPlayer/ScreenSelect.js +0 -51
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +0 -17
- package/es/ScreenPlayer/SegmentTimeLine.js +0 -38
- package/es/ScreenPlayer/TimeMode.d.ts +0 -7
- package/es/ScreenPlayer/TimeMode.js +0 -30
- package/es/ScreenPlayer/TimeSelect.d.ts +0 -7
- package/es/ScreenPlayer/TimeSelect.js +0 -94
- package/es/ScreenPlayer/demo.d.ts +0 -2
- package/es/ScreenPlayer/demo.js +0 -24
- package/es/ScreenPlayer/demo2.d.ts +0 -2
- package/es/ScreenPlayer/demo2.js +0 -200
- package/es/ScreenPlayer/index.d.ts +0 -6
- package/es/ScreenPlayer/index.js +0 -9
- package/es/ScreenPlayer/index.less +0 -335
- package/es/ScreenPlayer/interface.d.ts +0 -216
- package/es/ScreenPlayer/useTimeSlider.d.ts +0 -25
- package/es/ScreenPlayer/useTimeSlider.js +0 -450
- package/es/ScreenPlayer/useVideoFit.d.ts +0 -5
- package/es/ScreenPlayer/useVideoFit.js +0 -35
- package/es/ScreenPlayer/utils.d.ts +0 -17
- package/es/ScreenPlayer/utils.js +0 -85
- package/es/SegmentPlayer/index.d.ts +0 -2
- package/es/SegmentPlayer/index.js +0 -2
- package/es/Service/http.d.ts +0 -6
- package/es/Service/http.js +0 -125
- package/es/Service/index.d.ts +0 -3
- package/es/Service/index.js +0 -10
- package/es/Service/interface.d.ts +0 -22
- package/es/Service/middleware.d.ts +0 -5
- package/es/Service/middleware.js +0 -15
- package/es/SocketEmitter/eventEmitter.d.ts +0 -27
- package/es/SocketEmitter/eventEmitter.js +0 -88
- package/es/SocketEmitter/index.d.ts +0 -24
- package/es/SocketEmitter/index.js +0 -125
- package/es/SocketEmitter/interface.d.ts +0 -4
- package/es/TableLayout/index.d.ts +0 -10
- package/es/TableLayout/index.js +0 -29
- 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/Timeout/index.d.ts +0 -32
- package/es/Timeout/index.js +0 -70
- 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/cache/index.d.ts +0 -34
- package/es/cache/index.js +0 -94
- package/es/copy/index.d.ts +0 -1
- package/es/copy/index.js +0 -9
- package/es/core.d.ts +0 -0
- package/es/getThemeStyle/index.d.ts +0 -2
- package/es/getThemeStyle/index.js +0 -5
- package/es/index.d.ts +0 -60
- package/es/index.js +0 -60
- package/es/logger/index.d.ts +0 -7
- package/es/logger/index.js +0 -30
- package/es/nextTick/index.d.ts +0 -1
- package/es/nextTick/index.js +0 -7
- package/es/submidstr/index.d.ts +0 -5
- package/es/submidstr/index.js +0 -14
- package/es/treeHelper/index.d.ts +0 -11
- package/es/treeHelper/index.js +0 -189
- package/es/typings.d.ts +0 -2
- package/es/useDrawROI/index.d.ts +0 -16
- package/es/useDrawROI/index.js +0 -322
- package/es/useEventEmitterHandle/index.d.ts +0 -2
- package/es/useEventEmitterHandle/index.js +0 -17
- 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/useHistory/index.d.ts +0 -3
- package/es/useHistory/index.js +0 -9
- package/es/useHistory/interface.d.ts +0 -3
- package/es/useInfiniteScroll/index.d.ts +0 -16
- package/es/useInfiniteScroll/index.js +0 -101
- package/es/useRafInterval/index.d.ts +0 -5
- package/es/useRafInterval/index.js +0 -70
- package/es/useSimpleState/index.d.ts +0 -3
- package/es/useSimpleState/index.js +0 -36
- package/es/useVirtualList/index.d.ts +0 -13
- package/es/useVirtualList/index.js +0 -139
- package/es/utils.d.ts +0 -14
- package/es/utils.js +0 -75
- package/es/uuid/index.d.ts +0 -4
- package/es/uuid/index.js +0 -15
|
@@ -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');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface ILoaderMapProps {
|
|
3
|
-
children: React.ReactElement;
|
|
4
|
-
MAP_GLABAL_KEY?: 'L' | 'AMap';
|
|
5
|
-
}
|
|
6
|
-
declare function LoaderMap({ children, MAP_GLABAL_KEY, ...props }: ILoaderMapProps): JSX.Element;
|
|
7
|
-
declare namespace LoaderMap {
|
|
8
|
-
var defaultProps: {
|
|
9
|
-
MAP_GLABAL_KEY: string;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export default LoaderMap;
|
|
@@ -1,71 +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"];
|
|
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 _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; }
|
|
9
|
-
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; }
|
|
10
|
-
import React, { useMemo } from 'react';
|
|
11
|
-
import Config from "../../Config";
|
|
12
|
-
import LoaderScript from "../../LoaderScript";
|
|
13
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
var L_SCRIPTS = [{
|
|
16
|
-
scripts: ['https://cdn.bootcdn.net/ajax/libs/leaflet/1.8.0/leaflet.min.js'],
|
|
17
|
-
styles: ['https://cdn.bootcdn.net/ajax/libs/leaflet/1.8.0/leaflet.min.css']
|
|
18
|
-
// scripts: ['/statics/libs/map/leaflet/leaflet.min.js'],
|
|
19
|
-
// styles: ['/statics/libs/map/leaflet/leaflet.min.css'],
|
|
20
|
-
}, {
|
|
21
|
-
scripts: ['https://cdn.bootcdn.net/ajax/libs/leaflet.markercluster/1.5.3/leaflet.markercluster.min.js'
|
|
22
|
-
// '/statics/libs/map/leaflet/echarts-leaflet.js'
|
|
23
|
-
// '/statics/libs/map/leaflet/leaflet.markercluster.js'
|
|
24
|
-
],
|
|
25
|
-
|
|
26
|
-
styles: ['https://cdn.bootcdn.net/ajax/libs/leaflet.markercluster/1.5.3/MarkerCluster.min.css', 'https://cdn.bootcdn.net/ajax/libs/leaflet.markercluster/1.5.3/MarkerCluster.Default.min.css'
|
|
27
|
-
// '/statics/libs/map/leaflet/MarkerCluster.css'
|
|
28
|
-
// '/statics/libs/map/leaflet/MarkerCluster.Default.css'
|
|
29
|
-
]
|
|
30
|
-
}];
|
|
31
|
-
|
|
32
|
-
var AMAP_SCRIPTS = [{
|
|
33
|
-
scripts: ['https://webapi.amap.com/maps?v=2.0&key=2232e46c0b578b711e6e9851cb92dbfe']
|
|
34
|
-
}];
|
|
35
|
-
function EmptyParent(_ref) {
|
|
36
|
-
var children = _ref.children;
|
|
37
|
-
return /*#__PURE__*/_jsx(_Fragment, {
|
|
38
|
-
children: children
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function LoaderMap(_ref2) {
|
|
42
|
-
var children = _ref2.children,
|
|
43
|
-
MAP_GLABAL_KEY = _ref2.MAP_GLABAL_KEY,
|
|
44
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
45
|
-
var glaobalKey = useMemo(function () {
|
|
46
|
-
return MAP_GLABAL_KEY ? MAP_GLABAL_KEY : Config.BSConfig.MAP_GLABAL_KEY || 'L';
|
|
47
|
-
}, [MAP_GLABAL_KEY]);
|
|
48
|
-
var isL = useMemo(function () {
|
|
49
|
-
return glaobalKey === 'L';
|
|
50
|
-
}, [glaobalKey]);
|
|
51
|
-
var isLoaded = useMemo(function () {
|
|
52
|
-
return !!window[glaobalKey];
|
|
53
|
-
}, [glaobalKey]);
|
|
54
|
-
var options = useMemo(function () {
|
|
55
|
-
return isL ? L_SCRIPTS : AMAP_SCRIPTS;
|
|
56
|
-
}, [isL]);
|
|
57
|
-
var Parent = useMemo(function () {
|
|
58
|
-
return isLoaded ? EmptyParent : LoaderScript;
|
|
59
|
-
}, [isLoaded]);
|
|
60
|
-
return /*#__PURE__*/_jsx(Parent, {
|
|
61
|
-
options: options,
|
|
62
|
-
children: /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, props), {}, {
|
|
63
|
-
isL: isL,
|
|
64
|
-
glaobalKey: glaobalKey
|
|
65
|
-
}))
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
LoaderMap.defaultProps = {
|
|
69
|
-
MAP_GLABAL_KEY: 'AMap'
|
|
70
|
-
};
|
|
71
|
-
export default LoaderMap;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
-
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; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useEffect, useState } from 'react';
|
|
8
|
-
import deviceList from "../points";
|
|
9
|
-
import MapDrawSelect from "./index";
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
var App = function App() {
|
|
13
|
-
var _useState = useState([]),
|
|
14
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
-
points = _useState2[0],
|
|
16
|
-
setPoints = _useState2[1];
|
|
17
|
-
var _useState3 = useState(),
|
|
18
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
19
|
-
type = _useState4[0],
|
|
20
|
-
setType = _useState4[1];
|
|
21
|
-
var _useState5 = useState({
|
|
22
|
-
zoom: null,
|
|
23
|
-
center: null
|
|
24
|
-
}),
|
|
25
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
26
|
-
state = _useState6[0],
|
|
27
|
-
setState = _useState6[1];
|
|
28
|
-
useEffect(function () {
|
|
29
|
-
setTimeout(function () {
|
|
30
|
-
setPoints(deviceList);
|
|
31
|
-
setState({
|
|
32
|
-
center: [116.397392, 39.918206],
|
|
33
|
-
zoom: 13.74
|
|
34
|
-
});
|
|
35
|
-
}, 1000);
|
|
36
|
-
}, []);
|
|
37
|
-
return /*#__PURE__*/_jsx("div", {
|
|
38
|
-
style: {
|
|
39
|
-
width: '100%',
|
|
40
|
-
height: 800
|
|
41
|
-
},
|
|
42
|
-
children: /*#__PURE__*/_jsx(MapDrawSelect, {
|
|
43
|
-
zoom: state.zoom,
|
|
44
|
-
center: state.center,
|
|
45
|
-
points: points,
|
|
46
|
-
drawEnd: console.log,
|
|
47
|
-
drawType: type,
|
|
48
|
-
drawUi: /*#__PURE__*/_jsxs("div", {
|
|
49
|
-
style: {
|
|
50
|
-
position: 'absolute',
|
|
51
|
-
right: 20,
|
|
52
|
-
top: 120
|
|
53
|
-
},
|
|
54
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
55
|
-
onClick: function onClick() {
|
|
56
|
-
return setType(type === 'rect' ? 'close' : 'rect');
|
|
57
|
-
},
|
|
58
|
-
children: "\u77E9\u5F62"
|
|
59
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
60
|
-
onClick: function onClick() {
|
|
61
|
-
return setType(type === 'polygon' ? 'close' : 'polygon');
|
|
62
|
-
},
|
|
63
|
-
children: "\u591A\u8FB9\u5F62"
|
|
64
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
65
|
-
onClick: function onClick() {
|
|
66
|
-
return setType(type === 'circle' ? 'close' : 'circle');
|
|
67
|
-
},
|
|
68
|
-
children: "\u5706\u5F27"
|
|
69
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
70
|
-
onClick: function onClick() {
|
|
71
|
-
return setType('clear');
|
|
72
|
-
},
|
|
73
|
-
children: "\u6E05\u9664"
|
|
74
|
-
})]
|
|
75
|
-
})
|
|
76
|
-
})
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
export default App;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DrawType, MapPoint } from '../interface';
|
|
3
|
-
export interface IMapDrawSelectProps {
|
|
4
|
-
center?: [number, number];
|
|
5
|
-
zoom?: number;
|
|
6
|
-
points: MapPoint[];
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
drawUi?: React.ReactNode;
|
|
9
|
-
drawType?: DrawType | 'clear' | 'close';
|
|
10
|
-
selectCenter?: [number, number];
|
|
11
|
-
drawEnd?: (points: MapPoint[]) => void;
|
|
12
|
-
onPointClick?: (point: MapPoint) => void;
|
|
13
|
-
}
|
|
14
|
-
declare const _default: (props: IMapDrawSelectProps) => JSX.Element;
|
|
15
|
-
export default _default;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
2
|
-
import _useMount from "ahooks/es/useMount";
|
|
3
|
-
import React, { useCallback, useContext, useEffect, useMemo } from 'react';
|
|
4
|
-
import ClusterLayer from "../ClusterLayer";
|
|
5
|
-
import { mapContext } from "../Context";
|
|
6
|
-
import MouseTool from "../MouseTool";
|
|
7
|
-
import ResetTools from "../ResetTools";
|
|
8
|
-
import withMap from "../withMap";
|
|
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 MapDrawSelect(_ref) {
|
|
13
|
-
var center = _ref.center,
|
|
14
|
-
zoom = _ref.zoom,
|
|
15
|
-
points = _ref.points,
|
|
16
|
-
children = _ref.children,
|
|
17
|
-
drawUi = _ref.drawUi,
|
|
18
|
-
drawType = _ref.drawType,
|
|
19
|
-
selectCenter = _ref.selectCenter,
|
|
20
|
-
drawEnd = _ref.drawEnd,
|
|
21
|
-
onPointClick = _ref.onPointClick;
|
|
22
|
-
var _useContext = useContext(mapContext),
|
|
23
|
-
instance = _useContext.instance;
|
|
24
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
25
|
-
var defaultCenter = useMemo(function () {
|
|
26
|
-
return center || instance.config.center;
|
|
27
|
-
}, [center]);
|
|
28
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
|
-
var defaultZoom = useMemo(function () {
|
|
30
|
-
return zoom || instance.config.zoom;
|
|
31
|
-
}, [zoom]);
|
|
32
|
-
|
|
33
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
|
-
var mapRest = useCallback(function () {
|
|
35
|
-
return instance.setZoomAndCenter(defaultZoom, defaultCenter);
|
|
36
|
-
}, [defaultZoom, defaultCenter]);
|
|
37
|
-
_useMount(function () {
|
|
38
|
-
return mapRest();
|
|
39
|
-
});
|
|
40
|
-
_useUpdateEffect(function () {
|
|
41
|
-
return instance.setZoomAndCenter(defaultZoom, defaultCenter);
|
|
42
|
-
}, [defaultZoom, defaultCenter]);
|
|
43
|
-
useEffect(function () {
|
|
44
|
-
if (selectCenter) {
|
|
45
|
-
instance.setZoomAndCenter(defaultZoom, selectCenter);
|
|
46
|
-
}
|
|
47
|
-
}, [defaultZoom, instance, selectCenter]);
|
|
48
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
49
|
-
children: [/*#__PURE__*/_jsx(ClusterLayer, {
|
|
50
|
-
points: points,
|
|
51
|
-
onPointClick: onPointClick
|
|
52
|
-
}), /*#__PURE__*/_jsx(ResetTools, {
|
|
53
|
-
onMapReset: mapRest
|
|
54
|
-
}), /*#__PURE__*/_jsx(MouseTool, {
|
|
55
|
-
ui: drawUi,
|
|
56
|
-
drawType: drawType,
|
|
57
|
-
drawEnd: drawEnd,
|
|
58
|
-
points: points
|
|
59
|
-
}), children]
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
export default withMap(MapDrawSelect, 'map-draw-select-container');
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DrawType, MapPoint } from '../interface';
|
|
3
|
-
interface IMouseTool {
|
|
4
|
-
ui: React.ReactNode;
|
|
5
|
-
drawType?: DrawType | 'clear' | 'close';
|
|
6
|
-
drawEnd?: (points: MapPoint[]) => void;
|
|
7
|
-
points?: MapPoint[];
|
|
8
|
-
}
|
|
9
|
-
declare function MouseTool({ ui, drawType, points, drawEnd }: IMouseTool): JSX.Element;
|
|
10
|
-
export default MouseTool;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import nextTick from "../../nextTick";
|
|
4
|
-
import useMouseTools from "./useMouseTools";
|
|
5
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
function MouseTool(_ref) {
|
|
8
|
-
var ui = _ref.ui,
|
|
9
|
-
drawType = _ref.drawType,
|
|
10
|
-
_ref$points = _ref.points,
|
|
11
|
-
points = _ref$points === void 0 ? [] : _ref$points,
|
|
12
|
-
drawEnd = _ref.drawEnd;
|
|
13
|
-
var _useMouseTools = useMouseTools(function (obj) {
|
|
14
|
-
var selectPoints = [];
|
|
15
|
-
for (var i = 0; i < points.length; i++) {
|
|
16
|
-
var item = points[i];
|
|
17
|
-
if (item.longitude && item.latitude && obj.contains([item.longitude, item.latitude])) {
|
|
18
|
-
selectPoints.push(item);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
nextTick(function () {
|
|
22
|
-
return drawEnd === null || drawEnd === void 0 ? void 0 : drawEnd(selectPoints);
|
|
23
|
-
});
|
|
24
|
-
}),
|
|
25
|
-
draw = _useMouseTools.draw,
|
|
26
|
-
close = _useMouseTools.close;
|
|
27
|
-
_useUpdateEffect(function () {
|
|
28
|
-
switch (drawType) {
|
|
29
|
-
case 'clear':
|
|
30
|
-
close(true);
|
|
31
|
-
break;
|
|
32
|
-
case 'close':
|
|
33
|
-
close();
|
|
34
|
-
break;
|
|
35
|
-
default:
|
|
36
|
-
draw(drawType);
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
}, [drawType]);
|
|
40
|
-
return /*#__PURE__*/_jsx(_Fragment, {
|
|
41
|
-
children: ui
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export default MouseTool;
|
|
@@ -1,83 +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
|
-
import _useMount from "ahooks/es/useMount";
|
|
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
|
-
import { useContext, useEffect, useRef, useState } from 'react';
|
|
15
|
-
import { mapContext } from "../Context";
|
|
16
|
-
function useMouseTools(onDrawEnd) {
|
|
17
|
-
var _useState = useState({
|
|
18
|
-
focusKey: Date.now()
|
|
19
|
-
}),
|
|
20
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
-
state = _useState2[0],
|
|
22
|
-
setState = _useState2[1];
|
|
23
|
-
var _useContext = useContext(mapContext),
|
|
24
|
-
instance = _useContext.instance;
|
|
25
|
-
var overlayersRef = useRef([]);
|
|
26
|
-
var mouseRef = useRef(null);
|
|
27
|
-
_useMount(function () {
|
|
28
|
-
var map = instance.map;
|
|
29
|
-
AMap.plugin(['AMap.MouseTool'], function () {
|
|
30
|
-
mouseRef.current = new AMap.MouseTool(map);
|
|
31
|
-
setState(function (old) {
|
|
32
|
-
return _objectSpread(_objectSpread({}, old), {}, {
|
|
33
|
-
focusKey: Date.now()
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
useEffect(function () {
|
|
39
|
-
if (!mouseRef.current) {
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
var fn = function fn(e) {
|
|
43
|
-
overlayersRef.current.push(e.obj);
|
|
44
|
-
onDrawEnd === null || onDrawEnd === void 0 ? void 0 : onDrawEnd(e.obj);
|
|
45
|
-
};
|
|
46
|
-
mouseRef.current.on('draw', fn);
|
|
47
|
-
return function () {
|
|
48
|
-
mouseRef.current.off('draw', fn);
|
|
49
|
-
};
|
|
50
|
-
}, [onDrawEnd, state.focusKey]);
|
|
51
|
-
var draw = function draw(type) {
|
|
52
|
-
if (!mouseRef.current) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
switch (type) {
|
|
56
|
-
case 'rect':
|
|
57
|
-
mouseRef.current.rectangle();
|
|
58
|
-
break;
|
|
59
|
-
case 'polygon':
|
|
60
|
-
mouseRef.current.polygon();
|
|
61
|
-
break;
|
|
62
|
-
case 'circle':
|
|
63
|
-
mouseRef.current.circle();
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
var clear = function clear(objs) {
|
|
67
|
-
objs.forEach(function (obj) {
|
|
68
|
-
instance.map.remove(obj);
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
var close = function close(ifClear) {
|
|
72
|
-
if (!mouseRef.current) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
mouseRef.current.close(ifClear);
|
|
76
|
-
};
|
|
77
|
-
return {
|
|
78
|
-
clear: clear,
|
|
79
|
-
draw: draw,
|
|
80
|
-
close: close
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
export default useMouseTools;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import '../../Player/style/iconfont';
|
|
3
|
-
import './index.less';
|
|
4
|
-
export interface IResetTools {
|
|
5
|
-
onMapReset?: () => void;
|
|
6
|
-
onMapZoom?: (num: number) => void;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
declare function ResetTools({ onMapReset, onMapZoom, className }: IResetTools): JSX.Element;
|
|
10
|
-
export default ResetTools;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useContext } from 'react';
|
|
2
|
-
import { mapContext } from "../Context";
|
|
3
|
-
import { Popover } from 'antd';
|
|
4
|
-
import IconFont from "../../IconFont";
|
|
5
|
-
import "../../Player/style/iconfont";
|
|
6
|
-
import "./index.less";
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
function ResetTools(_ref) {
|
|
10
|
-
var onMapReset = _ref.onMapReset,
|
|
11
|
-
onMapZoom = _ref.onMapZoom,
|
|
12
|
-
_ref$className = _ref.className,
|
|
13
|
-
className = _ref$className === void 0 ? '' : _ref$className;
|
|
14
|
-
var _useContext = useContext(mapContext),
|
|
15
|
-
instance = _useContext.instance;
|
|
16
|
-
var mapReset = useCallback(function () {
|
|
17
|
-
return onMapReset ? onMapReset() : instance.mapReset();
|
|
18
|
-
}, []);
|
|
19
|
-
var mapZoom = useCallback(function (num) {
|
|
20
|
-
return onMapZoom ? onMapZoom(num) : instance.setZoom(instance.getZoom() + num);
|
|
21
|
-
}, []);
|
|
22
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
23
|
-
className: "map-reset-tool-container ".concat(className),
|
|
24
|
-
children: [/*#__PURE__*/_jsx(Popover, {
|
|
25
|
-
placement: "left",
|
|
26
|
-
content: "\u590D\u4F4D",
|
|
27
|
-
overlayClassName: "map-rest-tools-item-popup",
|
|
28
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
29
|
-
className: "map-reset map-tool-icon",
|
|
30
|
-
onClick: mapReset,
|
|
31
|
-
children: /*#__PURE__*/_jsx(IconFont, {
|
|
32
|
-
type: "lm-player-S_Bar_Reduction"
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
}), /*#__PURE__*/_jsxs("div", {
|
|
36
|
-
className: "map-zoom",
|
|
37
|
-
children: [/*#__PURE__*/_jsx(Popover, {
|
|
38
|
-
placement: "left",
|
|
39
|
-
content: "\u653E\u5927",
|
|
40
|
-
overlayClassName: "map-rest-tools-item-popup",
|
|
41
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
42
|
-
className: "map-tool-icon",
|
|
43
|
-
onClick: function onClick() {
|
|
44
|
-
return mapZoom(1);
|
|
45
|
-
},
|
|
46
|
-
children: /*#__PURE__*/_jsx(IconFont, {
|
|
47
|
-
type: "lm-player-S_Edit_LinePlus"
|
|
48
|
-
})
|
|
49
|
-
})
|
|
50
|
-
}), /*#__PURE__*/_jsx(Popover, {
|
|
51
|
-
placement: "left",
|
|
52
|
-
content: "\u7F29\u5C0F",
|
|
53
|
-
overlayClassName: "map-rest-tools-item-popup",
|
|
54
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
55
|
-
className: "map-tool-icon",
|
|
56
|
-
onClick: function onClick() {
|
|
57
|
-
return mapZoom(-1);
|
|
58
|
-
},
|
|
59
|
-
children: /*#__PURE__*/_jsx(IconFont, {
|
|
60
|
-
type: "lm-player-S_Edit_LineMinus"
|
|
61
|
-
})
|
|
62
|
-
})
|
|
63
|
-
})]
|
|
64
|
-
})]
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
export default ResetTools;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
.map-reset-tool-container {
|
|
2
|
-
position: absolute;
|
|
3
|
-
right: 10px;
|
|
4
|
-
bottom: 10px;
|
|
5
|
-
z-index: 3;
|
|
6
|
-
padding: 5px 0;
|
|
7
|
-
background: #fff;
|
|
8
|
-
|
|
9
|
-
.map-reset,
|
|
10
|
-
.map-zoom {
|
|
11
|
-
background: #fff;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.map-zoom {
|
|
15
|
-
margin-bottom: 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.map-tool-icon {
|
|
19
|
-
display: flex;
|
|
20
|
-
width: 30px;
|
|
21
|
-
height: 25px;
|
|
22
|
-
font-size: 18px;
|
|
23
|
-
color: var(--icon);
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
align-items: center;
|
|
26
|
-
justify-content: center;
|
|
27
|
-
|
|
28
|
-
&:hover {
|
|
29
|
-
color: var(--primary);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.map-rest-tools-item-popup {
|
|
35
|
-
.ant-popover-inner-content {
|
|
36
|
-
padding: 4px 8px;
|
|
37
|
-
font-size: var(--fs-small);
|
|
38
|
-
}
|
|
39
|
-
}
|