@vtx/ol-map 1.0.142 → 1.0.144
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/package.json +3 -2
- package/lib/_util/EventEmitter.js +0 -78
- package/lib/_util/EventEmitter.js.map +0 -1
- package/lib/_util/StyleCache.js +0 -46
- package/lib/_util/StyleCache.js.map +0 -1
- package/lib/_util/encryptParams.js +0 -60
- package/lib/_util/encryptParams.js.map +0 -1
- package/lib/_util/filterSpecialCharacters.js +0 -90
- package/lib/_util/filterSpecialCharacters.js.map +0 -1
- package/lib/_util/getComponentProps.js +0 -14
- package/lib/_util/getComponentProps.js.map +0 -1
- package/lib/_util/getCookie.js +0 -24
- package/lib/_util/getCookie.js.map +0 -1
- package/lib/_util/getDefaultMapInfo.js +0 -50
- package/lib/_util/getDefaultMapInfo.js.map +0 -1
- package/lib/_util/getSystemInfo.js +0 -26
- package/lib/_util/getSystemInfo.js.map +0 -1
- package/lib/_util/getToken.js +0 -27
- package/lib/_util/getToken.js.map +0 -1
- package/lib/_util/getUrlParam.js +0 -15
- package/lib/_util/getUrlParam.js.map +0 -1
- package/lib/_util/http.js +0 -176
- package/lib/_util/http.js.map +0 -1
- package/lib/_util/isFunction.js +0 -10
- package/lib/_util/isFunction.js.map +0 -1
- package/lib/_util/isObject.js +0 -10
- package/lib/_util/isObject.js.map +0 -1
- package/lib/_util/layer.js +0 -152
- package/lib/_util/layer.js.map +0 -1
- package/lib/_util/mapTool.js +0 -188
- package/lib/_util/mapTool.js.map +0 -1
- package/lib/_util/projzh/datum/bd-09.js +0 -44
- package/lib/_util/projzh/datum/bd-09.js.map +0 -1
- package/lib/_util/projzh/datum/gcj-02.js +0 -72
- package/lib/_util/projzh/datum/gcj-02.js.map +0 -1
- package/lib/_util/projzh/datum/index.js +0 -14
- package/lib/_util/projzh/datum/index.js.map +0 -1
- package/lib/_util/projzh/index.js +0 -40
- package/lib/_util/projzh/index.js.map +0 -1
- package/lib/_util/projzh/projection/baidu-mercator.js +0 -74
- package/lib/_util/projzh/projection/baidu-mercator.js.map +0 -1
- package/lib/_util/projzh/projection/index.js +0 -14
- package/lib/_util/projzh/projection/index.js.map +0 -1
- package/lib/_util/projzh/projection/spherical-mercator.js +0 -25
- package/lib/_util/projzh/projection/spherical-mercator.js.map +0 -1
- package/lib/_util/projzh/util.js +0 -27
- package/lib/_util/projzh/util.js.map +0 -1
- package/lib/_util/search.js +0 -129
- package/lib/_util/search.js.map +0 -1
- package/lib/_util/setCookie.js +0 -15
- package/lib/_util/setCookie.js.map +0 -1
- package/lib/_util/stringToFun.js +0 -25
- package/lib/_util/stringToFun.js.map +0 -1
- package/lib/_util/transform.js +0 -169
- package/lib/_util/transform.js.map +0 -1
- package/lib/_util/useColSize.js +0 -28
- package/lib/_util/useColSize.js.map +0 -1
- package/lib/_util/useInterval.js +0 -19
- package/lib/_util/useInterval.js.map +0 -1
- package/lib/_util/useSet.js +0 -44
- package/lib/_util/useSet.js.map +0 -1
- package/lib/analysis-layer/index.js +0 -449
- package/lib/analysis-layer/index.js.map +0 -1
- package/lib/analysis-layer/style/css.js +0 -2
- package/lib/analysis-layer/style/css.js.map +0 -1
- package/lib/analysis-layer/style/index.js +0 -2
- package/lib/analysis-layer/style/index.js.map +0 -1
- package/lib/assets/arrow.png +0 -0
- package/lib/assets/base-img-1.png +0 -0
- package/lib/assets/base-img-2.png +0 -0
- package/lib/assets/base-img-3.png +0 -0
- package/lib/assets/base-img-4.png +0 -0
- package/lib/assets/base-img-5.png +0 -0
- package/lib/assets/base-img-6.png +0 -0
- package/lib/assets/base-img.png +0 -0
- package/lib/assets/bz.png +0 -0
- package/lib/assets/img.png +0 -0
- package/lib/assets/kz.png +0 -0
- package/lib/assets/ll.png +0 -0
- package/lib/assets/location.png +0 -0
- package/lib/assets/noLocation.png +0 -0
- package/lib/assets/people.png +0 -0
- package/lib/assets/qd.png +0 -0
- package/lib/assets/sw.png +0 -0
- package/lib/assets/yl.png +0 -0
- package/lib/assets/zd.png +0 -0
- package/lib/buffer-draw/BufferDraw.js +0 -398
- package/lib/buffer-draw/BufferDraw.js.map +0 -1
- package/lib/buffer-draw/index.js +0 -57
- package/lib/buffer-draw/index.js.map +0 -1
- package/lib/buffer-draw/style/css.js +0 -2
- package/lib/buffer-draw/style/css.js.map +0 -1
- package/lib/buffer-draw/style/index.js +0 -2
- package/lib/buffer-draw/style/index.js.map +0 -1
- package/lib/circle/Circle.js +0 -51
- package/lib/circle/Circle.js.map +0 -1
- package/lib/circle/index.js +0 -65
- package/lib/circle/index.js.map +0 -1
- package/lib/circle/style/css.js +0 -2
- package/lib/circle/style/css.js.map +0 -1
- package/lib/circle/style/index.js +0 -2
- package/lib/circle/style/index.js.map +0 -1
- package/lib/config.js +0 -12
- package/lib/config.js.map +0 -1
- package/lib/convertCamelToCSS.js +0 -23
- package/lib/convertCamelToCSS.js.map +0 -1
- package/lib/dom/Dom.js +0 -39
- package/lib/dom/Dom.js.map +0 -1
- package/lib/dom/index.js +0 -62
- package/lib/dom/index.js.map +0 -1
- package/lib/dom/style/css.js +0 -2
- package/lib/dom/style/css.js.map +0 -1
- package/lib/dom/style/index.js +0 -2
- package/lib/dom/style/index.js.map +0 -1
- package/lib/events/index.js +0 -25
- package/lib/events/index.js.map +0 -1
- package/lib/feature-draw/FeatureDraw.js +0 -230
- package/lib/feature-draw/FeatureDraw.js.map +0 -1
- package/lib/feature-draw/index.js +0 -73
- package/lib/feature-draw/index.js.map +0 -1
- package/lib/feature-draw/style/css.js +0 -2
- package/lib/feature-draw/style/css.js.map +0 -1
- package/lib/feature-draw/style/index.js +0 -2
- package/lib/feature-draw/style/index.js.map +0 -1
- package/lib/feature-layer/FeatureLayer.js +0 -1039
- package/lib/feature-layer/FeatureLayer.js.map +0 -1
- package/lib/feature-layer/MyCluster.js +0 -150
- package/lib/feature-layer/MyCluster.js.map +0 -1
- package/lib/feature-layer/createFeatureCollection.js +0 -167
- package/lib/feature-layer/createFeatureCollection.js.map +0 -1
- package/lib/feature-layer/index.js +0 -155
- package/lib/feature-layer/index.js.map +0 -1
- package/lib/feature-layer/style/css.js +0 -4
- package/lib/feature-layer/style/css.js.map +0 -1
- package/lib/feature-layer/style/index.css +0 -0
- package/lib/feature-layer/style/index.js +0 -4
- package/lib/feature-layer/style/index.js.map +0 -1
- package/lib/feature-layer/style/index.less +0 -0
- package/lib/flow-line-layer/FlowLineLayer.js +0 -197
- package/lib/flow-line-layer/FlowLineLayer.js.map +0 -1
- package/lib/flow-line-layer/index.js +0 -127
- package/lib/flow-line-layer/index.js.map +0 -1
- package/lib/flow-line-layer/style/css.js +0 -4
- package/lib/flow-line-layer/style/css.js.map +0 -1
- package/lib/flow-line-layer/style/index.css +0 -0
- package/lib/flow-line-layer/style/index.js +0 -4
- package/lib/flow-line-layer/style/index.js.map +0 -1
- package/lib/flow-line-layer/style/index.less +0 -0
- package/lib/fly-line-layer/FlyLineLayer.js +0 -217
- package/lib/fly-line-layer/FlyLineLayer.js.map +0 -1
- package/lib/fly-line-layer/index.js +0 -109
- package/lib/fly-line-layer/index.js.map +0 -1
- package/lib/fly-line-layer/style/css.js +0 -4
- package/lib/fly-line-layer/style/css.js.map +0 -1
- package/lib/fly-line-layer/style/index.css +0 -0
- package/lib/fly-line-layer/style/index.js +0 -4
- package/lib/fly-line-layer/style/index.js.map +0 -1
- package/lib/fly-line-layer/style/index.less +0 -0
- package/lib/group-layer/GroupLayer.js +0 -131
- package/lib/group-layer/GroupLayer.js.map +0 -1
- package/lib/group-layer/index.js +0 -74
- package/lib/group-layer/index.js.map +0 -1
- package/lib/group-layer/style/css.js +0 -4
- package/lib/group-layer/style/css.js.map +0 -1
- package/lib/group-layer/style/index.css +0 -0
- package/lib/group-layer/style/index.js +0 -4
- package/lib/group-layer/style/index.js.map +0 -1
- package/lib/group-layer/style/index.less +0 -0
- package/lib/heatmap-layer/HeatmapLayer.js +0 -191
- package/lib/heatmap-layer/HeatmapLayer.js.map +0 -1
- package/lib/heatmap-layer/index.js +0 -94
- package/lib/heatmap-layer/index.js.map +0 -1
- package/lib/heatmap-layer/style/css.js +0 -4
- package/lib/heatmap-layer/style/css.js.map +0 -1
- package/lib/heatmap-layer/style/index.css +0 -0
- package/lib/heatmap-layer/style/index.js +0 -4
- package/lib/heatmap-layer/style/index.js.map +0 -1
- package/lib/heatmap-layer/style/index.less +0 -0
- package/lib/high-layer/HighLayer.js +0 -199
- package/lib/high-layer/HighLayer.js.map +0 -1
- package/lib/high-layer/index.js +0 -45
- package/lib/high-layer/index.js.map +0 -1
- package/lib/high-layer/style/css.js +0 -2
- package/lib/high-layer/style/css.js.map +0 -1
- package/lib/high-layer/style/index.js +0 -2
- package/lib/high-layer/style/index.js.map +0 -1
- package/lib/image-layer/ImageLayer.js +0 -330
- package/lib/image-layer/ImageLayer.js.map +0 -1
- package/lib/image-layer/ImageTileLayer.js +0 -332
- package/lib/image-layer/ImageTileLayer.js.map +0 -1
- package/lib/image-layer/index.js +0 -101
- package/lib/image-layer/index.js.map +0 -1
- package/lib/image-layer/style/css.js +0 -4
- package/lib/image-layer/style/css.js.map +0 -1
- package/lib/image-layer/style/index.css +0 -0
- package/lib/image-layer/style/index.js +0 -4
- package/lib/image-layer/style/index.js.map +0 -1
- package/lib/image-layer/style/index.less +0 -0
- package/lib/index.js +0 -201
- package/lib/index.js.map +0 -1
- package/lib/legend/index.js +0 -221
- package/lib/legend/index.js.map +0 -1
- package/lib/legend/style/css.js +0 -8
- package/lib/legend/style/css.js.map +0 -1
- package/lib/legend/style/index.css +0 -74
- package/lib/legend/style/index.js +0 -8
- package/lib/legend/style/index.js.map +0 -1
- package/lib/legend/style/index.less +0 -73
- package/lib/map/Analysis.js +0 -148
- package/lib/map/Analysis.js.map +0 -1
- package/lib/map/Layers.js +0 -336
- package/lib/map/Layers.js.map +0 -1
- package/lib/map/Popup.js +0 -371
- package/lib/map/Popup.js.map +0 -1
- package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js +0 -163
- package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js.map +0 -1
- package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js +0 -84
- package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js.map +0 -1
- package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js +0 -65
- package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js.map +0 -1
- package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js +0 -84
- package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js.map +0 -1
- package/lib/map/getBaseLayers/index.js +0 -46
- package/lib/map/getBaseLayers/index.js.map +0 -1
- package/lib/map/index.js +0 -822
- package/lib/map/index.js.map +0 -1
- package/lib/map/style/css.js +0 -5
- package/lib/map/style/css.js.map +0 -1
- package/lib/map/style/index.css +0 -171
- package/lib/map/style/index.js +0 -5
- package/lib/map/style/index.js.map +0 -1
- package/lib/map/style/index.less +0 -152
- package/lib/map-icon/svg/index.js +0 -81
- package/lib/map-icon/svg/index.js.map +0 -1
- package/lib/map-icon/svg/tuceng.svg.js +0 -2
- package/lib/map-icon/svg/tuceng.svg.js.map +0 -1
- package/lib/marker/Marker.js +0 -105
- package/lib/marker/Marker.js.map +0 -1
- package/lib/marker/index.js +0 -62
- package/lib/marker/index.js.map +0 -1
- package/lib/marker/style/css.js +0 -2
- package/lib/marker/style/css.js.map +0 -1
- package/lib/marker/style/index.js +0 -2
- package/lib/marker/style/index.js.map +0 -1
- package/lib/path-line-layer/PathLineLayer.js +0 -45
- package/lib/path-line-layer/PathLineLayer.js.map +0 -1
- package/lib/path-line-layer/getPathLineStyles.js +0 -71
- package/lib/path-line-layer/getPathLineStyles.js.map +0 -1
- package/lib/path-line-layer/index.js +0 -152
- package/lib/path-line-layer/index.js.map +0 -1
- package/lib/path-line-layer/style/css.js +0 -4
- package/lib/path-line-layer/style/css.js.map +0 -1
- package/lib/path-line-layer/style/index.css +0 -0
- package/lib/path-line-layer/style/index.js +0 -4
- package/lib/path-line-layer/style/index.js.map +0 -1
- package/lib/path-line-layer/style/index.less +0 -0
- package/lib/path-play-back/PathPlayBack.js +0 -668
- package/lib/path-play-back/PathPlayBack.js.map +0 -1
- package/lib/path-play-back/index.js +0 -75
- package/lib/path-play-back/index.js.map +0 -1
- package/lib/path-play-back/style/css.js +0 -2
- package/lib/path-play-back/style/css.js.map +0 -1
- package/lib/path-play-back/style/index.js +0 -2
- package/lib/path-play-back/style/index.js.map +0 -1
- package/lib/poi-search/Location.js +0 -63
- package/lib/poi-search/Location.js.map +0 -1
- package/lib/poi-search/PoiList.js +0 -116
- package/lib/poi-search/PoiList.js.map +0 -1
- package/lib/poi-search/Search.js +0 -208
- package/lib/poi-search/Search.js.map +0 -1
- package/lib/poi-search/index.js +0 -173
- package/lib/poi-search/index.js.map +0 -1
- package/lib/poi-search/style/css.js +0 -8
- package/lib/poi-search/style/css.js.map +0 -1
- package/lib/poi-search/style/index.css +0 -96
- package/lib/poi-search/style/index.js +0 -8
- package/lib/poi-search/style/index.js.map +0 -1
- package/lib/poi-search/style/index.less +0 -97
- package/lib/point/Point.js +0 -57
- package/lib/point/Point.js.map +0 -1
- package/lib/point/index.js +0 -62
- package/lib/point/index.js.map +0 -1
- package/lib/point/style/css.js +0 -2
- package/lib/point/style/css.js.map +0 -1
- package/lib/point/style/index.js +0 -2
- package/lib/point/style/index.js.map +0 -1
- package/lib/polygon/Polygon.js +0 -51
- package/lib/polygon/Polygon.js.map +0 -1
- package/lib/polygon/index.js +0 -62
- package/lib/polygon/index.js.map +0 -1
- package/lib/polygon/style/css.js +0 -2
- package/lib/polygon/style/css.js.map +0 -1
- package/lib/polygon/style/index.js +0 -2
- package/lib/polygon/style/index.js.map +0 -1
- package/lib/polyline/Polyline.js +0 -51
- package/lib/polyline/Polyline.js.map +0 -1
- package/lib/polyline/index.js +0 -62
- package/lib/polyline/index.js.map +0 -1
- package/lib/polyline/style/css.js +0 -2
- package/lib/polyline/style/css.js.map +0 -1
- package/lib/polyline/style/index.js +0 -2
- package/lib/polyline/style/index.js.map +0 -1
- package/lib/popup/index.js +0 -203
- package/lib/popup/index.js.map +0 -1
- package/lib/popup/style/css.js +0 -4
- package/lib/popup/style/css.js.map +0 -1
- package/lib/popup/style/index.css +0 -131
- package/lib/popup/style/index.js +0 -4
- package/lib/popup/style/index.js.map +0 -1
- package/lib/popup/style/index.less +0 -129
- package/lib/provider/index.js +0 -12
- package/lib/provider/index.js.map +0 -1
- package/lib/provider/style/css.js +0 -2
- package/lib/provider/style/css.js.map +0 -1
- package/lib/provider/style/index.js +0 -2
- package/lib/provider/style/index.js.map +0 -1
- package/lib/renderer/Fill.js +0 -37
- package/lib/renderer/Fill.js.map +0 -1
- package/lib/renderer/Stroke.js +0 -39
- package/lib/renderer/Stroke.js.map +0 -1
- package/lib/renderer/index.js +0 -138
- package/lib/renderer/index.js.map +0 -1
- package/lib/renderer/style/css.js +0 -4
- package/lib/renderer/style/css.js.map +0 -1
- package/lib/renderer/style/index.css +0 -0
- package/lib/renderer/style/index.js +0 -4
- package/lib/renderer/style/index.js.map +0 -1
- package/lib/renderer/style/index.less +0 -0
- package/lib/renderer/transformRgb.js +0 -33
- package/lib/renderer/transformRgb.js.map +0 -1
- package/lib/search-map/VtxModal.js +0 -202
- package/lib/search-map/VtxModal.js.map +0 -1
- package/lib/search-map/index.js +0 -417
- package/lib/search-map/index.js.map +0 -1
- package/lib/search-map/style/css.js +0 -6
- package/lib/search-map/style/css.js.map +0 -1
- package/lib/search-map/style/index.css +0 -73
- package/lib/search-map/style/index.js +0 -6
- package/lib/search-map/style/index.js.map +0 -1
- package/lib/search-map/style/index.less +0 -83
- package/lib/search-map/style/modal.css +0 -54
- package/lib/search-map/style/modal.less +0 -58
- package/lib/style/index.css +0 -0
- package/lib/style/index.less +0 -2
- package/lib/style/themes/compact.css +0 -0
- package/lib/style/themes/compact.less +0 -1
- package/lib/style/themes/dark.css +0 -0
- package/lib/style/themes/dark.less +0 -9
- package/lib/style/themes/default.css +0 -0
- package/lib/style/themes/default.less +0 -7
- package/lib/style/themes/index.css +0 -0
- package/lib/style/themes/index.less +0 -1
- package/lib/style/themes/variable.css +0 -0
- package/lib/style/themes/variable.less +0 -5
- package/lib/tile-layer/TileLayer.js +0 -85
- package/lib/tile-layer/TileLayer.js.map +0 -1
- package/lib/tile-layer/index.js +0 -53
- package/lib/tile-layer/index.js.map +0 -1
- package/lib/tile-layer/style/css.js +0 -4
- package/lib/tile-layer/style/css.js.map +0 -1
- package/lib/tile-layer/style/index.css +0 -0
- package/lib/tile-layer/style/index.js +0 -4
- package/lib/tile-layer/style/index.js.map +0 -1
- package/lib/tile-layer/style/index.less +0 -0
- package/lib/tools/Layer/LayerService.js +0 -182
- package/lib/tools/Layer/LayerService.js.map +0 -1
- package/lib/tools/Layer/LayersCheckService.js +0 -188
- package/lib/tools/Layer/LayersCheckService.js.map +0 -1
- package/lib/tools/Layer/index.css +0 -50
- package/lib/tools/Layer/index.js +0 -226
- package/lib/tools/Layer/index.js.map +0 -1
- package/lib/tools/Layer/index.less +0 -43
- package/lib/tools/Search/index.js +0 -296
- package/lib/tools/Search/index.js.map +0 -1
- package/lib/tools/Toolbox/BoxSelect/index.js +0 -19
- package/lib/tools/Toolbox/BoxSelect/index.js.map +0 -1
- package/lib/tools/Toolbox/CircleSelect/index.js +0 -19
- package/lib/tools/Toolbox/CircleSelect/index.js.map +0 -1
- package/lib/tools/Toolbox/EagleEye/index.js +0 -56
- package/lib/tools/Toolbox/EagleEye/index.js.map +0 -1
- package/lib/tools/Toolbox/MapBookmark/Bookmark.js +0 -150
- package/lib/tools/Toolbox/MapBookmark/Bookmark.js.map +0 -1
- package/lib/tools/Toolbox/MapBookmark/index.css +0 -18
- package/lib/tools/Toolbox/MapBookmark/index.js +0 -429
- package/lib/tools/Toolbox/MapBookmark/index.js.map +0 -1
- package/lib/tools/Toolbox/MapBookmark/index.less +0 -20
- package/lib/tools/Toolbox/MapDownload/index.js +0 -16
- package/lib/tools/Toolbox/MapDownload/index.js.map +0 -1
- package/lib/tools/Toolbox/MapPrint/index.css +0 -4
- package/lib/tools/Toolbox/MapPrint/index.js +0 -233
- package/lib/tools/Toolbox/MapPrint/index.js.map +0 -1
- package/lib/tools/Toolbox/MapPrint/index.less +0 -4
- package/lib/tools/Toolbox/Measure/Area/index.js +0 -16
- package/lib/tools/Toolbox/Measure/Area/index.js.map +0 -1
- package/lib/tools/Toolbox/Measure/Distance/index.js +0 -16
- package/lib/tools/Toolbox/Measure/Distance/index.js.map +0 -1
- package/lib/tools/Toolbox/Measure/Measure.js +0 -227
- package/lib/tools/Toolbox/Measure/Measure.js.map +0 -1
- package/lib/tools/Toolbox/Measure/index.js +0 -76
- package/lib/tools/Toolbox/Measure/index.js.map +0 -1
- package/lib/tools/Toolbox/PolygonSelect/index.js +0 -19
- package/lib/tools/Toolbox/PolygonSelect/index.js.map +0 -1
- package/lib/tools/Toolbox/ScaleLine/index.js +0 -58
- package/lib/tools/Toolbox/ScaleLine/index.js.map +0 -1
- package/lib/tools/Toolbox/SelectTools/index.css +0 -103
- package/lib/tools/Toolbox/SelectTools/index.js +0 -777
- package/lib/tools/Toolbox/SelectTools/index.js.map +0 -1
- package/lib/tools/Toolbox/SelectTools/index.less +0 -87
- package/lib/tools/Toolbox/SpaceQuery/index.css +0 -19
- package/lib/tools/Toolbox/SpaceQuery/index.js +0 -593
- package/lib/tools/Toolbox/SpaceQuery/index.js.map +0 -1
- package/lib/tools/Toolbox/SpaceQuery/index.less +0 -16
- package/lib/tools/Toolbox/ZoomInput/index.css +0 -6
- package/lib/tools/Toolbox/ZoomInput/index.js +0 -49
- package/lib/tools/Toolbox/ZoomInput/index.js.map +0 -1
- package/lib/tools/Toolbox/ZoomInput/index.less +0 -6
- package/lib/tools/Toolbox/index.css +0 -0
- package/lib/tools/Toolbox/index.js +0 -170
- package/lib/tools/Toolbox/index.js.map +0 -1
- package/lib/tools/Toolbox/index.less +0 -2
- package/lib/tools/Utils/CreateOverlay.js +0 -46
- package/lib/tools/Utils/CreateOverlay.js.map +0 -1
- package/lib/tools/Utils/Draw.js +0 -127
- package/lib/tools/Utils/Draw.js.map +0 -1
- package/lib/tools/Utils/HighLayer.js +0 -211
- package/lib/tools/Utils/HighLayer.js.map +0 -1
- package/lib/tools/Utils/measure.js +0 -246
- package/lib/tools/Utils/measure.js.map +0 -1
- package/lib/tools/Utils/utils.js +0 -263
- package/lib/tools/Utils/utils.js.map +0 -1
- package/lib/tools/View/index.css +0 -35
- package/lib/tools/View/index.js +0 -165
- package/lib/tools/View/index.js.map +0 -1
- package/lib/tools/View/index.less +0 -28
- package/lib/tools/analysis-tool/index.js +0 -112
- package/lib/tools/analysis-tool/index.js.map +0 -1
- package/lib/tools/base-map-switch/index.js +0 -149
- package/lib/tools/base-map-switch/index.js.map +0 -1
- package/lib/tools/components/Chart/index.js +0 -818
- package/lib/tools/components/Chart/index.js.map +0 -1
- package/lib/tools/components/Icon/index.js +0 -31
- package/lib/tools/components/Icon/index.js.map +0 -1
- package/lib/tools/components/Info/index.css +0 -39
- package/lib/tools/components/Info/index.js +0 -34
- package/lib/tools/components/Info/index.js.map +0 -1
- package/lib/tools/components/Info/index.less +0 -26
- package/lib/tools/components/ItemWrap/index.css +0 -43
- package/lib/tools/components/ItemWrap/index.js +0 -47
- package/lib/tools/components/ItemWrap/index.js.map +0 -1
- package/lib/tools/components/ItemWrap/index.less +0 -41
- package/lib/tools/components/Modal/index.css +0 -42
- package/lib/tools/components/Modal/index.js +0 -45
- package/lib/tools/components/Modal/index.js.map +0 -1
- package/lib/tools/components/Modal/index.less +0 -33
- package/lib/tools/components/MyTabs/index.js +0 -22
- package/lib/tools/components/MyTabs/index.js.map +0 -1
- package/lib/tools/components/RequiredLabel/index.css +0 -5
- package/lib/tools/components/RequiredLabel/index.js +0 -32
- package/lib/tools/components/RequiredLabel/index.js.map +0 -1
- package/lib/tools/components/RequiredLabel/index.less +0 -5
- package/lib/tools/components/Select/index.js +0 -32
- package/lib/tools/components/Select/index.js.map +0 -1
- package/lib/tools/components/Table/assets/tableIcon.png +0 -0
- package/lib/tools/components/Table/index.css +0 -10
- package/lib/tools/components/Table/index.js +0 -90
- package/lib/tools/components/Table/index.js.map +0 -1
- package/lib/tools/components/Table/index.less +0 -13
- package/lib/tools/components/ToolItem/index.css +0 -30
- package/lib/tools/components/ToolItem/index.js +0 -28
- package/lib/tools/components/ToolItem/index.js.map +0 -1
- package/lib/tools/components/ToolItem/index.less +0 -27
- package/lib/tools/components/ToolsSelect/index.css +0 -15
- package/lib/tools/components/ToolsSelect/index.js +0 -44
- package/lib/tools/components/ToolsSelect/index.js.map +0 -1
- package/lib/tools/components/ToolsSelect/index.less +0 -10
- package/lib/tools/full-screen/index.js +0 -46
- package/lib/tools/full-screen/index.js.map +0 -1
- package/lib/tools/index.js +0 -151
- package/lib/tools/index.js.map +0 -1
- package/lib/tools/layer-control/index.js +0 -170
- package/lib/tools/layer-control/index.js.map +0 -1
- package/lib/tools/refresh/index.js +0 -40
- package/lib/tools/refresh/index.js.map +0 -1
- package/lib/tools/style/css.js +0 -22
- package/lib/tools/style/css.js.map +0 -1
- package/lib/tools/style/index.css +0 -136
- package/lib/tools/style/index.js +0 -22
- package/lib/tools/style/index.js.map +0 -1
- package/lib/tools/style/index.less +0 -154
- package/lib/tools-item/index.js +0 -66
- package/lib/tools-item/index.js.map +0 -1
- package/lib/use-props/index.js +0 -14
- package/lib/use-props/index.js.map +0 -1
- package/lib/use-props/style/css.js +0 -2
- package/lib/use-props/style/css.js.map +0 -1
- package/lib/use-props/style/index.js +0 -2
- package/lib/use-props/style/index.js.map +0 -1
- package/lib/wms-layer/WmsLayer.js +0 -313
- package/lib/wms-layer/WmsLayer.js.map +0 -1
- package/lib/wms-layer/index.js +0 -98
- package/lib/wms-layer/index.js.map +0 -1
- package/lib/wms-layer/style/css.js +0 -4
- package/lib/wms-layer/style/css.js.map +0 -1
- package/lib/wms-layer/style/index.css +0 -0
- package/lib/wms-layer/style/index.js +0 -4
- package/lib/wms-layer/style/index.js.map +0 -1
- package/lib/wms-layer/style/index.less +0 -0
package/lib/map/index.js
DELETED
|
@@ -1,822 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _antd = require("antd");
|
|
10
|
-
var _zh_CN = _interopRequireDefault(require("antd/es/locale/zh_CN"));
|
|
11
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _ol = require("ol");
|
|
13
|
-
var _layer = require("ol/layer");
|
|
14
|
-
var _source = require("ol/source");
|
|
15
|
-
var _control = require("ol/control");
|
|
16
|
-
var _util = require("ol/util");
|
|
17
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
18
|
-
var _getDefaultMapInfo = _interopRequireDefault(require("../_util/getDefaultMapInfo"));
|
|
19
|
-
var _Popup = _interopRequireDefault(require("./Popup"));
|
|
20
|
-
var _getBaseLayers = _interopRequireDefault(require("./getBaseLayers"));
|
|
21
|
-
var _TdtImageryProvider = _interopRequireDefault(require("./getBaseLayers/imagery/tdt/TdtImageryProvider"));
|
|
22
|
-
var _HighLayer = _interopRequireDefault(require("../tools/Utils/HighLayer"));
|
|
23
|
-
var _Search = require("../tools/Search");
|
|
24
|
-
var _events = require("../events");
|
|
25
|
-
var _layer2 = require("../_util/layer");
|
|
26
|
-
var _createFeatureCollection = require("../feature-layer/createFeatureCollection");
|
|
27
|
-
var _FeatureLayer = _interopRequireDefault(require("../feature-layer/FeatureLayer"));
|
|
28
|
-
var _ImageLayer = _interopRequireDefault(require("../image-layer/ImageLayer"));
|
|
29
|
-
var _ImageTileLayer = _interopRequireDefault(require("../image-layer/ImageTileLayer"));
|
|
30
|
-
var _ahooks = require("ahooks");
|
|
31
|
-
var _provider = _interopRequireDefault(require("../provider"));
|
|
32
|
-
var _Layers = _interopRequireDefault(require("./Layers"));
|
|
33
|
-
var _Analysis = _interopRequireDefault(require("./Analysis"));
|
|
34
|
-
var _WmsLayer = _interopRequireDefault(require("../wms-layer/WmsLayer"));
|
|
35
|
-
require("ol/ol.css");
|
|
36
|
-
require("./style");
|
|
37
|
-
var _search = require("../_util/search");
|
|
38
|
-
var _lodash = require("lodash");
|
|
39
|
-
var _excluded = ["minZoom", "maxZoom", "defaultZoomLevel", "longitude", "latitude"];
|
|
40
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
41
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
42
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
43
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
44
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
45
|
-
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."); }
|
|
46
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
47
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
48
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
49
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
50
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
51
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
52
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
53
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
54
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
55
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
56
|
-
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
57
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
58
|
-
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."); }
|
|
59
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
60
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
61
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
62
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
63
|
-
function Map(props) {
|
|
64
|
-
var _props$width = props.width,
|
|
65
|
-
width = _props$width === void 0 ? '100%' : _props$width,
|
|
66
|
-
_props$height = props.height,
|
|
67
|
-
height = _props$height === void 0 ? '100%' : _props$height,
|
|
68
|
-
children = props.children,
|
|
69
|
-
center = props.center,
|
|
70
|
-
dark = props.dark,
|
|
71
|
-
style = props.style,
|
|
72
|
-
zoom = props.zoom,
|
|
73
|
-
createdMap = props.createdMap,
|
|
74
|
-
mapStyle = props.mapStyle,
|
|
75
|
-
baseMapStyle = props.baseMapStyle,
|
|
76
|
-
tk = props.tk,
|
|
77
|
-
onCloseTemplateBefore = props.onCloseTemplateBefore,
|
|
78
|
-
onZoom = props.onZoom,
|
|
79
|
-
customBaseLayers = props.customBaseLayers,
|
|
80
|
-
positionStyle = props.positionStyle,
|
|
81
|
-
_props$autoView = props.autoView,
|
|
82
|
-
autoView = _props$autoView === void 0 ? true : _props$autoView,
|
|
83
|
-
_props$closePopupAuto = props.closePopupAutoView,
|
|
84
|
-
closePopupAutoView = _props$closePopupAuto === void 0 ? true : _props$closePopupAuto,
|
|
85
|
-
hidePopupTable = props.hidePopupTable,
|
|
86
|
-
fitViewMaxZoom = props.fitViewMaxZoom,
|
|
87
|
-
encrypt = props.encrypt;
|
|
88
|
-
var _useState = (0, _react.useState)(false),
|
|
89
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
90
|
-
mapLoaded = _useState2[0],
|
|
91
|
-
setMapLoaded = _useState2[1];
|
|
92
|
-
var _useState3 = (0, _react.useState)(null),
|
|
93
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
94
|
-
setModal = _useState4[1];
|
|
95
|
-
var _useState5 = (0, _react.useState)(false),
|
|
96
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
97
|
-
tipVis = _useState6[0],
|
|
98
|
-
setTipVis = _useState6[1];
|
|
99
|
-
var _useState7 = (0, _react.useState)(null),
|
|
100
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
101
|
-
tip = _useState8[0],
|
|
102
|
-
setTip = _useState8[1];
|
|
103
|
-
var _useState9 = (0, _react.useState)(null),
|
|
104
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
105
|
-
pointTip = _useState10[0],
|
|
106
|
-
setPointTip = _useState10[1];
|
|
107
|
-
var mapRef = (0, _react.useRef)(null);
|
|
108
|
-
var timerRef = (0, _react.useRef)(null);
|
|
109
|
-
var mapDomRef = (0, _react.useRef)(null);
|
|
110
|
-
var highLayerRef = (0, _react.useRef)();
|
|
111
|
-
var popupRef = (0, _react.useRef)();
|
|
112
|
-
var timeRef = (0, _react.useRef)(null);
|
|
113
|
-
var baseLayerRef = (0, _react.useRef)([]);
|
|
114
|
-
(0, _react.useEffect)(function () {
|
|
115
|
-
initMap();
|
|
116
|
-
return function () {
|
|
117
|
-
window.removeEventListener('resize', handleResize);
|
|
118
|
-
highLayerRef.current && highLayerRef.current.destroy();
|
|
119
|
-
};
|
|
120
|
-
}, []);
|
|
121
|
-
(0, _react.useEffect)(function () {
|
|
122
|
-
if (mapRef.current) {
|
|
123
|
-
timerRef.current = setInterval(function () {
|
|
124
|
-
var layers = mapRef.current.getLayers().getArray() || [];
|
|
125
|
-
layers.map(function (v) {
|
|
126
|
-
if (v.autoRefresh && v.key && v.get('visible') && v.refresh) {
|
|
127
|
-
v.refresh();
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}, 10000);
|
|
131
|
-
}
|
|
132
|
-
return function () {
|
|
133
|
-
if (timerRef.current) {
|
|
134
|
-
clearInterval(timerRef.current);
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
}, []);
|
|
138
|
-
(0, _ahooks.useUpdateEffect)(function () {
|
|
139
|
-
mapRef.current.setMapStyle(mapStyle);
|
|
140
|
-
}, [mapStyle]);
|
|
141
|
-
var initMap = /*#__PURE__*/function () {
|
|
142
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
143
|
-
var _baseLayerRef$current;
|
|
144
|
-
var defaultMapInfo, minZoom, maxZoom, defaultZoomLevel, longitude, latitude, otherDefaultMapInfo, viewDefault, map, baseLayerParams, _baseLayerRef$current2, registerMapEvent, registerEvent, hoverFeature;
|
|
145
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
146
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
147
|
-
case 0:
|
|
148
|
-
registerEvent = function _registerEvent(eventTarget, feature, event) {
|
|
149
|
-
if (feature) {
|
|
150
|
-
var _feature$eventTarget;
|
|
151
|
-
var properties = feature.getProperties();
|
|
152
|
-
|
|
153
|
-
// 触发自身事件
|
|
154
|
-
(_feature$eventTarget = feature[eventTarget]) === null || _feature$eventTarget === void 0 || _feature$eventTarget.call(feature, properties, event);
|
|
155
|
-
var layer = map.getLayerByFeature(feature);
|
|
156
|
-
if (layer !== null && layer !== void 0 && layer[eventTarget]) {
|
|
157
|
-
layer[eventTarget](properties, event);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
registerMapEvent = function _registerMapEvent(eventTarget, e) {
|
|
162
|
-
if (map[eventTarget]) {
|
|
163
|
-
map[eventTarget](e);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
defaultMapInfo = (0, _getDefaultMapInfo["default"])();
|
|
167
|
-
minZoom = defaultMapInfo.minZoom, maxZoom = defaultMapInfo.maxZoom, defaultZoomLevel = defaultMapInfo.defaultZoomLevel, longitude = defaultMapInfo.longitude, latitude = defaultMapInfo.latitude, otherDefaultMapInfo = _objectWithoutProperties(defaultMapInfo, _excluded); // 全屏
|
|
168
|
-
viewDefault = {
|
|
169
|
-
center: center || longitude && latitude && [longitude, latitude] || [116.397228, 30.9096],
|
|
170
|
-
zoom: zoom || defaultZoomLevel && Number(defaultZoomLevel) || 4,
|
|
171
|
-
minZoom: minZoom && Number(minZoom) || props.minZoom || 4,
|
|
172
|
-
maxZoom: maxZoom && Number(maxZoom) || props.maxZoom
|
|
173
|
-
};
|
|
174
|
-
map = new _ol.Map({
|
|
175
|
-
target: mapDomRef.current,
|
|
176
|
-
controls: (0, _control.defaults)({
|
|
177
|
-
zoom: false
|
|
178
|
-
}).extend([]),
|
|
179
|
-
// layers: [...getBaseLayers({ mapStyle, dark, tk, baseMapStyle })],
|
|
180
|
-
pixelRatio: 1,
|
|
181
|
-
view: new _ol.View(_objectSpread(_objectSpread({}, viewDefault), {}, {
|
|
182
|
-
projection: 'EPSG:4326',
|
|
183
|
-
constrainResolution: true
|
|
184
|
-
})),
|
|
185
|
-
// 设置缩放级别为整数
|
|
186
|
-
constrainResolution: true,
|
|
187
|
-
// 关闭无级缩放地图
|
|
188
|
-
smoothResolutionConstraint: false
|
|
189
|
-
}); // 统一加密啊配置
|
|
190
|
-
map.encrypt = encrypt;
|
|
191
|
-
baseLayerParams = _objectSpread(_objectSpread({}, otherDefaultMapInfo), {}, {
|
|
192
|
-
mapStyle: mapStyle || defaultMapInfo.mapStyle || 'vec',
|
|
193
|
-
baseMapStyle: baseMapStyle || defaultMapInfo.baseMapStyle || 'TdtImageryProvider',
|
|
194
|
-
dark: dark || defaultMapInfo.dark,
|
|
195
|
-
tk: tk || defaultMapInfo.tk
|
|
196
|
-
});
|
|
197
|
-
if (customBaseLayers) {
|
|
198
|
-
baseLayerRef.current = _toConsumableArray(customBaseLayers(baseLayerParams));
|
|
199
|
-
} else {
|
|
200
|
-
baseLayerRef.current = _toConsumableArray((0, _getBaseLayers["default"])(baseLayerParams));
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// 用于鹰眼图层
|
|
204
|
-
map.baseLayer = (0, _lodash.cloneDeep)(baseLayerRef.current);
|
|
205
|
-
if ((_baseLayerRef$current = baseLayerRef.current) !== null && _baseLayerRef$current !== void 0 && _baseLayerRef$current.length) {
|
|
206
|
-
(_baseLayerRef$current2 = baseLayerRef.current) === null || _baseLayerRef$current2 === void 0 || _baseLayerRef$current2.map(function (item) {
|
|
207
|
-
map.addLayer(item);
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
map.tk = tk;
|
|
211
|
-
|
|
212
|
-
// 隐藏表格弹出框
|
|
213
|
-
map.hidePopupTable = hidePopupTable;
|
|
214
|
-
|
|
215
|
-
// 自动调整视角
|
|
216
|
-
map.autoView = autoView;
|
|
217
|
-
|
|
218
|
-
// 关闭气泡自动调整视角
|
|
219
|
-
map.closePopupAutoView = closePopupAutoView;
|
|
220
|
-
|
|
221
|
-
// 图层管理
|
|
222
|
-
map.layers = new _Layers["default"]({
|
|
223
|
-
map: map
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
// 分析管理
|
|
227
|
-
map.analysis = new _Analysis["default"]({
|
|
228
|
-
map: map
|
|
229
|
-
});
|
|
230
|
-
mapRef.current = map;
|
|
231
|
-
|
|
232
|
-
// 地图视角默认配置
|
|
233
|
-
map.viewDefault = viewDefault;
|
|
234
|
-
|
|
235
|
-
// 设置地图底图样式
|
|
236
|
-
map.setMapStyle = function (_mapStyle) {
|
|
237
|
-
var _map$getLayerByKey, _map$getLayerByKey2;
|
|
238
|
-
var _TdtImageryProvider$g = _TdtImageryProvider["default"].getSource({
|
|
239
|
-
mapStyle: _mapStyle,
|
|
240
|
-
tk: tk
|
|
241
|
-
}),
|
|
242
|
-
_TdtImageryProvider$g2 = _slicedToArray(_TdtImageryProvider$g, 2),
|
|
243
|
-
tileLayerSource = _TdtImageryProvider$g2[0],
|
|
244
|
-
markLayerSource = _TdtImageryProvider$g2[1];
|
|
245
|
-
(_map$getLayerByKey = map.getLayerByKey('__TDT_TILE')) === null || _map$getLayerByKey === void 0 || _map$getLayerByKey.setSource(tileLayerSource);
|
|
246
|
-
(_map$getLayerByKey2 = map.getLayerByKey('__TDT_MARK')) === null || _map$getLayerByKey2 === void 0 || _map$getLayerByKey2.setSource(markLayerSource);
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
// 高亮效果
|
|
250
|
-
highLayerRef.current = new _HighLayer["default"]({
|
|
251
|
-
map: map
|
|
252
|
-
});
|
|
253
|
-
map.highlightLayer = highLayerRef.current;
|
|
254
|
-
|
|
255
|
-
// 切换底图
|
|
256
|
-
map.changeBaseLayer = function (baseMapStyle) {
|
|
257
|
-
var _baseLayerRef$current3, _baseLayerRef$current4;
|
|
258
|
-
(_baseLayerRef$current3 = baseLayerRef.current) === null || _baseLayerRef$current3 === void 0 || _baseLayerRef$current3.map(function (item) {
|
|
259
|
-
map.removeLayer(item);
|
|
260
|
-
});
|
|
261
|
-
baseLayerRef.current = _toConsumableArray((0, _getBaseLayers["default"])({
|
|
262
|
-
mapStyle: mapStyle,
|
|
263
|
-
dark: dark,
|
|
264
|
-
tk: tk,
|
|
265
|
-
baseMapStyle: baseMapStyle
|
|
266
|
-
}));
|
|
267
|
-
(_baseLayerRef$current4 = baseLayerRef.current) === null || _baseLayerRef$current4 === void 0 || _baseLayerRef$current4.map(function (item) {
|
|
268
|
-
map.addLayer(item);
|
|
269
|
-
});
|
|
270
|
-
map.baseLayer = (0, _lodash.cloneDeep)(baseLayerRef.current);
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
// 获取基础图层
|
|
274
|
-
map.getBaseLayers = _getBaseLayers["default"];
|
|
275
|
-
|
|
276
|
-
// 设置高亮
|
|
277
|
-
map.setHighlightFeature = function (feature, options) {
|
|
278
|
-
map.highlightLayer.addHighlightFeature(feature, options);
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
// 清除高亮
|
|
282
|
-
map.clearHighlightFeature = function () {
|
|
283
|
-
map.highlightLayer.clearFeatures();
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
// 根 key 查找图层
|
|
287
|
-
map.getLayerByKey = function (key) {
|
|
288
|
-
return map.getAllLayers().find(function (layer) {
|
|
289
|
-
if (layer.key === key) {
|
|
290
|
-
return layer;
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
// 查找展示的绑定key的wms图层
|
|
296
|
-
map.getWmsVisibleLayers = function (keys) {
|
|
297
|
-
var layers = [];
|
|
298
|
-
var allLayers = map.getAllLayers();
|
|
299
|
-
if (Array.isArray(keys) && keys !== null && keys !== void 0 && keys.length) {
|
|
300
|
-
allLayers = allLayers.filter(function (item) {
|
|
301
|
-
return keys.includes(item.key);
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
allLayers.map(function (layer) {
|
|
305
|
-
if (layer.key && (layer instanceof _layer.Image || layer instanceof _ImageTileLayer["default"] || layer instanceof _ImageLayer["default"] || layer instanceof _WmsLayer["default"]) && layer.get('visible')) {
|
|
306
|
-
layers.push(layer);
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
return layers;
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
// 查找展示的绑定key的wfs图层
|
|
313
|
-
map.getWfsVisibleLayers = function (keys) {
|
|
314
|
-
var layers = [];
|
|
315
|
-
var allLayers = map.getAllLayers();
|
|
316
|
-
if (Array.isArray(keys) && keys !== null && keys !== void 0 && keys.length) {
|
|
317
|
-
allLayers = allLayers.filter(function (item) {
|
|
318
|
-
return keys.includes(item.key);
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
allLayers.map(function (layer) {
|
|
322
|
-
if (layer.key && layer instanceof _layer.Vector && layer.get('visible')) {
|
|
323
|
-
layers.push(layer);
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
|
-
return layers;
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
// 根据key查找展示的图层,不传keys查所有展示的除底图的带key的图层
|
|
330
|
-
map.getVisibleLayersByKeys = function (keys) {
|
|
331
|
-
var layers = map.getAllLayers() || [];
|
|
332
|
-
return layers.filter(function (layer) {
|
|
333
|
-
if (typeof keys === 'string') {
|
|
334
|
-
return layer.key === keys && layer.get('visible');
|
|
335
|
-
} else if (Array.isArray(keys)) {
|
|
336
|
-
return keys.includes(layer.key) && layer.get('visible');
|
|
337
|
-
} else if (layer.key !== "Highlight") {
|
|
338
|
-
return layer.get('visible') && layer.key;
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
// 通过图形查询所属图层
|
|
344
|
-
map.getLayerByFeature = function (feature) {
|
|
345
|
-
return map.getAllLayers().find(function (layer) {
|
|
346
|
-
if (layer.key) {
|
|
347
|
-
var _feature$values_, _feature$values_2;
|
|
348
|
-
if (feature !== null && feature !== void 0 && feature.key && feature.key === layer.key) {
|
|
349
|
-
return layer;
|
|
350
|
-
} else if (layer instanceof _layer.Vector && layer.key !== 'Highlight') {
|
|
351
|
-
var source = layer.getSource();
|
|
352
|
-
if (source.source && source.source.hasFeature(feature)) {
|
|
353
|
-
return layer;
|
|
354
|
-
} else if (source.hasFeature(feature)) {
|
|
355
|
-
return layer;
|
|
356
|
-
}
|
|
357
|
-
} else if (feature !== null && feature !== void 0 && feature.layerKey && (feature === null || feature === void 0 ? void 0 : feature.layerKey) === layer.key) {
|
|
358
|
-
return layer;
|
|
359
|
-
} else if (feature !== null && feature !== void 0 && (_feature$values_ = feature.values_) !== null && _feature$values_ !== void 0 && _feature$values_.key && layer.key === (feature === null || feature === void 0 || (_feature$values_2 = feature.values_) === null || _feature$values_2 === void 0 ? void 0 : _feature$values_2.key)) {
|
|
360
|
-
return layer;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
// 根据关键字获取图形信息
|
|
367
|
-
map.getMapFeatureInfoByText = function (text) {
|
|
368
|
-
return (0, _Search.getMapFeatureInfoByText)(map, text);
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
// poi查询
|
|
372
|
-
map.poiSearch = function () {
|
|
373
|
-
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
374
|
-
return (0, _search.poiSearch)(params);
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
// 获取图层是否允许点击
|
|
378
|
-
map.getLayerHasViewOnlyByFeature = function (feature) {
|
|
379
|
-
var layer = map.getLayerByFeature(feature);
|
|
380
|
-
return layer === null || layer === void 0 ? void 0 : layer.viewOnly;
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
// 展示提示
|
|
384
|
-
map.showTip = function (content) {
|
|
385
|
-
setTip(content);
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
// 隐藏提示
|
|
389
|
-
map.hideTip = function () {
|
|
390
|
-
setTip(null);
|
|
391
|
-
};
|
|
392
|
-
map.showPointTip = function (content) {
|
|
393
|
-
setPointTip(content);
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
// 隐藏提示
|
|
397
|
-
map.hidePointTip = function () {
|
|
398
|
-
setPointTip(null);
|
|
399
|
-
};
|
|
400
|
-
|
|
401
|
-
// 展示弹窗
|
|
402
|
-
map.showModal = function (params) {
|
|
403
|
-
setModal(params);
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
// 隐藏弹窗
|
|
407
|
-
map.hideModal = function () {
|
|
408
|
-
setModal(null);
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
// 根据图层条件设置图层选中
|
|
412
|
-
map.showTemplateByFilter = /*#__PURE__*/function () {
|
|
413
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(key, field, value, options) {
|
|
414
|
-
var layer, obj;
|
|
415
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
416
|
-
while (1) switch (_context.prev = _context.next) {
|
|
417
|
-
case 0:
|
|
418
|
-
layer = map.getLayerByKey(key);
|
|
419
|
-
if (layer !== null && layer !== void 0 && layer.show) {
|
|
420
|
-
obj = layer.getFeatureByFieldValue(field, value);
|
|
421
|
-
if (obj !== null && obj !== void 0 && obj.then) {
|
|
422
|
-
obj.then(function (features) {
|
|
423
|
-
if (features !== null && features !== void 0 && features.length) {
|
|
424
|
-
var feature = features[0];
|
|
425
|
-
map.showTemplate(feature.feature || feature, options);
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
} else {
|
|
429
|
-
if (obj) {
|
|
430
|
-
map.showTemplate(obj, options);
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
case 2:
|
|
435
|
-
case "end":
|
|
436
|
-
return _context.stop();
|
|
437
|
-
}
|
|
438
|
-
}, _callee);
|
|
439
|
-
}));
|
|
440
|
-
return function (_x, _x2, _x3, _x4) {
|
|
441
|
-
return _ref2.apply(this, arguments);
|
|
442
|
-
};
|
|
443
|
-
}();
|
|
444
|
-
|
|
445
|
-
// 展示看板
|
|
446
|
-
map.showTemplate = function (feature, options) {
|
|
447
|
-
var _popupRef$current, _popupRef$current$sho;
|
|
448
|
-
(_popupRef$current = popupRef.current) === null || _popupRef$current === void 0 || (_popupRef$current$sho = _popupRef$current.showTemplate) === null || _popupRef$current$sho === void 0 || _popupRef$current$sho.call(_popupRef$current, feature, options);
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
// 隐藏看板
|
|
452
|
-
map.hideTemplate = function () {
|
|
453
|
-
var _popupRef$current2, _popupRef$current2$hi;
|
|
454
|
-
(_popupRef$current2 = popupRef.current) === null || _popupRef$current2 === void 0 || (_popupRef$current2$hi = _popupRef$current2.hideTemplate) === null || _popupRef$current2$hi === void 0 || _popupRef$current2$hi.call(_popupRef$current2);
|
|
455
|
-
};
|
|
456
|
-
map.setLastView = function () {
|
|
457
|
-
var _popupRef$current3, _popupRef$current3$se;
|
|
458
|
-
(_popupRef$current3 = popupRef.current) === null || _popupRef$current3 === void 0 || (_popupRef$current3$se = _popupRef$current3.setLastView) === null || _popupRef$current3$se === void 0 || _popupRef$current3$se.call(_popupRef$current3);
|
|
459
|
-
};
|
|
460
|
-
|
|
461
|
-
// 下标显隐
|
|
462
|
-
map.setLabelVisible = function (visible) {
|
|
463
|
-
map.getAllLayers().find(function (layer) {
|
|
464
|
-
if (layer instanceof _FeatureLayer["default"]) {
|
|
465
|
-
layer.label = visible;
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
// 聚合显隐
|
|
471
|
-
map.setClusterVisible = function (visible) {
|
|
472
|
-
map.getAllLayers().find(function (layer) {
|
|
473
|
-
if (layer instanceof _FeatureLayer["default"]) {
|
|
474
|
-
layer.cluster = visible;
|
|
475
|
-
}
|
|
476
|
-
});
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
// 海量点显隐
|
|
480
|
-
map.setPointVisible = function (visible) {
|
|
481
|
-
map.getAllLayers().find(function (layer) {
|
|
482
|
-
if (layer instanceof _FeatureLayer["default"]) {
|
|
483
|
-
layer.point = visible;
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
};
|
|
487
|
-
|
|
488
|
-
// 通过返回值控制是否执行关闭
|
|
489
|
-
map.onCloseTemplateBefore = function (feature) {
|
|
490
|
-
if (onCloseTemplateBefore) {
|
|
491
|
-
return onCloseTemplateBefore(feature);
|
|
492
|
-
}
|
|
493
|
-
};
|
|
494
|
-
map.getViewOptions = function () {
|
|
495
|
-
var view = map.getView();
|
|
496
|
-
var _view$getCenter = view.getCenter(),
|
|
497
|
-
_view$getCenter2 = _slicedToArray(_view$getCenter, 2),
|
|
498
|
-
x = _view$getCenter2[0],
|
|
499
|
-
y = _view$getCenter2[1];
|
|
500
|
-
return {
|
|
501
|
-
zoom: view.getZoom(),
|
|
502
|
-
x: x,
|
|
503
|
-
y: y
|
|
504
|
-
};
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
// 自适应
|
|
508
|
-
map.fitView = function (e, options) {
|
|
509
|
-
if (e) {
|
|
510
|
-
var _e$values_;
|
|
511
|
-
var extent;
|
|
512
|
-
if (e instanceof _layer.Vector) {
|
|
513
|
-
// 针对图层处理
|
|
514
|
-
extent = e.getSource().getExtent();
|
|
515
|
-
} else if (e instanceof _source.Vector) {
|
|
516
|
-
// 针对图层源处理
|
|
517
|
-
extent = e.getExtent();
|
|
518
|
-
} else if (Array.isArray(e) || e.geometryInfo) {
|
|
519
|
-
var _e$;
|
|
520
|
-
// 针对数据处理
|
|
521
|
-
var vectorSource = new _source.Vector();
|
|
522
|
-
if (e.geometryInfo || e !== null && e !== void 0 && (_e$ = e[0]) !== null && _e$ !== void 0 && _e$.geometryInfo) {
|
|
523
|
-
// 针对数据处理
|
|
524
|
-
var f = (0, _createFeatureCollection.createGeoJson)(e);
|
|
525
|
-
vectorSource.addFeatures(f);
|
|
526
|
-
} else if (e instanceof _ol.Feature || (e === null || e === void 0 ? void 0 : e[0]) instanceof _ol.Feature) {
|
|
527
|
-
// 针对图形处理
|
|
528
|
-
vectorSource.addFeatures(e);
|
|
529
|
-
}
|
|
530
|
-
extent = vectorSource.getExtent();
|
|
531
|
-
} else if (e !== null && e !== void 0 && (_e$values_ = e.values_) !== null && _e$values_ !== void 0 && _e$values_.geometry) {
|
|
532
|
-
// 针对单个图形
|
|
533
|
-
extent = e.values_.geometry.getExtent();
|
|
534
|
-
}
|
|
535
|
-
if (extent) {
|
|
536
|
-
if (e !== null && e !== void 0 && e.noFitView) {
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
var currentZoom = map.getView().getZoom();
|
|
540
|
-
var _maxZoom = fitViewMaxZoom || 16;
|
|
541
|
-
map.getView().fit(extent, _objectSpread({
|
|
542
|
-
padding: [100, 400, 100, 400],
|
|
543
|
-
maxZoom: currentZoom > _maxZoom ? currentZoom : _maxZoom,
|
|
544
|
-
duration: 500
|
|
545
|
-
}, options));
|
|
546
|
-
} else {
|
|
547
|
-
map.getView().animate(_objectSpread(_objectSpread({}, map.viewDefault), {}, {
|
|
548
|
-
duration: 500
|
|
549
|
-
}, options));
|
|
550
|
-
}
|
|
551
|
-
} else {
|
|
552
|
-
map.getView().animate(_objectSpread(_objectSpread({}, map.viewDefault), {}, {
|
|
553
|
-
duration: 500
|
|
554
|
-
}, options));
|
|
555
|
-
}
|
|
556
|
-
};
|
|
557
|
-
map.fitViewByOptions = function (options) {
|
|
558
|
-
var x = options.x,
|
|
559
|
-
y = options.y,
|
|
560
|
-
zoom = options.zoom;
|
|
561
|
-
if (x && y) {
|
|
562
|
-
var view = map.getView();
|
|
563
|
-
view.animate({
|
|
564
|
-
zoom: zoom || view.getZoom(),
|
|
565
|
-
center: [Number(x), Number(y)]
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
};
|
|
569
|
-
|
|
570
|
-
// 鼠标移入展示名称
|
|
571
|
-
map.on('pointermove', function (event) {
|
|
572
|
-
if (!(map.analysisActive || map.toolboxActive || map.drawActive)) {
|
|
573
|
-
var feature = map.getFeaturesAtPixel(event.pixel)[0];
|
|
574
|
-
if (feature) {
|
|
575
|
-
var layer = map.getLayerByFeature(feature);
|
|
576
|
-
mapDomRef.current.style.cursor = 'pointer'; // 设置手形光标
|
|
577
|
-
|
|
578
|
-
if (layer && (layer.labelField || layer.tipTemplate)) {
|
|
579
|
-
var labelField = layer.labelField,
|
|
580
|
-
tipTemplate = layer.tipTemplate;
|
|
581
|
-
var label;
|
|
582
|
-
if (tipTemplate) {
|
|
583
|
-
label = tipTemplate(feature.values_);
|
|
584
|
-
} else {
|
|
585
|
-
label = feature.values_[labelField];
|
|
586
|
-
}
|
|
587
|
-
if (label) {
|
|
588
|
-
map.showPointTip(label);
|
|
589
|
-
} else {
|
|
590
|
-
map.hidePointTip();
|
|
591
|
-
}
|
|
592
|
-
} else {
|
|
593
|
-
map.hidePointTip();
|
|
594
|
-
}
|
|
595
|
-
} else {
|
|
596
|
-
map.hidePointTip();
|
|
597
|
-
mapDomRef.current.style.cursor = 'default'; // 恢复默认光标
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
});
|
|
601
|
-
|
|
602
|
-
// 注册事件
|
|
603
|
-
(0, _events.registerEventLayer)(map, props);
|
|
604
|
-
|
|
605
|
-
// 鼠标事件,点击属性传递
|
|
606
|
-
|
|
607
|
-
map.on('pointermove', function (event) {
|
|
608
|
-
registerMapEvent('onMouseMove', event);
|
|
609
|
-
var feature = map.getFeaturesAtPixel(event.pixel)[0];
|
|
610
|
-
if (feature) {
|
|
611
|
-
registerEvent('onMouseMove', feature, event);
|
|
612
|
-
|
|
613
|
-
// 判断是否在图形内移动
|
|
614
|
-
if (hoverFeature) {
|
|
615
|
-
var uid = (0, _util.getUid)(feature);
|
|
616
|
-
var hoverUid = (0, _util.getUid)(hoverFeature);
|
|
617
|
-
|
|
618
|
-
// 判断是否进入新的图形
|
|
619
|
-
if (uid !== hoverUid) {
|
|
620
|
-
registerEvent('onMouseLeave', hoverFeature, event);
|
|
621
|
-
registerEvent('onMouseEnter', feature, event);
|
|
622
|
-
hoverFeature = feature;
|
|
623
|
-
}
|
|
624
|
-
} else {
|
|
625
|
-
registerEvent('onMouseEnter', feature, event);
|
|
626
|
-
hoverFeature = feature;
|
|
627
|
-
}
|
|
628
|
-
registerEvent('onMouseMove', feature, event);
|
|
629
|
-
} else {
|
|
630
|
-
if (hoverFeature) {
|
|
631
|
-
registerEvent('onMouseLeave', hoverFeature, event);
|
|
632
|
-
}
|
|
633
|
-
hoverFeature = null;
|
|
634
|
-
}
|
|
635
|
-
});
|
|
636
|
-
|
|
637
|
-
// 点击事件,通过属性传递
|
|
638
|
-
map.on('click', /*#__PURE__*/function () {
|
|
639
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
|
|
640
|
-
var features, _features2, layers, _features;
|
|
641
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
642
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
643
|
-
case 0:
|
|
644
|
-
registerMapEvent('onClick', event);
|
|
645
|
-
map.hideTip();
|
|
646
|
-
map.hidePointTip();
|
|
647
|
-
map._clickObject = event;
|
|
648
|
-
features = map.getFeaturesAtPixel(event.pixel) || [];
|
|
649
|
-
if (map.analysisActive || map.toolboxActive) {
|
|
650
|
-
_context2.next = 17;
|
|
651
|
-
break;
|
|
652
|
-
}
|
|
653
|
-
if (!((_features2 = features) !== null && _features2 !== void 0 && (_features2 = _features2[0]) !== null && _features2 !== void 0 && _features2.isHighLight)) {
|
|
654
|
-
_context2.next = 8;
|
|
655
|
-
break;
|
|
656
|
-
}
|
|
657
|
-
return _context2.abrupt("return", registerEvent('onClick', features[0], event));
|
|
658
|
-
case 8:
|
|
659
|
-
if (features.length) {
|
|
660
|
-
_context2.next = 14;
|
|
661
|
-
break;
|
|
662
|
-
}
|
|
663
|
-
layers = map.getWmsVisibleLayers().filter(function (layer) {
|
|
664
|
-
return !layer.viewOnly;
|
|
665
|
-
});
|
|
666
|
-
_context2.next = 12;
|
|
667
|
-
return (0, _layer2.getWMSFeatureInfoByLayers)(event, map, layers);
|
|
668
|
-
case 12:
|
|
669
|
-
_features = _context2.sent;
|
|
670
|
-
if (_features !== null && _features !== void 0 && _features.length) {
|
|
671
|
-
features = [_features[0]];
|
|
672
|
-
}
|
|
673
|
-
case 14:
|
|
674
|
-
if (features.length) {
|
|
675
|
-
registerEvent('onClick', features[0], event);
|
|
676
|
-
|
|
677
|
-
// 过滤掉仅展示的图层和没有设置气泡的图层
|
|
678
|
-
features = features.filter(function (feature) {
|
|
679
|
-
var layer = map.getLayerByFeature(feature);
|
|
680
|
-
return layer && !layer.viewOnly && layer.template;
|
|
681
|
-
});
|
|
682
|
-
if (features.length) {
|
|
683
|
-
map.showTemplate(features);
|
|
684
|
-
} else {
|
|
685
|
-
map.hideTemplate();
|
|
686
|
-
}
|
|
687
|
-
} else {
|
|
688
|
-
map.hideTemplate();
|
|
689
|
-
}
|
|
690
|
-
_context2.next = 18;
|
|
691
|
-
break;
|
|
692
|
-
case 17:
|
|
693
|
-
if (features.length) {
|
|
694
|
-
registerEvent('onClick', features[0], event);
|
|
695
|
-
}
|
|
696
|
-
case 18:
|
|
697
|
-
case "end":
|
|
698
|
-
return _context2.stop();
|
|
699
|
-
}
|
|
700
|
-
}, _callee2);
|
|
701
|
-
}));
|
|
702
|
-
return function (_x5) {
|
|
703
|
-
return _ref3.apply(this, arguments);
|
|
704
|
-
};
|
|
705
|
-
}());
|
|
706
|
-
|
|
707
|
-
// 双击事件,通过属性传递
|
|
708
|
-
map.on('dblclick', function (event) {
|
|
709
|
-
registerMapEvent('onDoubleClick', event);
|
|
710
|
-
var feature = map.getFeaturesAtPixel(event.pixel)[0];
|
|
711
|
-
registerEvent('onDoubleClick', feature, event);
|
|
712
|
-
});
|
|
713
|
-
|
|
714
|
-
// 层级事件
|
|
715
|
-
map.onZoom = function (zoom) {
|
|
716
|
-
onZoom && onZoom(zoom);
|
|
717
|
-
};
|
|
718
|
-
|
|
719
|
-
//监测地图zoom改变
|
|
720
|
-
map.getView().on('change:resolution', function () {
|
|
721
|
-
if (timeRef.current) {
|
|
722
|
-
clearTimeout(timeRef.current);
|
|
723
|
-
}
|
|
724
|
-
timeRef.current = setTimeout(function () {
|
|
725
|
-
var zoom = map.getView().getZoom();
|
|
726
|
-
map.onZoom(zoom);
|
|
727
|
-
}, 50);
|
|
728
|
-
});
|
|
729
|
-
createdMap && createdMap(map);
|
|
730
|
-
setMapLoaded(true);
|
|
731
|
-
window.addEventListener('resize', handleResize);
|
|
732
|
-
case 61:
|
|
733
|
-
case "end":
|
|
734
|
-
return _context3.stop();
|
|
735
|
-
}
|
|
736
|
-
}, _callee3);
|
|
737
|
-
}));
|
|
738
|
-
return function initMap() {
|
|
739
|
-
return _ref.apply(this, arguments);
|
|
740
|
-
};
|
|
741
|
-
}();
|
|
742
|
-
var handleResize = function handleResize() {
|
|
743
|
-
if (timeRef.current) {
|
|
744
|
-
clearTimeout(timeRef.current);
|
|
745
|
-
}
|
|
746
|
-
timeRef.current = setTimeout(function () {
|
|
747
|
-
mapRef.current && mapRef.current.updateSize();
|
|
748
|
-
}, 50);
|
|
749
|
-
};
|
|
750
|
-
var onMouseMove = function onMouseMove(event) {
|
|
751
|
-
if (pointTip || tip) {
|
|
752
|
-
var dom = document.getElementById('TIP');
|
|
753
|
-
var left = event.nativeEvent.offsetX + 15;
|
|
754
|
-
var top = event.nativeEvent.offsetY + 15;
|
|
755
|
-
|
|
756
|
-
// 适配 右边和 上面的情况
|
|
757
|
-
var rightBound = mapRef.current.getViewport().clientWidth - dom.getBoundingClientRect().width - 15;
|
|
758
|
-
var topBound = mapRef.current.getViewport().clientHeight - dom.getBoundingClientRect().height - 15;
|
|
759
|
-
left = left > rightBound ? rightBound : left;
|
|
760
|
-
top = top > topBound ? topBound : top;
|
|
761
|
-
dom.style.left = "".concat(left, "px");
|
|
762
|
-
dom.style.top = "".concat(top, "px");
|
|
763
|
-
}
|
|
764
|
-
};
|
|
765
|
-
return /*#__PURE__*/_react["default"].createElement(_antd.ConfigProvider, {
|
|
766
|
-
locale: _zh_CN["default"]
|
|
767
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
768
|
-
style: _objectSpread({
|
|
769
|
-
width: width,
|
|
770
|
-
height: height,
|
|
771
|
-
background: dark ? '#152937' : '#cccccc'
|
|
772
|
-
}, style),
|
|
773
|
-
className: (0, _classnames["default"])('ol-map-container', {
|
|
774
|
-
'ol-map-container-dark': dark
|
|
775
|
-
})
|
|
776
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
777
|
-
ref: mapDomRef,
|
|
778
|
-
className: (0, _classnames["default"])('ol-map-content'),
|
|
779
|
-
style: {
|
|
780
|
-
width: width,
|
|
781
|
-
height: height
|
|
782
|
-
},
|
|
783
|
-
onMouseMove: onMouseMove,
|
|
784
|
-
onMouseOver: function onMouseOver() {
|
|
785
|
-
return setTipVis(true);
|
|
786
|
-
},
|
|
787
|
-
onMouseOut: function onMouseOut() {
|
|
788
|
-
return setTipVis(false);
|
|
789
|
-
}
|
|
790
|
-
}, (pointTip || tip) && tipVis && /*#__PURE__*/_react["default"].createElement("div", {
|
|
791
|
-
id: "TIP",
|
|
792
|
-
className: (0, _classnames["default"])('ol-map-custom-tip'),
|
|
793
|
-
style: _objectSpread({}, positionStyle)
|
|
794
|
-
}, pointTip || tip)), mapLoaded && /*#__PURE__*/_react["default"].createElement(_provider["default"], {
|
|
795
|
-
value: {
|
|
796
|
-
map: mapRef.current,
|
|
797
|
-
showModal: props.showModal,
|
|
798
|
-
onPopupClick: props.onPopupClick,
|
|
799
|
-
dark: dark
|
|
800
|
-
}
|
|
801
|
-
}, /*#__PURE__*/_react["default"].createElement(_Popup["default"], {
|
|
802
|
-
map: mapRef.current,
|
|
803
|
-
ref: popupRef
|
|
804
|
-
}), children)));
|
|
805
|
-
}
|
|
806
|
-
var _default = exports["default"] = Map;
|
|
807
|
-
Map.propTypes = {
|
|
808
|
-
width: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
809
|
-
height: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
810
|
-
createdMap: _propTypes["default"].func,
|
|
811
|
-
center: _propTypes["default"].array,
|
|
812
|
-
zoom: _propTypes["default"].number,
|
|
813
|
-
minZoom: _propTypes["default"].number,
|
|
814
|
-
maxZoom: _propTypes["default"].number,
|
|
815
|
-
dark: _propTypes["default"].bool,
|
|
816
|
-
mapStyle: _propTypes["default"].oneOfType(['vec', 'img']),
|
|
817
|
-
tk: _propTypes["default"].string.isRequired,
|
|
818
|
-
style: _propTypes["default"].object,
|
|
819
|
-
baseMapStyle: _propTypes["default"].object,
|
|
820
|
-
encrypt: _propTypes["default"].bool
|
|
821
|
-
};
|
|
822
|
-
//# sourceMappingURL=index.js.map
|