@vtx/ol-map 1.0.144 → 1.0.146
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/README.md +205 -205
- package/lib/_util/EventEmitter.js +80 -0
- package/lib/_util/EventEmitter.js.map +1 -0
- package/lib/_util/StyleCache.js +48 -0
- package/lib/_util/StyleCache.js.map +1 -0
- package/lib/_util/encryptParams.js +65 -0
- package/lib/_util/encryptParams.js.map +1 -0
- package/lib/_util/filterSpecialCharacters.js +90 -0
- package/lib/_util/filterSpecialCharacters.js.map +1 -0
- package/lib/_util/getComponentProps.js +14 -0
- package/lib/_util/getComponentProps.js.map +1 -0
- package/lib/_util/getCookie.js +25 -0
- package/lib/_util/getCookie.js.map +1 -0
- package/lib/_util/getDefaultMapInfo.js +51 -0
- package/lib/_util/getDefaultMapInfo.js.map +1 -0
- package/lib/_util/getSystemInfo.js +27 -0
- package/lib/_util/getSystemInfo.js.map +1 -0
- package/lib/_util/getToken.js +29 -0
- package/lib/_util/getToken.js.map +1 -0
- package/lib/_util/getUrlParam.js +16 -0
- package/lib/_util/getUrlParam.js.map +1 -0
- package/lib/_util/http.js +178 -0
- package/lib/_util/http.js.map +1 -0
- package/lib/_util/isFunction.js +10 -0
- package/lib/_util/isFunction.js.map +1 -0
- package/lib/_util/isObject.js +10 -0
- package/lib/_util/isObject.js.map +1 -0
- package/lib/_util/layer.js +156 -0
- package/lib/_util/layer.js.map +1 -0
- package/lib/_util/mapTool.js +189 -0
- package/lib/_util/mapTool.js.map +1 -0
- package/lib/_util/projzh/datum/bd-09.js +45 -0
- package/lib/_util/projzh/datum/bd-09.js.map +1 -0
- package/lib/_util/projzh/datum/gcj-02.js +73 -0
- package/lib/_util/projzh/datum/gcj-02.js.map +1 -0
- package/lib/_util/projzh/datum/index.js +15 -0
- package/lib/_util/projzh/datum/index.js.map +1 -0
- package/lib/_util/projzh/index.js +41 -0
- package/lib/_util/projzh/index.js.map +1 -0
- package/lib/_util/projzh/projection/baidu-mercator.js +75 -0
- package/lib/_util/projzh/projection/baidu-mercator.js.map +1 -0
- package/lib/_util/projzh/projection/index.js +15 -0
- package/lib/_util/projzh/projection/index.js.map +1 -0
- package/lib/_util/projzh/projection/spherical-mercator.js +26 -0
- package/lib/_util/projzh/projection/spherical-mercator.js.map +1 -0
- package/lib/_util/projzh/util.js +28 -0
- package/lib/_util/projzh/util.js.map +1 -0
- package/lib/_util/search.js +133 -0
- package/lib/_util/search.js.map +1 -0
- package/lib/_util/setCookie.js +16 -0
- package/lib/_util/setCookie.js.map +1 -0
- package/lib/_util/stringToFun.js +25 -0
- package/lib/_util/stringToFun.js.map +1 -0
- package/lib/_util/transform.js +170 -0
- package/lib/_util/transform.js.map +1 -0
- package/lib/_util/useColSize.js +29 -0
- package/lib/_util/useColSize.js.map +1 -0
- package/lib/_util/useInterval.js +19 -0
- package/lib/_util/useInterval.js.map +1 -0
- package/lib/_util/useSet.js +45 -0
- package/lib/_util/useSet.js.map +1 -0
- package/lib/analysis-layer/index.js +455 -0
- package/lib/analysis-layer/index.js.map +1 -0
- package/lib/analysis-layer/style/css.js +2 -0
- package/lib/analysis-layer/style/css.js.map +1 -0
- package/lib/analysis-layer/style/index.js +2 -0
- package/lib/analysis-layer/style/index.js.map +1 -0
- 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 +400 -0
- package/lib/buffer-draw/BufferDraw.js.map +1 -0
- package/lib/buffer-draw/index.js +57 -0
- package/lib/buffer-draw/index.js.map +1 -0
- package/lib/buffer-draw/style/css.js +2 -0
- package/lib/buffer-draw/style/css.js.map +1 -0
- package/lib/buffer-draw/style/index.js +2 -0
- package/lib/buffer-draw/style/index.js.map +1 -0
- package/lib/circle/Circle.js +53 -0
- package/lib/circle/Circle.js.map +1 -0
- package/lib/circle/index.js +65 -0
- package/lib/circle/index.js.map +1 -0
- package/lib/circle/style/css.js +2 -0
- package/lib/circle/style/css.js.map +1 -0
- package/lib/circle/style/index.js +2 -0
- package/lib/circle/style/index.js.map +1 -0
- package/lib/config.js +13 -0
- package/lib/config.js.map +1 -0
- package/lib/convertCamelToCSS.js +24 -0
- package/lib/convertCamelToCSS.js.map +1 -0
- package/lib/dom/Dom.js +41 -0
- package/lib/dom/Dom.js.map +1 -0
- package/lib/dom/index.js +62 -0
- package/lib/dom/index.js.map +1 -0
- package/lib/dom/style/css.js +2 -0
- package/lib/dom/style/css.js.map +1 -0
- package/lib/dom/style/index.js +2 -0
- package/lib/dom/style/index.js.map +1 -0
- package/lib/events/index.js +27 -0
- package/lib/events/index.js.map +1 -0
- package/lib/feature-draw/FeatureDraw.js +236 -0
- package/lib/feature-draw/FeatureDraw.js.map +1 -0
- package/lib/feature-draw/index.js +73 -0
- package/lib/feature-draw/index.js.map +1 -0
- package/lib/feature-draw/style/css.js +2 -0
- package/lib/feature-draw/style/css.js.map +1 -0
- package/lib/feature-draw/style/index.js +2 -0
- package/lib/feature-draw/style/index.js.map +1 -0
- package/lib/feature-layer/FeatureLayer.js +1040 -0
- package/lib/feature-layer/FeatureLayer.js.map +1 -0
- package/lib/feature-layer/MyCluster.js +153 -0
- package/lib/feature-layer/MyCluster.js.map +1 -0
- package/lib/feature-layer/createFeatureCollection.js +175 -0
- package/lib/feature-layer/createFeatureCollection.js.map +1 -0
- package/lib/feature-layer/index.js +155 -0
- package/lib/feature-layer/index.js.map +1 -0
- package/lib/feature-layer/style/css.js +4 -0
- package/lib/feature-layer/style/css.js.map +1 -0
- package/lib/feature-layer/style/index.css +0 -0
- package/lib/feature-layer/style/index.js +4 -0
- package/lib/feature-layer/style/index.js.map +1 -0
- package/lib/feature-layer/style/index.less +0 -0
- package/lib/flow-line-layer/FlowLineLayer.js +200 -0
- package/lib/flow-line-layer/FlowLineLayer.js.map +1 -0
- package/lib/flow-line-layer/index.js +127 -0
- package/lib/flow-line-layer/index.js.map +1 -0
- package/lib/flow-line-layer/style/css.js +4 -0
- package/lib/flow-line-layer/style/css.js.map +1 -0
- package/lib/flow-line-layer/style/index.css +0 -0
- package/lib/flow-line-layer/style/index.js +4 -0
- package/lib/flow-line-layer/style/index.js.map +1 -0
- package/lib/flow-line-layer/style/index.less +0 -0
- package/lib/fly-line-layer/FlyLineLayer.js +220 -0
- package/lib/fly-line-layer/FlyLineLayer.js.map +1 -0
- package/lib/fly-line-layer/index.js +110 -0
- package/lib/fly-line-layer/index.js.map +1 -0
- package/lib/fly-line-layer/style/css.js +4 -0
- package/lib/fly-line-layer/style/css.js.map +1 -0
- package/lib/fly-line-layer/style/index.css +0 -0
- package/lib/fly-line-layer/style/index.js +4 -0
- package/lib/fly-line-layer/style/index.js.map +1 -0
- package/lib/fly-line-layer/style/index.less +0 -0
- package/lib/group-layer/GroupLayer.js +134 -0
- package/lib/group-layer/GroupLayer.js.map +1 -0
- package/lib/group-layer/index.js +74 -0
- package/lib/group-layer/index.js.map +1 -0
- package/lib/group-layer/style/css.js +4 -0
- package/lib/group-layer/style/css.js.map +1 -0
- package/lib/group-layer/style/index.css +0 -0
- package/lib/group-layer/style/index.js +4 -0
- package/lib/group-layer/style/index.js.map +1 -0
- package/lib/group-layer/style/index.less +0 -0
- package/lib/heatmap-layer/HeatmapLayer.js +192 -0
- package/lib/heatmap-layer/HeatmapLayer.js.map +1 -0
- package/lib/heatmap-layer/index.js +94 -0
- package/lib/heatmap-layer/index.js.map +1 -0
- package/lib/heatmap-layer/style/css.js +4 -0
- package/lib/heatmap-layer/style/css.js.map +1 -0
- package/lib/heatmap-layer/style/index.css +0 -0
- package/lib/heatmap-layer/style/index.js +4 -0
- package/lib/heatmap-layer/style/index.js.map +1 -0
- package/lib/heatmap-layer/style/index.less +0 -0
- package/lib/high-layer/HighLayer.js +201 -0
- package/lib/high-layer/HighLayer.js.map +1 -0
- package/lib/high-layer/index.js +46 -0
- package/lib/high-layer/index.js.map +1 -0
- package/lib/high-layer/style/css.js +2 -0
- package/lib/high-layer/style/css.js.map +1 -0
- package/lib/high-layer/style/index.js +2 -0
- package/lib/high-layer/style/index.js.map +1 -0
- package/lib/image-layer/ImageLayer.js +332 -0
- package/lib/image-layer/ImageLayer.js.map +1 -0
- package/lib/image-layer/ImageTileLayer.js +334 -0
- package/lib/image-layer/ImageTileLayer.js.map +1 -0
- package/lib/image-layer/index.js +101 -0
- package/lib/image-layer/index.js.map +1 -0
- package/lib/image-layer/style/css.js +4 -0
- package/lib/image-layer/style/css.js.map +1 -0
- package/lib/image-layer/style/index.css +0 -0
- package/lib/image-layer/style/index.js +4 -0
- package/lib/image-layer/style/index.js.map +1 -0
- package/lib/image-layer/style/index.less +0 -0
- package/lib/index.js +201 -0
- package/lib/index.js.map +1 -0
- package/lib/legend/index.js +255 -0
- package/lib/legend/index.js.map +1 -0
- package/lib/legend/style/css.js +8 -0
- package/lib/legend/style/css.js.map +1 -0
- package/lib/legend/style/index.css +109 -0
- package/lib/legend/style/index.js +8 -0
- package/lib/legend/style/index.js.map +1 -0
- package/lib/legend/style/index.less +100 -0
- package/lib/map/Analysis.js +151 -0
- package/lib/map/Analysis.js.map +1 -0
- package/lib/map/Layers.js +341 -0
- package/lib/map/Layers.js.map +1 -0
- package/lib/map/Popup.js +372 -0
- package/lib/map/Popup.js.map +1 -0
- package/lib/map/ScaleDenominator.js +70 -0
- package/lib/map/ScaleDenominator.js.map +1 -0
- package/lib/map/Test.js +146 -0
- package/lib/map/Test.js.map +1 -0
- package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js +164 -0
- package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js.map +1 -0
- package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js +85 -0
- package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js.map +1 -0
- package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js +67 -0
- package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js.map +1 -0
- package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js +86 -0
- package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js.map +1 -0
- package/lib/map/getBaseLayers/index.js +48 -0
- package/lib/map/getBaseLayers/index.js.map +1 -0
- package/lib/map/index.js +823 -0
- package/lib/map/index.js.map +1 -0
- package/lib/map/style/css.js +5 -0
- package/lib/map/style/css.js.map +1 -0
- package/lib/map/style/index.css +171 -0
- package/lib/map/style/index.js +5 -0
- package/lib/map/style/index.js.map +1 -0
- package/lib/map/style/index.less +152 -0
- package/lib/map-icon/svg/index.js +82 -0
- package/lib/map-icon/svg/index.js.map +1 -0
- package/lib/map-icon/svg/tuceng.svg.js +2 -0
- package/lib/map-icon/svg/tuceng.svg.js.map +1 -0
- package/lib/marker/Marker.js +108 -0
- package/lib/marker/Marker.js.map +1 -0
- package/lib/marker/index.js +62 -0
- package/lib/marker/index.js.map +1 -0
- package/lib/marker/style/css.js +2 -0
- package/lib/marker/style/css.js.map +1 -0
- package/lib/marker/style/index.js +2 -0
- package/lib/marker/style/index.js.map +1 -0
- package/lib/path-line-layer/PathLineLayer.js +47 -0
- package/lib/path-line-layer/PathLineLayer.js.map +1 -0
- package/lib/path-line-layer/getPathLineStyles.js +72 -0
- package/lib/path-line-layer/getPathLineStyles.js.map +1 -0
- package/lib/path-line-layer/index.js +152 -0
- package/lib/path-line-layer/index.js.map +1 -0
- package/lib/path-line-layer/style/css.js +4 -0
- package/lib/path-line-layer/style/css.js.map +1 -0
- package/lib/path-line-layer/style/index.css +0 -0
- package/lib/path-line-layer/style/index.js +4 -0
- package/lib/path-line-layer/style/index.js.map +1 -0
- package/lib/path-line-layer/style/index.less +0 -0
- package/lib/path-play-back/PathPlayBack.js +677 -0
- package/lib/path-play-back/PathPlayBack.js.map +1 -0
- package/lib/path-play-back/index.js +76 -0
- package/lib/path-play-back/index.js.map +1 -0
- package/lib/path-play-back/style/css.js +2 -0
- package/lib/path-play-back/style/css.js.map +1 -0
- package/lib/path-play-back/style/index.js +2 -0
- package/lib/path-play-back/style/index.js.map +1 -0
- package/lib/poi-search/Location.js +63 -0
- package/lib/poi-search/Location.js.map +1 -0
- package/lib/poi-search/PoiList.js +116 -0
- package/lib/poi-search/PoiList.js.map +1 -0
- package/lib/poi-search/Search.js +208 -0
- package/lib/poi-search/Search.js.map +1 -0
- package/lib/poi-search/index.js +174 -0
- package/lib/poi-search/index.js.map +1 -0
- package/lib/poi-search/style/css.js +8 -0
- package/lib/poi-search/style/css.js.map +1 -0
- package/lib/poi-search/style/index.css +96 -0
- package/lib/poi-search/style/index.js +8 -0
- package/lib/poi-search/style/index.js.map +1 -0
- package/lib/poi-search/style/index.less +97 -0
- package/lib/point/Point.js +59 -0
- package/lib/point/Point.js.map +1 -0
- package/lib/point/index.js +62 -0
- package/lib/point/index.js.map +1 -0
- package/lib/point/style/css.js +2 -0
- package/lib/point/style/css.js.map +1 -0
- package/lib/point/style/index.js +2 -0
- package/lib/point/style/index.js.map +1 -0
- package/lib/polygon/Polygon.js +53 -0
- package/lib/polygon/Polygon.js.map +1 -0
- package/lib/polygon/index.js +62 -0
- package/lib/polygon/index.js.map +1 -0
- package/lib/polygon/style/css.js +2 -0
- package/lib/polygon/style/css.js.map +1 -0
- package/lib/polygon/style/index.js +2 -0
- package/lib/polygon/style/index.js.map +1 -0
- package/lib/polyline/Polyline.js +53 -0
- package/lib/polyline/Polyline.js.map +1 -0
- package/lib/polyline/index.js +62 -0
- package/lib/polyline/index.js.map +1 -0
- package/lib/polyline/style/css.js +2 -0
- package/lib/polyline/style/css.js.map +1 -0
- package/lib/polyline/style/index.js +2 -0
- package/lib/polyline/style/index.js.map +1 -0
- package/lib/popup/index.js +204 -0
- package/lib/popup/index.js.map +1 -0
- package/lib/popup/style/css.js +4 -0
- package/lib/popup/style/css.js.map +1 -0
- package/lib/popup/style/index.css +131 -0
- package/lib/popup/style/index.js +4 -0
- package/lib/popup/style/index.js.map +1 -0
- package/lib/popup/style/index.less +129 -0
- package/lib/provider/index.js +14 -0
- package/lib/provider/index.js.map +1 -0
- package/lib/provider/style/css.js +2 -0
- package/lib/provider/style/css.js.map +1 -0
- package/lib/provider/style/index.js +2 -0
- package/lib/provider/style/index.js.map +1 -0
- package/lib/renderer/Fill.js +39 -0
- package/lib/renderer/Fill.js.map +1 -0
- package/lib/renderer/Stroke.js +41 -0
- package/lib/renderer/Stroke.js.map +1 -0
- package/lib/renderer/index.js +140 -0
- package/lib/renderer/index.js.map +1 -0
- package/lib/renderer/style/css.js +4 -0
- package/lib/renderer/style/css.js.map +1 -0
- package/lib/renderer/style/index.css +0 -0
- package/lib/renderer/style/index.js +4 -0
- package/lib/renderer/style/index.js.map +1 -0
- package/lib/renderer/style/index.less +0 -0
- package/lib/renderer/transformRgb.js +34 -0
- package/lib/renderer/transformRgb.js.map +1 -0
- package/lib/search-map/VtxModal.js +205 -0
- package/lib/search-map/VtxModal.js.map +1 -0
- package/lib/search-map/index.js +418 -0
- package/lib/search-map/index.js.map +1 -0
- package/lib/search-map/style/css.js +6 -0
- package/lib/search-map/style/css.js.map +1 -0
- package/lib/search-map/style/index.css +73 -0
- package/lib/search-map/style/index.js +6 -0
- package/lib/search-map/style/index.js.map +1 -0
- package/lib/search-map/style/index.less +83 -0
- package/lib/search-map/style/modal.css +54 -0
- package/lib/search-map/style/modal.less +58 -0
- package/lib/style/index.css +0 -0
- package/lib/style/index.less +2 -0
- package/lib/style/themes/compact.css +0 -0
- package/lib/style/themes/compact.less +1 -0
- package/lib/style/themes/dark.css +0 -0
- package/lib/style/themes/dark.less +9 -0
- package/lib/style/themes/default.css +0 -0
- package/lib/style/themes/default.less +7 -0
- package/lib/style/themes/index.css +0 -0
- package/lib/style/themes/index.less +1 -0
- package/lib/style/themes/variable.css +0 -0
- package/lib/style/themes/variable.less +5 -0
- package/lib/tile-layer/TileLayer.js +88 -0
- package/lib/tile-layer/TileLayer.js.map +1 -0
- package/lib/tile-layer/index.js +53 -0
- package/lib/tile-layer/index.js.map +1 -0
- package/lib/tile-layer/style/css.js +4 -0
- package/lib/tile-layer/style/css.js.map +1 -0
- package/lib/tile-layer/style/index.css +0 -0
- package/lib/tile-layer/style/index.js +4 -0
- package/lib/tile-layer/style/index.js.map +1 -0
- package/lib/tile-layer/style/index.less +0 -0
- package/lib/tools/Layer/LayerService.js +183 -0
- package/lib/tools/Layer/LayerService.js.map +1 -0
- package/lib/tools/Layer/LayersCheckService.js +195 -0
- package/lib/tools/Layer/LayersCheckService.js.map +1 -0
- package/lib/tools/Layer/index.css +50 -0
- package/lib/tools/Layer/index.js +226 -0
- package/lib/tools/Layer/index.js.map +1 -0
- package/lib/tools/Layer/index.less +43 -0
- package/lib/tools/Search/index.js +298 -0
- package/lib/tools/Search/index.js.map +1 -0
- package/lib/tools/Toolbox/BoxSelect/index.js +20 -0
- package/lib/tools/Toolbox/BoxSelect/index.js.map +1 -0
- package/lib/tools/Toolbox/CircleSelect/index.js +20 -0
- package/lib/tools/Toolbox/CircleSelect/index.js.map +1 -0
- package/lib/tools/Toolbox/EagleEye/index.js +57 -0
- package/lib/tools/Toolbox/EagleEye/index.js.map +1 -0
- package/lib/tools/Toolbox/MapBookmark/Bookmark.js +153 -0
- package/lib/tools/Toolbox/MapBookmark/Bookmark.js.map +1 -0
- package/lib/tools/Toolbox/MapBookmark/index.css +18 -0
- package/lib/tools/Toolbox/MapBookmark/index.js +430 -0
- package/lib/tools/Toolbox/MapBookmark/index.js.map +1 -0
- package/lib/tools/Toolbox/MapBookmark/index.less +20 -0
- package/lib/tools/Toolbox/MapDownload/index.js +16 -0
- package/lib/tools/Toolbox/MapDownload/index.js.map +1 -0
- package/lib/tools/Toolbox/MapPrint/index.css +4 -0
- package/lib/tools/Toolbox/MapPrint/index.js +234 -0
- package/lib/tools/Toolbox/MapPrint/index.js.map +1 -0
- package/lib/tools/Toolbox/MapPrint/index.less +4 -0
- package/lib/tools/Toolbox/Measure/Area/index.js +17 -0
- package/lib/tools/Toolbox/Measure/Area/index.js.map +1 -0
- package/lib/tools/Toolbox/Measure/Distance/index.js +17 -0
- package/lib/tools/Toolbox/Measure/Distance/index.js.map +1 -0
- package/lib/tools/Toolbox/Measure/Measure.js +229 -0
- package/lib/tools/Toolbox/Measure/Measure.js.map +1 -0
- package/lib/tools/Toolbox/Measure/index.js +77 -0
- package/lib/tools/Toolbox/Measure/index.js.map +1 -0
- package/lib/tools/Toolbox/PolygonSelect/index.js +20 -0
- package/lib/tools/Toolbox/PolygonSelect/index.js.map +1 -0
- package/lib/tools/Toolbox/ScaleLine/index.js +59 -0
- package/lib/tools/Toolbox/ScaleLine/index.js.map +1 -0
- package/lib/tools/Toolbox/SelectTools/index.css +103 -0
- package/lib/tools/Toolbox/SelectTools/index.js +779 -0
- package/lib/tools/Toolbox/SelectTools/index.js.map +1 -0
- package/lib/tools/Toolbox/SelectTools/index.less +87 -0
- package/lib/tools/Toolbox/SpaceQuery/index.css +19 -0
- package/lib/tools/Toolbox/SpaceQuery/index.js +593 -0
- package/lib/tools/Toolbox/SpaceQuery/index.js.map +1 -0
- package/lib/tools/Toolbox/SpaceQuery/index.less +16 -0
- package/lib/tools/Toolbox/ZoomInput/index.css +6 -0
- package/lib/tools/Toolbox/ZoomInput/index.js +50 -0
- package/lib/tools/Toolbox/ZoomInput/index.js.map +1 -0
- package/lib/tools/Toolbox/ZoomInput/index.less +6 -0
- package/lib/tools/Toolbox/index.css +0 -0
- package/lib/tools/Toolbox/index.js +172 -0
- package/lib/tools/Toolbox/index.js.map +1 -0
- package/lib/tools/Toolbox/index.less +2 -0
- package/lib/tools/Utils/CreateOverlay.js +47 -0
- package/lib/tools/Utils/CreateOverlay.js.map +1 -0
- package/lib/tools/Utils/Draw.js +130 -0
- package/lib/tools/Utils/Draw.js.map +1 -0
- package/lib/tools/Utils/HighLayer.js +213 -0
- package/lib/tools/Utils/HighLayer.js.map +1 -0
- package/lib/tools/Utils/measure.js +247 -0
- package/lib/tools/Utils/measure.js.map +1 -0
- package/lib/tools/Utils/utils.js +272 -0
- package/lib/tools/Utils/utils.js.map +1 -0
- package/lib/tools/View/index.css +35 -0
- package/lib/tools/View/index.js +166 -0
- package/lib/tools/View/index.js.map +1 -0
- package/lib/tools/View/index.less +28 -0
- package/lib/tools/analysis-tool/index.js +113 -0
- package/lib/tools/analysis-tool/index.js.map +1 -0
- package/lib/tools/base-map-switch/index.js +150 -0
- package/lib/tools/base-map-switch/index.js.map +1 -0
- package/lib/tools/components/Chart/index.js +828 -0
- package/lib/tools/components/Chart/index.js.map +1 -0
- package/lib/tools/components/Icon/index.js +32 -0
- package/lib/tools/components/Icon/index.js.map +1 -0
- package/lib/tools/components/Info/index.css +39 -0
- package/lib/tools/components/Info/index.js +35 -0
- package/lib/tools/components/Info/index.js.map +1 -0
- package/lib/tools/components/Info/index.less +26 -0
- package/lib/tools/components/ItemWrap/index.css +43 -0
- package/lib/tools/components/ItemWrap/index.js +48 -0
- package/lib/tools/components/ItemWrap/index.js.map +1 -0
- package/lib/tools/components/ItemWrap/index.less +41 -0
- package/lib/tools/components/Modal/index.css +42 -0
- package/lib/tools/components/Modal/index.js +46 -0
- package/lib/tools/components/Modal/index.js.map +1 -0
- package/lib/tools/components/Modal/index.less +33 -0
- package/lib/tools/components/MyTabs/index.js +22 -0
- package/lib/tools/components/MyTabs/index.js.map +1 -0
- package/lib/tools/components/RequiredLabel/index.css +5 -0
- package/lib/tools/components/RequiredLabel/index.js +32 -0
- package/lib/tools/components/RequiredLabel/index.js.map +1 -0
- package/lib/tools/components/RequiredLabel/index.less +5 -0
- package/lib/tools/components/Select/index.js +33 -0
- package/lib/tools/components/Select/index.js.map +1 -0
- package/lib/tools/components/Table/assets/tableIcon.png +0 -0
- package/lib/tools/components/Table/index.css +10 -0
- package/lib/tools/components/Table/index.js +91 -0
- package/lib/tools/components/Table/index.js.map +1 -0
- package/lib/tools/components/Table/index.less +13 -0
- package/lib/tools/components/ToolItem/index.css +30 -0
- package/lib/tools/components/ToolItem/index.js +29 -0
- package/lib/tools/components/ToolItem/index.js.map +1 -0
- package/lib/tools/components/ToolItem/index.less +27 -0
- package/lib/tools/components/ToolsSelect/index.css +15 -0
- package/lib/tools/components/ToolsSelect/index.js +45 -0
- package/lib/tools/components/ToolsSelect/index.js.map +1 -0
- package/lib/tools/components/ToolsSelect/index.less +10 -0
- package/lib/tools/full-screen/index.js +47 -0
- package/lib/tools/full-screen/index.js.map +1 -0
- package/lib/tools/index.js +151 -0
- package/lib/tools/index.js.map +1 -0
- package/lib/tools/layer-control/index.js +173 -0
- package/lib/tools/layer-control/index.js.map +1 -0
- package/lib/tools/refresh/index.js +41 -0
- package/lib/tools/refresh/index.js.map +1 -0
- package/lib/tools/style/css.js +22 -0
- package/lib/tools/style/css.js.map +1 -0
- package/lib/tools/style/index.css +136 -0
- package/lib/tools/style/index.js +22 -0
- package/lib/tools/style/index.js.map +1 -0
- package/lib/tools/style/index.less +154 -0
- package/lib/tools-item/index.js +67 -0
- package/lib/tools-item/index.js.map +1 -0
- package/lib/use-props/index.js +15 -0
- package/lib/use-props/index.js.map +1 -0
- package/lib/use-props/style/css.js +2 -0
- package/lib/use-props/style/css.js.map +1 -0
- package/lib/use-props/style/index.js +2 -0
- package/lib/use-props/style/index.js.map +1 -0
- package/lib/wms-layer/WmsLayer.js +315 -0
- package/lib/wms-layer/WmsLayer.js.map +1 -0
- package/lib/wms-layer/index.js +98 -0
- package/lib/wms-layer/index.js.map +1 -0
- package/lib/wms-layer/style/css.js +4 -0
- package/lib/wms-layer/style/css.js.map +1 -0
- package/lib/wms-layer/style/index.css +0 -0
- package/lib/wms-layer/style/index.js +4 -0
- package/lib/wms-layer/style/index.js.map +1 -0
- package/lib/wms-layer/style/index.less +0 -0
- package/package.json +1 -1
package/lib/map/index.js
ADDED
|
@@ -0,0 +1,823 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
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(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
41
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
42
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
44
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _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(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
47
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
48
|
+
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; }
|
|
49
|
+
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; }
|
|
50
|
+
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; }
|
|
51
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
52
|
+
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); }
|
|
53
|
+
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; }
|
|
54
|
+
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; }
|
|
55
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
56
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
57
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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(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); }
|
|
60
|
+
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; }
|
|
61
|
+
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; } }
|
|
62
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
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
|
+
// 视野高度
|
|
93
|
+
var _useState3 = (0, _react.useState)(null),
|
|
94
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
95
|
+
setModal = _useState4[1];
|
|
96
|
+
var _useState5 = (0, _react.useState)(false),
|
|
97
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
98
|
+
tipVis = _useState6[0],
|
|
99
|
+
setTipVis = _useState6[1];
|
|
100
|
+
var _useState7 = (0, _react.useState)(null),
|
|
101
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
102
|
+
tip = _useState8[0],
|
|
103
|
+
setTip = _useState8[1];
|
|
104
|
+
var _useState9 = (0, _react.useState)(null),
|
|
105
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
106
|
+
pointTip = _useState10[0],
|
|
107
|
+
setPointTip = _useState10[1];
|
|
108
|
+
var mapRef = (0, _react.useRef)(null);
|
|
109
|
+
var timerRef = (0, _react.useRef)(null);
|
|
110
|
+
var mapDomRef = (0, _react.useRef)(null);
|
|
111
|
+
var highLayerRef = (0, _react.useRef)();
|
|
112
|
+
var popupRef = (0, _react.useRef)();
|
|
113
|
+
var timeRef = (0, _react.useRef)(null);
|
|
114
|
+
var baseLayerRef = (0, _react.useRef)([]);
|
|
115
|
+
(0, _react.useEffect)(function () {
|
|
116
|
+
initMap();
|
|
117
|
+
return function () {
|
|
118
|
+
window.removeEventListener('resize', handleResize);
|
|
119
|
+
highLayerRef.current && highLayerRef.current.destroy();
|
|
120
|
+
};
|
|
121
|
+
}, []);
|
|
122
|
+
(0, _react.useEffect)(function () {
|
|
123
|
+
if (mapRef.current) {
|
|
124
|
+
timerRef.current = setInterval(function () {
|
|
125
|
+
var layers = mapRef.current.getLayers().getArray() || [];
|
|
126
|
+
layers.map(function (v) {
|
|
127
|
+
if (v.autoRefresh && v.key && v.get('visible') && v.refresh) {
|
|
128
|
+
v.refresh();
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}, 10000);
|
|
132
|
+
}
|
|
133
|
+
return function () {
|
|
134
|
+
if (timerRef.current) {
|
|
135
|
+
clearInterval(timerRef.current);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}, []);
|
|
139
|
+
(0, _ahooks.useUpdateEffect)(function () {
|
|
140
|
+
mapRef.current.setMapStyle(mapStyle);
|
|
141
|
+
}, [mapStyle]);
|
|
142
|
+
var initMap = /*#__PURE__*/function () {
|
|
143
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
144
|
+
var _baseLayerRef$current;
|
|
145
|
+
var defaultMapInfo, minZoom, maxZoom, defaultZoomLevel, longitude, latitude, otherDefaultMapInfo, viewDefault, map, baseLayerParams, _baseLayerRef$current2, view, registerMapEvent, registerEvent, hoverFeature;
|
|
146
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
147
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
148
|
+
case 0:
|
|
149
|
+
registerEvent = function _registerEvent(eventTarget, feature, event) {
|
|
150
|
+
if (feature) {
|
|
151
|
+
var _feature$eventTarget;
|
|
152
|
+
var properties = feature.getProperties();
|
|
153
|
+
|
|
154
|
+
// 触发自身事件
|
|
155
|
+
(_feature$eventTarget = feature[eventTarget]) === null || _feature$eventTarget === void 0 ? void 0 : _feature$eventTarget.call(feature, properties, event);
|
|
156
|
+
var layer = map.getLayerByFeature(feature);
|
|
157
|
+
if (layer !== null && layer !== void 0 && layer[eventTarget]) {
|
|
158
|
+
layer[eventTarget](properties, event);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
registerMapEvent = function _registerMapEvent(eventTarget, e) {
|
|
163
|
+
if (map[eventTarget]) {
|
|
164
|
+
map[eventTarget](e);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
defaultMapInfo = (0, _getDefaultMapInfo["default"])();
|
|
168
|
+
minZoom = defaultMapInfo.minZoom, maxZoom = defaultMapInfo.maxZoom, defaultZoomLevel = defaultMapInfo.defaultZoomLevel, longitude = defaultMapInfo.longitude, latitude = defaultMapInfo.latitude, otherDefaultMapInfo = _objectWithoutProperties(defaultMapInfo, _excluded); // 全屏
|
|
169
|
+
viewDefault = {
|
|
170
|
+
center: center || longitude && latitude && [longitude, latitude] || [116.397228, 30.9096],
|
|
171
|
+
zoom: zoom || defaultZoomLevel && Number(defaultZoomLevel) || 4,
|
|
172
|
+
minZoom: minZoom && Number(minZoom) || props.minZoom || 4,
|
|
173
|
+
maxZoom: maxZoom && Number(maxZoom) || props.maxZoom
|
|
174
|
+
};
|
|
175
|
+
map = new _ol.Map({
|
|
176
|
+
target: mapDomRef.current,
|
|
177
|
+
controls: (0, _control.defaults)({
|
|
178
|
+
zoom: false
|
|
179
|
+
}).extend([]),
|
|
180
|
+
// layers: [...getBaseLayers({ mapStyle, dark, tk, baseMapStyle })],
|
|
181
|
+
pixelRatio: 1,
|
|
182
|
+
view: new _ol.View(_objectSpread(_objectSpread({}, viewDefault), {}, {
|
|
183
|
+
projection: 'EPSG:4326',
|
|
184
|
+
constrainResolution: true
|
|
185
|
+
})),
|
|
186
|
+
// 设置缩放级别为整数
|
|
187
|
+
constrainResolution: true,
|
|
188
|
+
// 关闭无级缩放地图
|
|
189
|
+
smoothResolutionConstraint: false
|
|
190
|
+
}); // 统一加密啊配置
|
|
191
|
+
map.encrypt = encrypt;
|
|
192
|
+
baseLayerParams = _objectSpread(_objectSpread({}, otherDefaultMapInfo), {}, {
|
|
193
|
+
mapStyle: mapStyle || defaultMapInfo.mapStyle || 'vec',
|
|
194
|
+
baseMapStyle: baseMapStyle || defaultMapInfo.baseMapStyle || 'TdtImageryProvider',
|
|
195
|
+
dark: dark || defaultMapInfo.dark,
|
|
196
|
+
tk: tk || defaultMapInfo.tk
|
|
197
|
+
});
|
|
198
|
+
if (customBaseLayers) {
|
|
199
|
+
baseLayerRef.current = _toConsumableArray(customBaseLayers(baseLayerParams));
|
|
200
|
+
} else {
|
|
201
|
+
baseLayerRef.current = _toConsumableArray((0, _getBaseLayers["default"])(baseLayerParams));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// 用于鹰眼图层
|
|
205
|
+
map.baseLayer = (0, _lodash.cloneDeep)(baseLayerRef.current);
|
|
206
|
+
if ((_baseLayerRef$current = baseLayerRef.current) !== null && _baseLayerRef$current !== void 0 && _baseLayerRef$current.length) {
|
|
207
|
+
(_baseLayerRef$current2 = baseLayerRef.current) === null || _baseLayerRef$current2 === void 0 ? void 0 : _baseLayerRef$current2.map(function (item) {
|
|
208
|
+
map.addLayer(item);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
map.tk = tk;
|
|
212
|
+
|
|
213
|
+
// 隐藏表格弹出框
|
|
214
|
+
map.hidePopupTable = hidePopupTable;
|
|
215
|
+
|
|
216
|
+
// 自动调整视角
|
|
217
|
+
map.autoView = autoView;
|
|
218
|
+
|
|
219
|
+
// 关闭气泡自动调整视角
|
|
220
|
+
map.closePopupAutoView = closePopupAutoView;
|
|
221
|
+
|
|
222
|
+
// 图层管理
|
|
223
|
+
map.layers = new _Layers["default"]({
|
|
224
|
+
map: map
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// 分析管理
|
|
228
|
+
map.analysis = new _Analysis["default"]({
|
|
229
|
+
map: map
|
|
230
|
+
});
|
|
231
|
+
mapRef.current = map;
|
|
232
|
+
|
|
233
|
+
// 地图视角默认配置
|
|
234
|
+
map.viewDefault = viewDefault;
|
|
235
|
+
|
|
236
|
+
// 设置地图底图样式
|
|
237
|
+
map.setMapStyle = function (_mapStyle) {
|
|
238
|
+
var _map$getLayerByKey, _map$getLayerByKey2;
|
|
239
|
+
var _TdtImageryProvider$g = _TdtImageryProvider["default"].getSource({
|
|
240
|
+
mapStyle: _mapStyle,
|
|
241
|
+
tk: tk
|
|
242
|
+
}),
|
|
243
|
+
_TdtImageryProvider$g2 = _slicedToArray(_TdtImageryProvider$g, 2),
|
|
244
|
+
tileLayerSource = _TdtImageryProvider$g2[0],
|
|
245
|
+
markLayerSource = _TdtImageryProvider$g2[1];
|
|
246
|
+
(_map$getLayerByKey = map.getLayerByKey('__TDT_TILE')) === null || _map$getLayerByKey === void 0 ? void 0 : _map$getLayerByKey.setSource(tileLayerSource);
|
|
247
|
+
(_map$getLayerByKey2 = map.getLayerByKey('__TDT_MARK')) === null || _map$getLayerByKey2 === void 0 ? void 0 : _map$getLayerByKey2.setSource(markLayerSource);
|
|
248
|
+
};
|
|
249
|
+
view = map.getView(); // 高亮效果
|
|
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 ? 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 ? 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 ? 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 (_x2, _x3, _x4, _x5) {
|
|
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 ? void 0 : (_popupRef$current$sho = _popupRef$current.showTemplate) === null || _popupRef$current$sho === void 0 ? 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 ? void 0 : (_popupRef$current2$hi = _popupRef$current2.hideTemplate) === null || _popupRef$current2$hi === void 0 ? 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 ? void 0 : (_popupRef$current3$se = _popupRef$current3.setLastView) === null || _popupRef$current3$se === void 0 ? 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, _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 (_x6) {
|
|
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 62:
|
|
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 = Map;
|
|
807
|
+
exports["default"] = _default;
|
|
808
|
+
Map.propTypes = {
|
|
809
|
+
width: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
810
|
+
height: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
811
|
+
createdMap: _propTypes["default"].func,
|
|
812
|
+
center: _propTypes["default"].array,
|
|
813
|
+
zoom: _propTypes["default"].number,
|
|
814
|
+
minZoom: _propTypes["default"].number,
|
|
815
|
+
maxZoom: _propTypes["default"].number,
|
|
816
|
+
dark: _propTypes["default"].bool,
|
|
817
|
+
mapStyle: _propTypes["default"].oneOfType(['vec', 'img']),
|
|
818
|
+
tk: _propTypes["default"].string.isRequired,
|
|
819
|
+
style: _propTypes["default"].object,
|
|
820
|
+
baseMapStyle: _propTypes["default"].object,
|
|
821
|
+
encrypt: _propTypes["default"].bool
|
|
822
|
+
};
|
|
823
|
+
//# sourceMappingURL=index.js.map
|