@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
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
.ol-tools-legend {
|
|
2
|
+
position: absolute;
|
|
3
|
+
bottom: 10px;
|
|
4
|
+
left: 10px;
|
|
5
|
+
|
|
6
|
+
padding: 6px 10px;
|
|
7
|
+
|
|
8
|
+
background: #fff;
|
|
9
|
+
border-radius: 8px;
|
|
10
|
+
|
|
11
|
+
user-select: none;
|
|
12
|
+
|
|
13
|
+
width: max-content;
|
|
14
|
+
|
|
15
|
+
.ol-tools-legend-title {
|
|
16
|
+
font-size: 16px;
|
|
17
|
+
letter-spacing: 2px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ol-tools-legend-content {
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ol-tools-legend-list-wrap {
|
|
25
|
+
min-width: 60px;
|
|
26
|
+
display: none;
|
|
27
|
+
.ol-tools-legend-list-column {
|
|
28
|
+
display: flex;
|
|
29
|
+
}
|
|
30
|
+
.ol-tools-legend-list {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
max-width: none;
|
|
34
|
+
max-height: none;
|
|
35
|
+
overflow-y: auto;
|
|
36
|
+
|
|
37
|
+
.ol-tools-legend-item {
|
|
38
|
+
text-align: center;
|
|
39
|
+
padding: 4px;
|
|
40
|
+
min-width: 50px;
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
|
|
44
|
+
.ol-tools-legend-item-img {
|
|
45
|
+
max-height: 28px;
|
|
46
|
+
margin-right: 5px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ol-tools-legend-item-title {
|
|
50
|
+
font-size: 12px;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:hover {
|
|
57
|
+
.ol-tools-legend-list-wrap {
|
|
58
|
+
display: block;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ol-tools-legend-list {
|
|
63
|
+
max-width: 270px;
|
|
64
|
+
max-height: 270px;
|
|
65
|
+
overflow-y: scroll;
|
|
66
|
+
|
|
67
|
+
.ol-tools-legend-item {
|
|
68
|
+
text-align: center;
|
|
69
|
+
padding: 4px;
|
|
70
|
+
min-width: 50px;
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
.ol-tools-legend-item-img-wrap {
|
|
74
|
+
margin-right: 5px;
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
width: 32px;
|
|
79
|
+
height: 32px;
|
|
80
|
+
}
|
|
81
|
+
.ol-tools-legend-item-img {
|
|
82
|
+
max-width: 32px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ol-tools-legend-item-title {
|
|
86
|
+
font-size: 14px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ol-tools-legend-close-btn {
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 10px;
|
|
95
|
+
right: 10px;
|
|
96
|
+
z-index: 999;
|
|
97
|
+
font-size: 18px;
|
|
98
|
+
font-weight: bold;
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
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 _EventEmitter2 = _interopRequireDefault(require("../_util/EventEmitter"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
+
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); }
|
|
15
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
17
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
19
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
+
var Analysis = /*#__PURE__*/function (_EventEmitter) {
|
|
23
|
+
_inherits(Analysis, _EventEmitter);
|
|
24
|
+
var _super = _createSuper(Analysis);
|
|
25
|
+
function Analysis(options) {
|
|
26
|
+
var _this;
|
|
27
|
+
_classCallCheck(this, Analysis);
|
|
28
|
+
_this = _super.call(this);
|
|
29
|
+
_this.map = options.map;
|
|
30
|
+
_this.analysis = [];
|
|
31
|
+
_this.activeKey = null;
|
|
32
|
+
_this.map.addAnalysis = function (analysis, group) {
|
|
33
|
+
_this.addAnalysis(analysis, group);
|
|
34
|
+
};
|
|
35
|
+
_this.map.removeAnalysis = function (analysis, group) {
|
|
36
|
+
_this.removeAnalysis(analysis, group);
|
|
37
|
+
};
|
|
38
|
+
_this.map.clearAnalysis = function () {
|
|
39
|
+
_this.clearAnalysis();
|
|
40
|
+
};
|
|
41
|
+
_this.map.getAnalysis = function () {
|
|
42
|
+
return _this.getAnalysis();
|
|
43
|
+
};
|
|
44
|
+
_this.map.setAnalysisActiveKey = function (key) {
|
|
45
|
+
_this.setActiveKey(key);
|
|
46
|
+
};
|
|
47
|
+
_this.map.getAnalysisActiveKey = function () {
|
|
48
|
+
return _this.getActiveKey();
|
|
49
|
+
};
|
|
50
|
+
return _this;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 图层改变的时候
|
|
54
|
+
_createClass(Analysis, [{
|
|
55
|
+
key: "onChange",
|
|
56
|
+
value: function onChange() {
|
|
57
|
+
this.emit('change', this.analysis);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// 图层改变的时候
|
|
61
|
+
}, {
|
|
62
|
+
key: "onActiveChange",
|
|
63
|
+
value: function onActiveChange() {
|
|
64
|
+
this.emit('activeChange', this.activeKey);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 添加分析
|
|
68
|
+
}, {
|
|
69
|
+
key: "addAnalysis",
|
|
70
|
+
value: function addAnalysis(analysis, group) {
|
|
71
|
+
if (analysis.name) {
|
|
72
|
+
if (group) {
|
|
73
|
+
var loop = function loop(data) {
|
|
74
|
+
data.map(function (d) {
|
|
75
|
+
var _d$analysis;
|
|
76
|
+
if (d.key === group.key) {
|
|
77
|
+
d.analysis.push(analysis);
|
|
78
|
+
}
|
|
79
|
+
if ((_d$analysis = d.analysis) !== null && _d$analysis !== void 0 && _d$analysis.length) {
|
|
80
|
+
loop(d.analysis);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
loop(this.analysis);
|
|
85
|
+
} else {
|
|
86
|
+
this.analysis.push(analysis);
|
|
87
|
+
}
|
|
88
|
+
this.onChange();
|
|
89
|
+
this.emit('add', analysis);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 移除分析
|
|
94
|
+
}, {
|
|
95
|
+
key: "removeAnalysis",
|
|
96
|
+
value: function removeAnalysis(analysis, group) {
|
|
97
|
+
if (analysis.name) {
|
|
98
|
+
this.analysis = this.analysis.filter(function (v) {
|
|
99
|
+
return v.key !== analysis.key;
|
|
100
|
+
});
|
|
101
|
+
if (group) {
|
|
102
|
+
var loop = function loop(data) {
|
|
103
|
+
data.map(function (d) {
|
|
104
|
+
var _d$analysis2;
|
|
105
|
+
if (d.key === group.key) {
|
|
106
|
+
d.analysis = d.analysis.filter(function (v) {
|
|
107
|
+
return v.key !== analysis.key;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
if ((_d$analysis2 = d.analysis) !== null && _d$analysis2 !== void 0 && _d$analysis2.length) {
|
|
111
|
+
loop(d.analysis);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
loop(this.analysis);
|
|
116
|
+
}
|
|
117
|
+
this.emit('remove', analysis);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// 获取分析
|
|
122
|
+
}, {
|
|
123
|
+
key: "getAnalysis",
|
|
124
|
+
value: function getAnalysis() {
|
|
125
|
+
return this.analysis;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// 清空分析
|
|
129
|
+
}, {
|
|
130
|
+
key: "clearAnalysis",
|
|
131
|
+
value: function clearAnalysis() {
|
|
132
|
+
this.analysis = [];
|
|
133
|
+
this.emit('clear');
|
|
134
|
+
this.onChange();
|
|
135
|
+
}
|
|
136
|
+
}, {
|
|
137
|
+
key: "setActiveKey",
|
|
138
|
+
value: function setActiveKey(key) {
|
|
139
|
+
this.activeKey = key;
|
|
140
|
+
this.onActiveChange();
|
|
141
|
+
}
|
|
142
|
+
}, {
|
|
143
|
+
key: "getActiveKey",
|
|
144
|
+
value: function getActiveKey() {
|
|
145
|
+
return this.activeKey;
|
|
146
|
+
}
|
|
147
|
+
}]);
|
|
148
|
+
return Analysis;
|
|
149
|
+
}(_EventEmitter2["default"]);
|
|
150
|
+
exports["default"] = Analysis;
|
|
151
|
+
//# sourceMappingURL=Analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Analysis.js","names":["_EventEmitter2","_interopRequireDefault","require","obj","__esModule","_classCallCheck","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","_createClass","protoProps","staticProps","prototype","arg","_toPrimitive","_typeof","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","Number","_inherits","subClass","superClass","create","constructor","value","_setPrototypeOf","o","p","setPrototypeOf","bind","__proto__","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf","result","NewTarget","Reflect","construct","arguments","apply","_possibleConstructorReturn","self","_assertThisInitialized","ReferenceError","sham","Proxy","Boolean","valueOf","e","getPrototypeOf","Analysis","_EventEmitter","_super","options","_this","map","analysis","activeKey","addAnalysis","group","removeAnalysis","clearAnalysis","getAnalysis","setAnalysisActiveKey","setActiveKey","getAnalysisActiveKey","getActiveKey","onChange","emit","onActiveChange","name","loop","data","d","_d$analysis","push","filter","v","_d$analysis2","EventEmitter","exports"],"sources":["map/Analysis.js"],"sourcesContent":["import EventEmitter from '../_util/EventEmitter';\n\nexport default class Analysis extends EventEmitter {\n constructor(options) {\n super();\n\n this.map = options.map;\n\n this.analysis = [];\n\n this.activeKey = null;\n\n this.map.addAnalysis = (analysis, group) => {\n this.addAnalysis(analysis, group);\n };\n\n this.map.removeAnalysis = (analysis, group) => {\n this.removeAnalysis(analysis, group);\n };\n\n this.map.clearAnalysis = () => {\n this.clearAnalysis();\n };\n\n this.map.getAnalysis = () => {\n return this.getAnalysis();\n };\n\n this.map.setAnalysisActiveKey = key => {\n this.setActiveKey(key);\n };\n\n this.map.getAnalysisActiveKey = () => {\n return this.getActiveKey();\n };\n }\n\n // 图层改变的时候\n onChange() {\n this.emit('change', this.analysis);\n }\n\n // 图层改变的时候\n onActiveChange() {\n this.emit('activeChange', this.activeKey);\n }\n\n // 添加分析\n addAnalysis(analysis, group) {\n if (analysis.name) {\n if (group) {\n const loop = (data) => {\n data.map(d => {\n if (d.key === group.key) {\n d.analysis.push(analysis);\n }\n\n if (d.analysis?.length) {\n loop(d.analysis)\n }\n })\n }\n\n loop(this.analysis);\n } else {\n this.analysis.push(analysis);\n }\n\n this.onChange();\n this.emit('add', analysis);\n }\n }\n\n // 移除分析\n removeAnalysis(analysis, group) {\n if (analysis.name) {\n this.analysis = this.analysis.filter(v => v.key !== analysis.key);\n if (group) {\n const loop = (data) => {\n data.map(d => {\n if (d.key === group.key) {\n d.analysis = d.analysis.filter(v => v.key !== analysis.key);\n }\n\n if (d.analysis?.length) {\n loop(d.analysis)\n }\n })\n }\n\n loop(this.analysis);\n }\n\n this.emit('remove', analysis);\n }\n }\n\n // 获取分析\n getAnalysis() {\n return this.analysis;\n }\n\n // 清空分析\n clearAnalysis() {\n this.analysis = [];\n this.emit('clear');\n this.onChange();\n }\n\n setActiveKey(key) {\n this.activeKey = key;\n this.onActiveChange();\n }\n\n getActiveKey() {\n return this.activeKey;\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAiD,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,gBAAAC,QAAA,EAAAC,WAAA,UAAAD,QAAA,YAAAC,WAAA,eAAAC,SAAA;AAAA,SAAAC,kBAAAC,MAAA,EAAAC,KAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAD,KAAA,CAAAE,MAAA,EAAAD,CAAA,UAAAE,UAAA,GAAAH,KAAA,CAAAC,CAAA,GAAAE,UAAA,CAAAC,UAAA,GAAAD,UAAA,CAAAC,UAAA,WAAAD,UAAA,CAAAE,YAAA,wBAAAF,UAAA,EAAAA,UAAA,CAAAG,QAAA,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5D,GAAG;MACpB,IAAI,CAACwE,cAAc,CAAC,CAAC;IACzB;EAAC;IAAAxE,GAAA;IAAAuB,KAAA,EAED,SAAA8C,aAAA,EAAe;MACX,OAAO,IAAI,CAACT,SAAS;IACzB;EAAC;EAAA,OAAAP,QAAA;AAAA,EAlHiC6B,yBAAY;AAAAC,OAAA,cAAA9B,QAAA"}
|
|
@@ -0,0 +1,341 @@
|
|
|
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 _EventEmitter2 = _interopRequireDefault(require("../_util/EventEmitter"));
|
|
9
|
+
var _GroupLayer = _interopRequireDefault(require("../group-layer/GroupLayer"));
|
|
10
|
+
var _ImageLayer = _interopRequireDefault(require("../image-layer/ImageLayer"));
|
|
11
|
+
var _ImageTileLayer = _interopRequireDefault(require("../image-layer/ImageTileLayer"));
|
|
12
|
+
var _FeatureLayer = _interopRequireDefault(require("../feature-layer/FeatureLayer"));
|
|
13
|
+
var _WmsLayer = _interopRequireDefault(require("../wms-layer/WmsLayer"));
|
|
14
|
+
var _lodash = require("lodash");
|
|
15
|
+
var _FlowLineLayer = _interopRequireDefault(require("../flow-line-layer/FlowLineLayer"));
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
19
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
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); }
|
|
22
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
23
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
24
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
25
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
26
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
27
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
28
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
29
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
30
|
+
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."); }
|
|
31
|
+
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); }
|
|
32
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
33
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
34
|
+
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; }
|
|
35
|
+
// 获取显示或隐藏的keys
|
|
36
|
+
var getLayersVisibleKeys = function getLayersVisibleKeys(data, map) {
|
|
37
|
+
var visible = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
38
|
+
var keys = [];
|
|
39
|
+
function loop(data, map, visible) {
|
|
40
|
+
data.map(function (v) {
|
|
41
|
+
var _v$layers;
|
|
42
|
+
if (v.key) {
|
|
43
|
+
var layer = map.layers.getLayerByKey(v.key);
|
|
44
|
+
if (layer && !(layer instanceof _GroupLayer["default"])) {
|
|
45
|
+
var _layer$group;
|
|
46
|
+
if ((_layer$group = layer.group) !== null && _layer$group !== void 0 && _layer$group.length) {
|
|
47
|
+
if (visible) {
|
|
48
|
+
layer.group.map(function (f) {
|
|
49
|
+
if (!f.hasOwnProperty('show') || f.show) {
|
|
50
|
+
keys.push(f.key);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
layer.group.map(function (f) {
|
|
55
|
+
if (!f.show) {
|
|
56
|
+
keys.push(f.key);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
} else if (layer.show === visible) {
|
|
61
|
+
keys.push(v.key);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 如果group的显示的长度和layer的不一致 则不显示
|
|
65
|
+
// if (
|
|
66
|
+
// layer.show === visible &&
|
|
67
|
+
// layer.group?.filter(v => v.show)?.length == layer.group?.length
|
|
68
|
+
// ) {
|
|
69
|
+
// keys.push(v.key);
|
|
70
|
+
// }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if ((_v$layers = v.layers) !== null && _v$layers !== void 0 && _v$layers.length) {
|
|
75
|
+
loop(v.layers, map, visible);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
loop(data, map, visible);
|
|
80
|
+
return keys;
|
|
81
|
+
};
|
|
82
|
+
// 获取所有keys
|
|
83
|
+
var _getAllKeys = function getAllKeys(data) {
|
|
84
|
+
var keys = [];
|
|
85
|
+
data.map(function (v) {
|
|
86
|
+
var _v$layers2;
|
|
87
|
+
if ((_v$layers2 = v.layers) !== null && _v$layers2 !== void 0 && _v$layers2.length) {
|
|
88
|
+
keys.push.apply(keys, _toConsumableArray(_getAllKeys(v.layers)));
|
|
89
|
+
}
|
|
90
|
+
keys.push(v.key);
|
|
91
|
+
});
|
|
92
|
+
return keys;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// 获取所有keys(包含group)
|
|
96
|
+
var _getAllLayersKeys = function getAllLayersKeys(data) {
|
|
97
|
+
var keys = [];
|
|
98
|
+
data.map(function (v) {
|
|
99
|
+
var _v$layers3, _v$group;
|
|
100
|
+
if ((_v$layers3 = v.layers) !== null && _v$layers3 !== void 0 && _v$layers3.length) {
|
|
101
|
+
keys.push.apply(keys, _toConsumableArray(_getAllLayersKeys(v.layers)));
|
|
102
|
+
}
|
|
103
|
+
keys.push(v.key);
|
|
104
|
+
if (v !== null && v !== void 0 && (_v$group = v.group) !== null && _v$group !== void 0 && _v$group.length) {
|
|
105
|
+
v.group.map(function (f) {
|
|
106
|
+
if (f.key) {
|
|
107
|
+
keys.push(f.key);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return keys;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// 获取图层
|
|
116
|
+
var getLayers = function getLayers(data, layer, _keys, visible) {
|
|
117
|
+
var layers = [];
|
|
118
|
+
// 判断查询 全部的 or 隐藏的 or 显示的
|
|
119
|
+
function loop(data, layer, _keys, visible) {
|
|
120
|
+
data.map(function (v) {
|
|
121
|
+
var _v$layers4;
|
|
122
|
+
var isVisible = typeof visible !== 'boolean' ? true : v.displayName !== 'GroupLayer' ? (v === null || v === void 0 ? void 0 : v.getVisible()) === visible : false;
|
|
123
|
+
if (v.key && v instanceof layer && isVisible) {
|
|
124
|
+
if (_keys) {
|
|
125
|
+
var keys = Array.isArray(_keys) ? _keys : [_keys];
|
|
126
|
+
if (keys.includes(v.key)) {
|
|
127
|
+
layers.push(v);
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
layers.push(v);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if ((_v$layers4 = v.layers) !== null && _v$layers4 !== void 0 && _v$layers4.length) {
|
|
134
|
+
var newLayer = loop(v.layers, layer, _keys, visible);
|
|
135
|
+
if (newLayer !== null && newLayer !== void 0 && newLayer.length) {
|
|
136
|
+
layers.push(newLayer);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
loop(data, layer, _keys, visible);
|
|
142
|
+
return layers;
|
|
143
|
+
};
|
|
144
|
+
var Layers = /*#__PURE__*/function (_EventEmitter) {
|
|
145
|
+
_inherits(Layers, _EventEmitter);
|
|
146
|
+
var _super = _createSuper(Layers);
|
|
147
|
+
function Layers(options) {
|
|
148
|
+
var _this;
|
|
149
|
+
_classCallCheck(this, Layers);
|
|
150
|
+
_this = _super.call(this);
|
|
151
|
+
_this.map = options.map;
|
|
152
|
+
_this.layers = [];
|
|
153
|
+
return _this;
|
|
154
|
+
}
|
|
155
|
+
// 图层改变的时候
|
|
156
|
+
_createClass(Layers, [{
|
|
157
|
+
key: "onChange",
|
|
158
|
+
value: function onChange() {
|
|
159
|
+
this.emit('change', this.layers);
|
|
160
|
+
}
|
|
161
|
+
}, {
|
|
162
|
+
key: "addLayer",
|
|
163
|
+
value: function addLayer(layer) {
|
|
164
|
+
var map = this.map;
|
|
165
|
+
if (layer instanceof _FeatureLayer["default"] || layer instanceof _ImageTileLayer["default"] || layer instanceof _ImageLayer["default"] || layer instanceof _FlowLineLayer["default"]) {
|
|
166
|
+
map.addLayer(layer);
|
|
167
|
+
}
|
|
168
|
+
if (layer.name && layer.layerControl) {
|
|
169
|
+
this.layers.push(layer);
|
|
170
|
+
this.emit('add', layer);
|
|
171
|
+
this.onChange();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}, {
|
|
175
|
+
key: "removeLayer",
|
|
176
|
+
value: function removeLayer(layer) {
|
|
177
|
+
var map = this.map;
|
|
178
|
+
if (layer instanceof _FeatureLayer["default"] || layer instanceof _ImageTileLayer["default"] || layer instanceof _ImageLayer["default"] || layer instanceof _WmsLayer["default"]) {
|
|
179
|
+
map.removeLayer(layer);
|
|
180
|
+
}
|
|
181
|
+
if (layer.name && layer.layerControl) {
|
|
182
|
+
this.layers = this.layers.filter(function (v) {
|
|
183
|
+
return v !== layer;
|
|
184
|
+
});
|
|
185
|
+
this.emit('remove', layer);
|
|
186
|
+
this.onChange();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// 图层清空
|
|
190
|
+
}, {
|
|
191
|
+
key: "clearLayers",
|
|
192
|
+
value: function clearLayers() {
|
|
193
|
+
var _this$layers;
|
|
194
|
+
var map = this.map;
|
|
195
|
+
(_this$layers = this.layers) === null || _this$layers === void 0 ? void 0 : _this$layers.map(function (layer) {
|
|
196
|
+
if (layer instanceof _FeatureLayer["default"] || layer instanceof _ImageTileLayer["default"] || layer instanceof _ImageLayer["default"] || layer instanceof _FlowLineLayer["default"] || layer instanceof _WmsLayer["default"]) {
|
|
197
|
+
map.removeLayer(layer);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
this.layers = [];
|
|
201
|
+
this.emit('clear');
|
|
202
|
+
this.onChange();
|
|
203
|
+
}
|
|
204
|
+
}, {
|
|
205
|
+
key: "getLayerByKey",
|
|
206
|
+
value: function getLayerByKey(_keys) {
|
|
207
|
+
var _this$getAllLayers;
|
|
208
|
+
return (_this$getAllLayers = this.getAllLayers()) === null || _this$getAllLayers === void 0 ? void 0 : _this$getAllLayers.find(function (layer) {
|
|
209
|
+
return _keys && layer.key && layer.key === _keys;
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}, {
|
|
213
|
+
key: "getAllLayers",
|
|
214
|
+
value: function getAllLayers() {
|
|
215
|
+
var layers = [];
|
|
216
|
+
function loop(data) {
|
|
217
|
+
data.map(function (item) {
|
|
218
|
+
var _item$layers;
|
|
219
|
+
layers.push(item);
|
|
220
|
+
if (item !== null && item !== void 0 && (_item$layers = item.layers) !== null && _item$layers !== void 0 && _item$layers.length) {
|
|
221
|
+
loop(item.layers);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
loop(this.layers);
|
|
226
|
+
return layers;
|
|
227
|
+
}
|
|
228
|
+
// 获取 layers 里面的 key 集合
|
|
229
|
+
}, {
|
|
230
|
+
key: "getAllKeys",
|
|
231
|
+
value: function getAllKeys() {
|
|
232
|
+
return _getAllKeys(this.layers);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// 获取 layers 里面的 key 集合
|
|
236
|
+
}, {
|
|
237
|
+
key: "getAllLayersKeys",
|
|
238
|
+
value: function getAllLayersKeys() {
|
|
239
|
+
return _getAllLayersKeys(this.layers);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// 获取当前展示的 keys
|
|
243
|
+
}, {
|
|
244
|
+
key: "getShowKeys",
|
|
245
|
+
value: function getShowKeys() {
|
|
246
|
+
return getLayersVisibleKeys(this.layers, this.map, true);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// 获取当前隐藏的 keys
|
|
250
|
+
}, {
|
|
251
|
+
key: "getHiddenKeys",
|
|
252
|
+
value: function getHiddenKeys() {
|
|
253
|
+
return getLayersVisibleKeys(this.layers, this.map, false);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// 获取 ImageLayer 图层
|
|
257
|
+
}, {
|
|
258
|
+
key: "getImageLayers",
|
|
259
|
+
value: function getImageLayers(_keys, visible) {
|
|
260
|
+
var imageLayer = getLayers(this.layers, _ImageLayer["default"], _keys, visible);
|
|
261
|
+
var imageTileLayer = getLayers(this.layers, _ImageTileLayer["default"], _keys, visible);
|
|
262
|
+
return [].concat(_toConsumableArray(imageLayer), _toConsumableArray(imageTileLayer));
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// 获取 FeatureLayer 图层
|
|
266
|
+
}, {
|
|
267
|
+
key: "getFeatureLayers",
|
|
268
|
+
value: function getFeatureLayers(_keys, visible) {
|
|
269
|
+
return getLayers(this.layers, _FeatureLayer["default"], _keys, visible);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// 根据 keys 设置图层的显示,其他的隐藏
|
|
273
|
+
}, {
|
|
274
|
+
key: "setShowByKeys",
|
|
275
|
+
value: function setShowByKeys(_keys) {
|
|
276
|
+
var map = this.map;
|
|
277
|
+
var keys = Array.isArray(_keys) ? _keys : [_keys];
|
|
278
|
+
this.getAllKeys().map(function (a) {
|
|
279
|
+
var layer = map.layers.getLayerByKey(a);
|
|
280
|
+
if (layer && !(layer instanceof _GroupLayer["default"])) {
|
|
281
|
+
var _layer$group2;
|
|
282
|
+
if ((_layer$group2 = layer.group) !== null && _layer$group2 !== void 0 && _layer$group2.length) {
|
|
283
|
+
var group = (0, _lodash.cloneDeep)(layer.group);
|
|
284
|
+
var show = false;
|
|
285
|
+
group.forEach(function (v) {
|
|
286
|
+
v.show = _keys.includes(v.key);
|
|
287
|
+
if (_keys.includes(v.key)) {
|
|
288
|
+
show = true;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
if (JSON.stringify(group) !== JSON.stringify(layer.group)) {
|
|
292
|
+
layer.setGroup(group);
|
|
293
|
+
}
|
|
294
|
+
layer.show = show;
|
|
295
|
+
layer.setVisible(show);
|
|
296
|
+
} else {
|
|
297
|
+
var _show = keys.includes(a);
|
|
298
|
+
if (_show !== layer.show) {
|
|
299
|
+
layer.show = _show;
|
|
300
|
+
layer.setVisible(_show);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
map.layers.onChange();
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// 根据 keys 设置图层的隐藏,其他的显示
|
|
309
|
+
}, {
|
|
310
|
+
key: "setHideByKeys",
|
|
311
|
+
value: function setHideByKeys(_keys) {
|
|
312
|
+
var map = this.map;
|
|
313
|
+
var keys = Array.isArray(_keys) ? _keys : [_keys];
|
|
314
|
+
this.getAllKeys().map(function (a) {
|
|
315
|
+
var layer = map.layers.getLayerByKey(a);
|
|
316
|
+
if (layer) {
|
|
317
|
+
var _layer$group3;
|
|
318
|
+
if ((_layer$group3 = layer.group) !== null && _layer$group3 !== void 0 && _layer$group3.length) {
|
|
319
|
+
var group = (0, _lodash.cloneDeep)(layer.group);
|
|
320
|
+
group.forEach(function (v) {
|
|
321
|
+
v.show = !_keys.includes(v.key);
|
|
322
|
+
});
|
|
323
|
+
if (!(0, _lodash.isEqual)(group, layer.group)) {
|
|
324
|
+
layer.setGroup(group);
|
|
325
|
+
}
|
|
326
|
+
} else {
|
|
327
|
+
var show = !keys.includes(a);
|
|
328
|
+
if (show !== layer.show) {
|
|
329
|
+
layer.show = show;
|
|
330
|
+
layer.setVisible(show);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
map.layers.onChange();
|
|
336
|
+
}
|
|
337
|
+
}]);
|
|
338
|
+
return Layers;
|
|
339
|
+
}(_EventEmitter2["default"]);
|
|
340
|
+
exports["default"] = Layers;
|
|
341
|
+
//# sourceMappingURL=Layers.js.map
|