@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/Test.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
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
|
+
require("./style");
|
|
10
|
+
var _useProps2 = _interopRequireDefault(require("../use-props"));
|
|
11
|
+
var _ScaleDenominator = _interopRequireDefault(require("./ScaleDenominator"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
+
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."); }
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
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; } }
|
|
20
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // Test.jsx
|
|
21
|
+
// 获取地图容器的像素尺寸
|
|
22
|
+
function getMapSizeInPx(map) {
|
|
23
|
+
var viewport = map.getViewport();
|
|
24
|
+
var rect = viewport.getBoundingClientRect();
|
|
25
|
+
return {
|
|
26
|
+
width: rect.width,
|
|
27
|
+
height: rect.height
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 示例:在控制台输出当前地图尺寸
|
|
32
|
+
var Test = function Test() {
|
|
33
|
+
var _useProps = (0, _useProps2["default"])(),
|
|
34
|
+
map = _useProps.map;
|
|
35
|
+
var _useState = (0, _react.useState)('none'),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
dispaly = _useState2[0],
|
|
38
|
+
setDispaly = _useState2[1];
|
|
39
|
+
var _useState3 = (0, _react.useState)(0),
|
|
40
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
|
+
clickCount = _useState4[0],
|
|
42
|
+
setClickCount = _useState4[1];
|
|
43
|
+
var _useState5 = (0, _react.useState)(false),
|
|
44
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
45
|
+
isDragging = _useState6[0],
|
|
46
|
+
setIsDragging = _useState6[1];
|
|
47
|
+
var _useState7 = (0, _react.useState)({
|
|
48
|
+
x: 0,
|
|
49
|
+
y: 0
|
|
50
|
+
}),
|
|
51
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
52
|
+
dragStart = _useState8[0],
|
|
53
|
+
setDragStart = _useState8[1];
|
|
54
|
+
var _useState9 = (0, _react.useState)({
|
|
55
|
+
x: 100,
|
|
56
|
+
y: 100
|
|
57
|
+
}),
|
|
58
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
59
|
+
boxPosition = _useState10[0],
|
|
60
|
+
setBoxPosition = _useState10[1];
|
|
61
|
+
var boxRef = (0, _react.useRef)(null);
|
|
62
|
+
var lastClickTime = (0, _react.useRef)(0);
|
|
63
|
+
(0, _react.useEffect)(function () {
|
|
64
|
+
if (!map) return;
|
|
65
|
+
setBoxPosition({
|
|
66
|
+
x: getMapSizeInPx(map).width / 2 - 100,
|
|
67
|
+
y: getMapSizeInPx(map).height / 2 - 75
|
|
68
|
+
});
|
|
69
|
+
var handleClick = function handleClick() {
|
|
70
|
+
var currentTime = Date.now();
|
|
71
|
+
// 检查两次点击间隔是否小于1秒(1000毫秒)
|
|
72
|
+
if (currentTime - lastClickTime.current < 1000) {
|
|
73
|
+
var newCount = clickCount + 1;
|
|
74
|
+
setClickCount(newCount);
|
|
75
|
+
if (newCount >= 10) {
|
|
76
|
+
setDispaly('block');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// 更新上次点击时间
|
|
80
|
+
lastClickTime.current = currentTime;
|
|
81
|
+
};
|
|
82
|
+
map.on('click', handleClick);
|
|
83
|
+
return function () {
|
|
84
|
+
map.un('click', handleClick);
|
|
85
|
+
};
|
|
86
|
+
}, [map, clickCount]);
|
|
87
|
+
// 处理拖动开始
|
|
88
|
+
var handleDragStart = function handleDragStart(e) {
|
|
89
|
+
setIsDragging(true);
|
|
90
|
+
setDragStart({
|
|
91
|
+
x: e.clientX - boxPosition.x,
|
|
92
|
+
y: e.clientY - boxPosition.y
|
|
93
|
+
});
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// 处理拖动过程
|
|
98
|
+
var handleDrag = function handleDrag(e) {
|
|
99
|
+
if (isDragging) {
|
|
100
|
+
setBoxPosition({
|
|
101
|
+
x: e.clientX - dragStart.x,
|
|
102
|
+
y: e.clientY - dragStart.y
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// 处理拖动结束
|
|
108
|
+
var handleDragEnd = function handleDragEnd() {
|
|
109
|
+
setIsDragging(false);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
// 在useEffect中添加鼠标事件监听
|
|
113
|
+
(0, _react.useEffect)(function () {
|
|
114
|
+
if (isDragging) {
|
|
115
|
+
document.addEventListener('mousemove', handleDrag);
|
|
116
|
+
document.addEventListener('mouseup', handleDragEnd);
|
|
117
|
+
} else {
|
|
118
|
+
document.removeEventListener('mousemove', handleDrag);
|
|
119
|
+
document.removeEventListener('mouseup', handleDragEnd);
|
|
120
|
+
}
|
|
121
|
+
return function () {
|
|
122
|
+
document.removeEventListener('mousemove', handleDrag);
|
|
123
|
+
document.removeEventListener('mouseup', handleDragEnd);
|
|
124
|
+
};
|
|
125
|
+
}, [isDragging, dragStart]);
|
|
126
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, dispaly === 'block' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
127
|
+
ref: boxRef,
|
|
128
|
+
style: {
|
|
129
|
+
position: 'absolute',
|
|
130
|
+
top: "".concat(boxPosition.y, "px"),
|
|
131
|
+
left: "".concat(boxPosition.x, "px"),
|
|
132
|
+
width: '200px',
|
|
133
|
+
height: '150px',
|
|
134
|
+
border: '2px solid #333',
|
|
135
|
+
backgroundColor: 'rgba(255, 255, 255, 0.8)',
|
|
136
|
+
cursor: 'move',
|
|
137
|
+
resize: 'both',
|
|
138
|
+
overflow: 'auto',
|
|
139
|
+
zIndex: 1000
|
|
140
|
+
},
|
|
141
|
+
onMouseDown: handleDragStart
|
|
142
|
+
}, /*#__PURE__*/_react["default"].createElement(_ScaleDenominator["default"], null)));
|
|
143
|
+
};
|
|
144
|
+
var _default = Test;
|
|
145
|
+
exports["default"] = _default;
|
|
146
|
+
//# sourceMappingURL=Test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Test.js","names":["_react","_interopRequireWildcard","require","_useProps2","_interopRequireDefault","_ScaleDenominator","obj","__esModule","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","length","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","isArray","getMapSizeInPx","map","viewport","getViewport","rect","getBoundingClientRect","width","height","Test","_useProps","useProps","_useState","useState","_useState2","dispaly","setDispaly","_useState3","_useState4","clickCount","setClickCount","_useState5","_useState6","isDragging","setIsDragging","_useState7","x","y","_useState8","dragStart","setDragStart","_useState9","_useState10","boxPosition","setBoxPosition","boxRef","useRef","lastClickTime","useEffect","handleClick","currentTime","Date","now","current","newCount","on","un","handleDragStart","e","clientX","clientY","preventDefault","handleDrag","handleDragEnd","document","addEventListener","removeEventListener","createElement","Fragment","ref","style","position","top","concat","left","border","backgroundColor","cursor","resize","overflow","zIndex","onMouseDown","_default","exports"],"sources":["map/Test.jsx"],"sourcesContent":["// Test.jsx\nimport React, { useEffect, useState, useRef } from 'react';\nimport './style';\nimport useProps from '../use-props';\nimport Sd from './ScaleDenominator';\n\n// 获取地图容器的像素尺寸\nfunction getMapSizeInPx(map) {\n const viewport = map.getViewport();\n const rect = viewport.getBoundingClientRect();\n return {\n width: rect.width,\n height: rect.height,\n };\n}\n\n// 示例:在控制台输出当前地图尺寸\nconst Test = () => {\n const { map } = useProps();\n const [dispaly, setDispaly] = useState('none');\n const [clickCount, setClickCount] = useState(0);\n const [isDragging, setIsDragging] = useState(false);\n const [dragStart, setDragStart] = useState({ x: 0, y: 0 });\n const [boxPosition, setBoxPosition] = useState({ x: 100, y: 100 });\n\n const boxRef = useRef(null);\n const lastClickTime = useRef(0);\n\n useEffect(() => {\n if (!map) return;\n setBoxPosition({\n x: getMapSizeInPx(map).width / 2 - 100,\n y: getMapSizeInPx(map).height / 2 - 75,\n });\n\n const handleClick = () => {\n const currentTime = Date.now();\n // 检查两次点击间隔是否小于1秒(1000毫秒)\n if (currentTime - lastClickTime.current < 1000) {\n const newCount = clickCount + 1;\n setClickCount(newCount);\n\n if (newCount >= 10) {\n setDispaly('block');\n }\n }\n // 更新上次点击时间\n lastClickTime.current = currentTime;\n };\n\n map.on('click', handleClick);\n\n return () => {\n map.un('click', handleClick);\n };\n }, [map, clickCount]);\n // 处理拖动开始\n const handleDragStart = e => {\n setIsDragging(true);\n setDragStart({\n x: e.clientX - boxPosition.x,\n y: e.clientY - boxPosition.y,\n });\n e.preventDefault();\n };\n\n // 处理拖动过程\n const handleDrag = e => {\n if (isDragging) {\n setBoxPosition({\n x: e.clientX - dragStart.x,\n y: e.clientY - dragStart.y,\n });\n }\n };\n\n // 处理拖动结束\n const handleDragEnd = () => {\n setIsDragging(false);\n };\n\n // 在useEffect中添加鼠标事件监听\n useEffect(() => {\n if (isDragging) {\n document.addEventListener('mousemove', handleDrag);\n document.addEventListener('mouseup', handleDragEnd);\n } else {\n document.removeEventListener('mousemove', handleDrag);\n document.removeEventListener('mouseup', handleDragEnd);\n }\n\n return () => {\n document.removeEventListener('mousemove', handleDrag);\n document.removeEventListener('mouseup', handleDragEnd);\n };\n }, [isDragging, dragStart]);\n return (\n <>\n {dispaly === 'block' && (\n <div\n ref={boxRef}\n style={{\n position: 'absolute',\n top: `${boxPosition.y}px`,\n left: `${boxPosition.x}px`,\n width: '200px',\n height: '150px',\n border: '2px solid #333',\n backgroundColor: 'rgba(255, 255, 255, 0.8)',\n cursor: 'move',\n resize: 'both',\n overflow: 'auto',\n zIndex: 1000,\n }}\n onMouseDown={handleDragStart}\n >\n <Sd />\n </div>\n )}\n </>\n );\n};\n\nexport default Test;\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACAA,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAoC,SAAAE,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,i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D;IAEA,OAAO,YAAM;MACTC,QAAQ,CAACE,mBAAmB,CAAC,WAAW,EAAEJ,UAAU,CAAC;MACrDE,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAEH,aAAa,CAAC;IAC1D,CAAC;EACL,CAAC,EAAE,CAAC9B,UAAU,EAAEM,SAAS,CAAC,CAAC;EAC3B,oBACI9F,MAAA,YAAA0H,aAAA,CAAA1H,MAAA,YAAA2H,QAAA,QACK3C,OAAO,KAAK,OAAO,iBAChBhF,MAAA,YAAA0H,aAAA;IACIE,GAAG,EAAExB,MAAO;IACZyB,KAAK,EAAE;MACHC,QAAQ,EAAE,UAAU;MACpBC,GAAG,KAAAC,MAAA,CAAK9B,WAAW,CAACN,CAAC,OAAI;MACzBqC,IAAI,KAAAD,MAAA,CAAK9B,WAAW,CAACP,CAAC,OAAI;MAC1BnB,KAAK,EAAE,OAAO;MACdC,MAAM,EAAE,OAAO;MACfyD,MAAM,EAAE,gBAAgB;MACxBC,eAAe,EAAE,0BAA0B;MAC3CC,MAAM,EAAE,MAAM;MACdC,MAAM,EAAE,MAAM;MACdC,QAAQ,EAAE,MAAM;MAChBC,MAAM,EAAE;IACZ,CAAE;IACFC,WAAW,EAAExB;EAAgB,gBAE7BhH,MAAA,YAAA0H,aAAA,CAACrH,iBAAA,WAAE,MAAE,CACJ,CAEX,CAAC;AAEX,CAAC;AAAC,IAAAoI,QAAA,GAEa/D,IAAI;AAAAgE,OAAA,cAAAD,QAAA"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _layer = require("ol/layer");
|
|
8
|
+
var _proj = require("ol/proj");
|
|
9
|
+
var _source = require("ol/source");
|
|
10
|
+
// 导入proj控件,使用其方法注入gcj02坐标系
|
|
11
|
+
|
|
12
|
+
var PI = Math.PI;
|
|
13
|
+
var AXIS = 6378245.0;
|
|
14
|
+
var OFFSET = 0.00669342162296594323; // (a^2 - b^2) / a^2
|
|
15
|
+
|
|
16
|
+
function delta(wgLon, wgLat) {
|
|
17
|
+
var dLat = transformLat(wgLon - 105.0, wgLat - 35.0);
|
|
18
|
+
var dLon = transformLon(wgLon - 105.0, wgLat - 35.0);
|
|
19
|
+
var radLat = wgLat / 180.0 * PI;
|
|
20
|
+
var magic = Math.sin(radLat);
|
|
21
|
+
magic = 1 - OFFSET * magic * magic;
|
|
22
|
+
var sqrtMagic = Math.sqrt(magic);
|
|
23
|
+
dLat = dLat * 180.0 / (AXIS * (1 - OFFSET) / (magic * sqrtMagic) * PI);
|
|
24
|
+
dLon = dLon * 180.0 / (AXIS / sqrtMagic * Math.cos(radLat) * PI);
|
|
25
|
+
return [dLon, dLat];
|
|
26
|
+
}
|
|
27
|
+
function outOfChina(lon, lat) {
|
|
28
|
+
if (lon < 72.004 || lon > 137.8347) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (lat < 0.8293 || lat > 55.8271) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
function transformLat(x, y) {
|
|
37
|
+
var ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
|
|
38
|
+
ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0;
|
|
39
|
+
ret += (20.0 * Math.sin(y * PI) + 40.0 * Math.sin(y / 3.0 * PI)) * 2.0 / 3.0;
|
|
40
|
+
ret += (160.0 * Math.sin(y / 12.0 * PI) + 320 * Math.sin(y * PI / 30.0)) * 2.0 / 3.0;
|
|
41
|
+
return ret;
|
|
42
|
+
}
|
|
43
|
+
function transformLon(x, y) {
|
|
44
|
+
var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
|
|
45
|
+
ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0;
|
|
46
|
+
ret += (20.0 * Math.sin(x * PI) + 40.0 * Math.sin(x / 3.0 * PI)) * 2.0 / 3.0;
|
|
47
|
+
ret += (150.0 * Math.sin(x / 12.0 * PI) + 300.0 * Math.sin(x / 30.0 * PI)) * 2.0 / 3.0;
|
|
48
|
+
return ret;
|
|
49
|
+
}
|
|
50
|
+
var forEachPoint = function forEachPoint(func) {
|
|
51
|
+
return function (input, opt_output, opt_dimension) {
|
|
52
|
+
var len = input.length;
|
|
53
|
+
var dimension = opt_dimension || 2;
|
|
54
|
+
var output;
|
|
55
|
+
if (opt_output) {
|
|
56
|
+
output = opt_output;
|
|
57
|
+
} else if (dimension !== 2) {
|
|
58
|
+
output = input.slice();
|
|
59
|
+
} else {
|
|
60
|
+
output = new Array(len);
|
|
61
|
+
}
|
|
62
|
+
for (var offset = 0; offset < len; offset += dimension) {
|
|
63
|
+
func(input, output, offset);
|
|
64
|
+
}
|
|
65
|
+
return output;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
var gcj02 = {
|
|
69
|
+
toWGS84: forEachPoint(function (input, output, offset) {
|
|
70
|
+
var lng = input[offset];
|
|
71
|
+
var lat = input[offset + 1];
|
|
72
|
+
if (!outOfChina(lng, lat)) {
|
|
73
|
+
var deltaD = delta(lng, lat);
|
|
74
|
+
lng = lng - deltaD[0];
|
|
75
|
+
lat = lat - deltaD[1];
|
|
76
|
+
}
|
|
77
|
+
output[offset] = lng;
|
|
78
|
+
output[offset + 1] = lat;
|
|
79
|
+
}),
|
|
80
|
+
fromWGS84: forEachPoint(function (input, output, offset) {
|
|
81
|
+
var lng = input[offset];
|
|
82
|
+
var lat = input[offset + 1];
|
|
83
|
+
if (!outOfChina(lng, lat)) {
|
|
84
|
+
var deltaD = delta(lng, lat);
|
|
85
|
+
lng = lng + deltaD[0];
|
|
86
|
+
lat = lat + deltaD[1];
|
|
87
|
+
}
|
|
88
|
+
output[offset] = lng;
|
|
89
|
+
output[offset + 1] = lat;
|
|
90
|
+
})
|
|
91
|
+
};
|
|
92
|
+
var projzh = {
|
|
93
|
+
ll2smerc: (0, _proj.getTransform)('EPSG:4326', 'EPSG:3857'),
|
|
94
|
+
smerc2ll: (0, _proj.getTransform)('EPSG:3857', 'EPSG:4326')
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// wgs84 -> gcj02
|
|
98
|
+
projzh.ll2gmerc = function (input, opt_output, opt_dimension) {
|
|
99
|
+
var output = gcj02.fromWGS84(input, opt_output, opt_dimension);
|
|
100
|
+
return projzh.ll2smerc(output, output, opt_dimension);
|
|
101
|
+
};
|
|
102
|
+
// gcj02 -> wgs84
|
|
103
|
+
projzh.gmerc2ll = function (input, opt_output, opt_dimension) {
|
|
104
|
+
var output = projzh.smerc2ll(input, input, opt_dimension);
|
|
105
|
+
return gcj02.toWGS84(output, opt_output, opt_dimension);
|
|
106
|
+
};
|
|
107
|
+
// 3857 -> gcj02
|
|
108
|
+
projzh.smerc2gmerc = function (input, opt_output, opt_dimension) {
|
|
109
|
+
var output = projzh.smerc2ll(input, input, opt_dimension);
|
|
110
|
+
output = gcj02.fromWGS84(output, output, opt_dimension);
|
|
111
|
+
return projzh.ll2smerc(output, output, opt_dimension);
|
|
112
|
+
};
|
|
113
|
+
// gcj02 -> 3857
|
|
114
|
+
projzh.gmerc2smerc = function (input, opt_output, opt_dimension) {
|
|
115
|
+
var output = projzh.smerc2ll(input, input, opt_dimension);
|
|
116
|
+
output = gcj02.toWGS84(output, output, opt_dimension);
|
|
117
|
+
return projzh.ll2smerc(output, output, opt_dimension);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// 定义GCJ02墨卡托投影坐标系
|
|
121
|
+
var gcj02Mecator = new _proj.Projection({
|
|
122
|
+
code: 'GCJ-02',
|
|
123
|
+
// extent不能缺少,OpenLayers frame 渲染的时候需要
|
|
124
|
+
extent: [-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244],
|
|
125
|
+
units: 'm'
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
// 将GCJ02墨卡托投影坐标系注册进OpenLayers
|
|
129
|
+
(0, _proj.addProjection)(gcj02Mecator);
|
|
130
|
+
|
|
131
|
+
// 覆盖默认的转换方法
|
|
132
|
+
(0, _proj.addCoordinateTransforms)('EPSG:4326', gcj02Mecator, projzh.ll2gmerc, projzh.gmerc2ll);
|
|
133
|
+
(0, _proj.addCoordinateTransforms)('EPSG:3857', gcj02Mecator, projzh.smerc2gmerc, projzh.gmerc2smerc);
|
|
134
|
+
var getSource = function getSource() {
|
|
135
|
+
return new _source.XYZ({
|
|
136
|
+
projection: gcj02Mecator,
|
|
137
|
+
maxZoom: 18,
|
|
138
|
+
url: '//wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=10&x={x}&y={y}&z={z}',
|
|
139
|
+
crossOrigin: 'anonymous'
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
var getLayer = function getLayer(_ref) {
|
|
143
|
+
var dark = _ref.dark;
|
|
144
|
+
var mapLayer = new _layer.Tile({
|
|
145
|
+
source: getSource(),
|
|
146
|
+
className: dark && 'ol-map-dark',
|
|
147
|
+
zIndex: 0
|
|
148
|
+
});
|
|
149
|
+
return [mapLayer];
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// 转换方法
|
|
153
|
+
var transform = function transform(coordinate) {
|
|
154
|
+
return (0, _proj.transform)(coordinate, 'EPSG:4326', 'GCJ-02');
|
|
155
|
+
};
|
|
156
|
+
var _default = {
|
|
157
|
+
mercator: gcj02Mecator,
|
|
158
|
+
gcj02: gcj02,
|
|
159
|
+
transform: transform,
|
|
160
|
+
getSource: getSource,
|
|
161
|
+
getLayer: getLayer
|
|
162
|
+
};
|
|
163
|
+
exports["default"] = _default;
|
|
164
|
+
//# sourceMappingURL=AmapImageryProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmapImageryProvider.js","names":["_layer","require","_proj","_source","PI","Math","AXIS","OFFSET","delta","wgLon","wgLat","dLat","transformLat","dLon","transformLon","radLat","magic","sin","sqrtMagic","sqrt","cos","outOfChina","lon","lat","x","y","ret","abs","forEachPoint","func","input","opt_output","opt_dimension","len","length","dimension","output","slice","Array","offset","gcj02","toWGS84","lng","deltaD","fromWGS84","projzh","ll2smerc","getTransform","smerc2ll","ll2gmerc","gmerc2ll","smerc2gmerc","gmerc2smerc","gcj02Mecator","Projection","code","extent","units","addProjection","addCoordinateTransforms","getSource","XYZSource","projection","maxZoom","url","crossOrigin","getLayer","_ref","dark","mapLayer","TileLayer","source","className","zIndex","transform","coordinate","transformProj","_default","mercator","exports"],"sources":["map/getBaseLayers/imagery/amap/AmapImageryProvider.js"],"sourcesContent":["import { Tile as TileLayer } from 'ol/layer';\n// 导入proj控件,使用其方法注入gcj02坐标系\nimport { Projection, addProjection, addCoordinateTransforms, getTransform } from 'ol/proj';\nimport { XYZ as XYZSource } from 'ol/source';\nimport { transform as transformProj } from 'ol/proj';\n\nconst PI = Math.PI;\nconst AXIS = 6378245.0;\nconst OFFSET = 0.00669342162296594323; // (a^2 - b^2) / a^2\n\nfunction delta(wgLon, wgLat) {\n let dLat = transformLat(wgLon - 105.0, wgLat - 35.0);\n let dLon = transformLon(wgLon - 105.0, wgLat - 35.0);\n const radLat = (wgLat / 180.0) * PI;\n let magic = Math.sin(radLat);\n magic = 1 - OFFSET * magic * magic;\n const sqrtMagic = Math.sqrt(magic);\n dLat = (dLat * 180.0) / (((AXIS * (1 - OFFSET)) / (magic * sqrtMagic)) * PI);\n dLon = (dLon * 180.0) / ((AXIS / sqrtMagic) * Math.cos(radLat) * PI);\n return [dLon, dLat];\n}\n\nfunction outOfChina(lon, lat) {\n if (lon < 72.004 || lon > 137.8347) {\n return true;\n }\n if (lat < 0.8293 || lat > 55.8271) {\n return true;\n }\n return false;\n}\n\nfunction transformLat(x, y) {\n let ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));\n ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0;\n ret += ((20.0 * Math.sin(y * PI) + 40.0 * Math.sin((y / 3.0) * PI)) * 2.0) / 3.0;\n ret += ((160.0 * Math.sin((y / 12.0) * PI) + 320 * Math.sin((y * PI) / 30.0)) * 2.0) / 3.0;\n return ret;\n}\n\nfunction transformLon(x, y) {\n let ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));\n ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0;\n ret += ((20.0 * Math.sin(x * PI) + 40.0 * Math.sin((x / 3.0) * PI)) * 2.0) / 3.0;\n ret += ((150.0 * Math.sin((x / 12.0) * PI) + 300.0 * Math.sin((x / 30.0) * PI)) * 2.0) / 3.0;\n return ret;\n}\n\nconst forEachPoint = function (func) {\n return function (input, opt_output, opt_dimension) {\n const len = input.length;\n const dimension = opt_dimension || 2;\n let output;\n if (opt_output) {\n output = opt_output;\n } else if (dimension !== 2) {\n output = input.slice();\n } else {\n output = new Array(len);\n }\n for (let offset = 0; offset < len; offset += dimension) {\n func(input, output, offset);\n }\n return output;\n };\n};\n\nconst gcj02 = {\n toWGS84: forEachPoint(function (input, output, offset) {\n let lng = input[offset];\n let lat = input[offset + 1];\n if (!outOfChina(lng, lat)) {\n const deltaD = delta(lng, lat);\n lng = lng - deltaD[0];\n lat = lat - deltaD[1];\n }\n output[offset] = lng;\n output[offset + 1] = lat;\n }),\n fromWGS84: forEachPoint(function (input, output, offset) {\n let lng = input[offset];\n let lat = input[offset + 1];\n if (!outOfChina(lng, lat)) {\n const deltaD = delta(lng, lat);\n lng = lng + deltaD[0];\n lat = lat + deltaD[1];\n }\n output[offset] = lng;\n output[offset + 1] = lat;\n }),\n};\n\nconst projzh = {\n ll2smerc: getTransform('EPSG:4326', 'EPSG:3857'),\n smerc2ll: getTransform('EPSG:3857', 'EPSG:4326'),\n};\n\n// wgs84 -> gcj02\nprojzh.ll2gmerc = function (input, opt_output, opt_dimension) {\n const output = gcj02.fromWGS84(input, opt_output, opt_dimension);\n return projzh.ll2smerc(output, output, opt_dimension);\n};\n// gcj02 -> wgs84\nprojzh.gmerc2ll = function (input, opt_output, opt_dimension) {\n const output = projzh.smerc2ll(input, input, opt_dimension);\n return gcj02.toWGS84(output, opt_output, opt_dimension);\n};\n// 3857 -> gcj02\nprojzh.smerc2gmerc = function (input, opt_output, opt_dimension) {\n let output = projzh.smerc2ll(input, input, opt_dimension);\n output = gcj02.fromWGS84(output, output, opt_dimension);\n return projzh.ll2smerc(output, output, opt_dimension);\n};\n// gcj02 -> 3857\nprojzh.gmerc2smerc = function (input, opt_output, opt_dimension) {\n let output = projzh.smerc2ll(input, input, opt_dimension);\n output = gcj02.toWGS84(output, output, opt_dimension);\n return projzh.ll2smerc(output, output, opt_dimension);\n};\n\n// 定义GCJ02墨卡托投影坐标系\nconst gcj02Mecator = new Projection({\n code: 'GCJ-02',\n // extent不能缺少,OpenLayers frame 渲染的时候需要\n extent: [-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244],\n units: 'm',\n});\n\n// 将GCJ02墨卡托投影坐标系注册进OpenLayers\naddProjection(gcj02Mecator);\n\n// 覆盖默认的转换方法\naddCoordinateTransforms('EPSG:4326', gcj02Mecator, projzh.ll2gmerc, projzh.gmerc2ll);\naddCoordinateTransforms('EPSG:3857', gcj02Mecator, projzh.smerc2gmerc, projzh.gmerc2smerc);\n\nconst getSource = () => {\n return new XYZSource({\n projection: gcj02Mecator,\n maxZoom: 18,\n url: '//wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=10&x={x}&y={y}&z={z}',\n crossOrigin: 'anonymous',\n });\n};\n\nconst getLayer = ({ dark }) => {\n let mapLayer = new TileLayer({\n source: getSource(),\n className: dark && 'ol-map-dark',\n zIndex: 0\n });\n\n return [mapLayer];\n};\n\n// 转换方法\nconst transform = coordinate => {\n return transformProj(coordinate, 'EPSG:4326', 'GCJ-02');\n};\n\nexport default {\n mercator: gcj02Mecator,\n gcj02,\n transform,\n getSource,\n getLayer,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAFA;;AAKA,IAAMG,EAAE,GAAGC,IAAI,CAACD,EAAE;AAClB,IAAME,IAAI,GAAG,SAAS;AACtB,IAAMC,MAAM,GAAG,sBAAsB,CAAC,CAAC;;AAEvC,SAASC,KAAKA,CAACC,KAAK,EAAEC,KAAK,EAAE;EACzB,IAAIC,IAAI,GAAGC,YAAY,CAACH,KAAK,GAAG,KAAK,EAAEC,KAAK,GAAG,IAAI,CAAC;EACpD,IAAIG,IAAI,GAAGC,YAAY,CAACL,KAAK,GAAG,KAAK,EAAEC,KAAK,GAAG,IAAI,CAAC;EACpD,IAAMK,MAAM,GAAIL,KAAK,GAAG,KAAK,GAAIN,EAAE;EACnC,IAAIY,KAAK,GAAGX,IAAI,CAACY,GAAG,CAACF,MAAM,CAAC;EAC5BC,KAAK,GAAG,CAAC,GAAGT,MAAM,GAAGS,KAAK,GAAGA,KAAK;EAClC,IAAME,SAAS,GAAGb,IAAI,CAACc,IAAI,CAACH,KAAK,CAAC;EAClCL,IAAI,GAAIA,IAAI,GAAG,KAAK,IAAOL,IAAI,IAAI,CAAC,GAAGC,MAAM,CAAC,IAAKS,KAAK,GAAGE,SAAS,CAAC,GAAId,EAAE,CAAC;EAC5ES,IAAI,GAAIA,IAAI,GAAG,KAAK,IAAMP,IAAI,GAAGY,SAAS,GAAIb,IAAI,CAACe,GAAG,CAACL,MAAM,CAAC,GAAGX,EAAE,CAAC;EAC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I,GAAAD,IAAA,CAAJC,IAAI;EACpB,IAAIC,QAAQ,GAAG,IAAIC,WAAS,CAAC;IACzBC,MAAM,EAAEX,SAAS,CAAC,CAAC;IACnBY,SAAS,EAAEJ,IAAI,IAAI,aAAa;IAChCK,MAAM,EAAE;EACZ,CAAC,CAAC;EAEF,OAAO,CAACJ,QAAQ,CAAC;AACrB,CAAC;;AAED;AACA,IAAMK,SAAS,GAAG,SAAZA,SAASA,CAAGC,UAAU,EAAI;EAC5B,OAAO,IAAAC,eAAa,EAACD,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC;AAC3D,CAAC;AAAC,IAAAE,QAAA,GAEa;EACXC,QAAQ,EAAEzB,YAAY;EACtBb,KAAK,EAALA,KAAK;EACLkC,SAAS,EAATA,SAAS;EACTd,SAAS,EAATA,SAAS;EACTM,QAAQ,EAARA;AACJ,CAAC;AAAAa,OAAA,cAAAF,QAAA"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _layer = require("ol/layer");
|
|
8
|
+
var _proj = require("ol/proj");
|
|
9
|
+
var _projzh = _interopRequireDefault(require("../../../../_util/projzh"));
|
|
10
|
+
var _source = require("ol/source");
|
|
11
|
+
var _TileGrid = _interopRequireDefault(require("ol/tilegrid/TileGrid"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
// 导入proj控件,使用其方法注入gcj02坐标系
|
|
14
|
+
|
|
15
|
+
var bd09Mercator = new _proj.Projection({
|
|
16
|
+
code: 'BD-09',
|
|
17
|
+
extent: [-20037726.37, -12474104.17, 20037726.37, 12474104.17],
|
|
18
|
+
units: 'm'
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// 将BD09墨卡托投影坐标系注册进OpenLayers
|
|
22
|
+
(0, _proj.addProjection)(bd09Mercator);
|
|
23
|
+
|
|
24
|
+
// 覆盖默认的转换方法
|
|
25
|
+
(0, _proj.addCoordinateTransforms)('EPSG:4326', bd09Mercator, _projzh["default"].ll2bmerc, _projzh["default"].bmerc2ll);
|
|
26
|
+
(0, _proj.addCoordinateTransforms)('EPSG:3857', bd09Mercator, _projzh["default"].smerc2bmerc, _projzh["default"].bmerc2smerc);
|
|
27
|
+
var getSource = function getSource(options) {
|
|
28
|
+
var qt = options.qt;
|
|
29
|
+
var bmercResolutions = new Array(19);
|
|
30
|
+
for (var i = 0; i < 19; ++i) {
|
|
31
|
+
bmercResolutions[i] = Math.pow(2, 18 - i);
|
|
32
|
+
}
|
|
33
|
+
var urls = [0, 1, 2, 3].map(function (sub) {
|
|
34
|
+
return "//maponline".concat(sub, ".bdimg.com/tile/?qt=").concat(qt || 'vtile', "&x={x}&y={y}&z={z}&styles=pl&scaler=2&udt=20210506&from=jsapi3_0");
|
|
35
|
+
});
|
|
36
|
+
return new _source.XYZ({
|
|
37
|
+
projection: 'BD-09',
|
|
38
|
+
maxZoom: 18,
|
|
39
|
+
crossOrigin: 'anonymous',
|
|
40
|
+
tileUrlFunction: function tileUrlFunction(tileCoord) {
|
|
41
|
+
var x = tileCoord[1];
|
|
42
|
+
var y = -tileCoord[2] - 1;
|
|
43
|
+
var z = tileCoord[0];
|
|
44
|
+
var hash = (x << z) + y;
|
|
45
|
+
var index = hash % urls.length;
|
|
46
|
+
index = index < 0 ? index + urls.length : index;
|
|
47
|
+
if (x < 0) {
|
|
48
|
+
x = 'M' + -x;
|
|
49
|
+
}
|
|
50
|
+
if (y < 0) {
|
|
51
|
+
y = 'M' + -y;
|
|
52
|
+
}
|
|
53
|
+
return urls[index].replace('{x}', x).replace('{y}', y).replace('{z}', z);
|
|
54
|
+
},
|
|
55
|
+
tilePixelRatio: 2,
|
|
56
|
+
tileGrid: new _TileGrid["default"]({
|
|
57
|
+
resolutions: bmercResolutions,
|
|
58
|
+
origin: [0, 0]
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// 获取百度底图
|
|
64
|
+
var getLayer = function getLayer(options) {
|
|
65
|
+
var dark = options.dark;
|
|
66
|
+
var mapLayer = new _layer.Tile({
|
|
67
|
+
source: getSource(options),
|
|
68
|
+
className: dark && 'ol-map-dark',
|
|
69
|
+
zIndex: 0
|
|
70
|
+
});
|
|
71
|
+
return [mapLayer];
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// 转换方法
|
|
75
|
+
var transform = function transform(coordinate) {
|
|
76
|
+
return (0, _proj.transform)(coordinate, 'EPSG:4326', 'BD-09');
|
|
77
|
+
};
|
|
78
|
+
var _default = {
|
|
79
|
+
mercator: bd09Mercator,
|
|
80
|
+
transform: transform,
|
|
81
|
+
getSource: getSource,
|
|
82
|
+
getLayer: getLayer
|
|
83
|
+
};
|
|
84
|
+
exports["default"] = _default;
|
|
85
|
+
//# sourceMappingURL=BaiduImageryProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaiduImageryProvider.js","names":["_layer","require","_proj","_projzh","_interopRequireDefault","_source","_TileGrid","obj","__esModule","bd09Mercator","Projection","code","extent","units","addProjection","addCoordinateTransforms","projzh","ll2bmerc","bmerc2ll","smerc2bmerc","bmerc2smerc","getSource","options","qt","bmercResolutions","Array","i","Math","pow","urls","map","sub","concat","XYZ","projection","maxZoom","crossOrigin","tileUrlFunction","tileCoord","x","y","z","hash","index","length","replace","tilePixelRatio","tileGrid","TileGrid","resolutions","origin","getLayer","dark","mapLayer","TileLayer","source","className","zIndex","transform","coordinate","transformProj","_default","mercator","exports"],"sources":["map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js"],"sourcesContent":["import { Tile as TileLayer } from 'ol/layer';\n// 导入proj控件,使用其方法注入gcj02坐标系\nimport {\n Projection,\n addProjection,\n addCoordinateTransforms,\n transform as transformProj,\n} from 'ol/proj';\nimport projzh from '../../../../_util/projzh';\nimport { XYZ } from 'ol/source';\nimport TileGrid from 'ol/tilegrid/TileGrid';\n\nlet bd09Mercator = new Projection({\n code: 'BD-09',\n extent: [-20037726.37, -12474104.17, 20037726.37, 12474104.17],\n units: 'm',\n});\n\n// 将BD09墨卡托投影坐标系注册进OpenLayers\naddProjection(bd09Mercator);\n\n// 覆盖默认的转换方法\naddCoordinateTransforms('EPSG:4326', bd09Mercator, projzh.ll2bmerc, projzh.bmerc2ll);\naddCoordinateTransforms('EPSG:3857', bd09Mercator, projzh.smerc2bmerc, projzh.bmerc2smerc);\n\nconst getSource = (options) => {\n const {qt} = options;\n let bmercResolutions = new Array(19);\n for (let i = 0; i < 19; ++i) {\n bmercResolutions[i] = Math.pow(2, 18 - i);\n }\n let urls = [0, 1, 2, 3].map(function (sub) {\n return (\n `//maponline${sub}.bdimg.com/tile/?qt=${qt || 'vtile'}&x={x}&y={y}&z={z}&styles=pl&scaler=2&udt=20210506&from=jsapi3_0`\n );\n });\n\n return new XYZ({\n projection: 'BD-09',\n maxZoom: 18,\n crossOrigin: 'anonymous',\n tileUrlFunction: function (tileCoord) {\n let x = tileCoord[1];\n let y = -tileCoord[2] - 1;\n let z = tileCoord[0];\n let hash = (x << z) + y;\n let index = hash % urls.length;\n index = index < 0 ? index + urls.length : index;\n if (x < 0) {\n x = 'M' + -x;\n }\n if (y < 0) {\n y = 'M' + -y;\n }\n return urls[index]\n .replace('{x}', x)\n .replace('{y}', y)\n .replace('{z}', z);\n },\n tilePixelRatio: 2,\n tileGrid: new TileGrid({\n resolutions: bmercResolutions,\n origin: [0, 0],\n }),\n });\n};\n\n// 获取百度底图\nconst getLayer = (options) => {\n const { dark } = options;\n let mapLayer = new TileLayer({\n source: getSource(options),\n className: dark && 'ol-map-dark',\n zIndex: 0\n });\n\n return [mapLayer];\n};\n\n// 转换方法\nconst transform = coordinate => {\n return transformProj(coordinate, 'EPSG:4326', 'BD-09');\n};\n\nexport default {\n mercator: bd09Mercator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,SAAXA,QAAQA,CAAI7B,OAAO,EAAK;EAC1B,IAAQ8B,IAAI,GAAK9B,OAAO,CAAhB8B,IAAI;EACZ,IAAIC,QAAQ,GAAG,IAAIC,WAAS,CAAC;IACzBC,MAAM,EAAElC,SAAS,CAACC,OAAO,CAAC;IAC1BkC,SAAS,EAAEJ,IAAI,IAAI,aAAa;IAChCK,MAAM,EAAE;EACZ,CAAC,CAAC;EAEF,OAAO,CAACJ,QAAQ,CAAC;AACrB,CAAC;;AAED;AACA,IAAMK,SAAS,GAAG,SAAZA,SAASA,CAAGC,UAAU,EAAI;EAC5B,OAAO,IAAAC,eAAa,EAACD,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC;AAC1D,CAAC;AAAC,IAAAE,QAAA,GAEa;EACXC,QAAQ,EAAErD,YAAY;EACtBiD,SAAS,EAATA,SAAS;EACTrC,SAAS,EAATA,SAAS;EACT8B,QAAQ,EAARA;AACJ,CAAC;AAAAY,OAAA,cAAAF,QAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSource = exports["default"] = void 0;
|
|
7
|
+
var _layer = require("ol/layer");
|
|
8
|
+
var _source = require("ol/source");
|
|
9
|
+
var _AmapImageryProvider = _interopRequireDefault(require("../amap/AmapImageryProvider"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
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; }
|
|
15
|
+
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; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
var getSource = function getSource(_ref) {
|
|
18
|
+
var mapStyle = _ref.mapStyle,
|
|
19
|
+
url = _ref.url;
|
|
20
|
+
var URL = {
|
|
21
|
+
Community: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{y}/{x}',
|
|
22
|
+
Warm: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetWarm/MapServer/tile/{z}/{y}/{x}',
|
|
23
|
+
Gray: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}',
|
|
24
|
+
Blue: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}'
|
|
25
|
+
};
|
|
26
|
+
var tileLayer = new _source.XYZ({
|
|
27
|
+
projection: _AmapImageryProvider["default"].mercator,
|
|
28
|
+
url: url || URL[mapStyle || 'Blue'],
|
|
29
|
+
maxZoom: 18,
|
|
30
|
+
crossOrigin: 'anonymous'
|
|
31
|
+
});
|
|
32
|
+
return [tileLayer];
|
|
33
|
+
};
|
|
34
|
+
exports.getSource = getSource;
|
|
35
|
+
var getLayer = function getLayer(_ref2) {
|
|
36
|
+
var mapStyle = _ref2.mapStyle,
|
|
37
|
+
tk = _ref2.tk,
|
|
38
|
+
dark = _ref2.dark,
|
|
39
|
+
url = _ref2.url;
|
|
40
|
+
mapStyle = mapStyle || 'Blue';
|
|
41
|
+
var _getSource = getSource({
|
|
42
|
+
mapStyle: mapStyle,
|
|
43
|
+
tk: tk,
|
|
44
|
+
url: url
|
|
45
|
+
}),
|
|
46
|
+
_getSource2 = _slicedToArray(_getSource, 1),
|
|
47
|
+
tileLayerSource = _getSource2[0];
|
|
48
|
+
var tileLayer = new _layer.Tile({
|
|
49
|
+
preload: Infinity,
|
|
50
|
+
// 预加载
|
|
51
|
+
title: '天地图路网',
|
|
52
|
+
name: 'baseMap',
|
|
53
|
+
className: dark && 'ol-map-dark',
|
|
54
|
+
source: tileLayerSource,
|
|
55
|
+
zIndex: 0
|
|
56
|
+
});
|
|
57
|
+
tileLayer.key = '__TDT_TILE';
|
|
58
|
+
return [tileLayer];
|
|
59
|
+
};
|
|
60
|
+
var _default = {
|
|
61
|
+
// mercator: bd09Mercator,
|
|
62
|
+
// transform,
|
|
63
|
+
getLayer: getLayer,
|
|
64
|
+
getSource: getSource
|
|
65
|
+
};
|
|
66
|
+
exports["default"] = _default;
|
|
67
|
+
//# sourceMappingURL=GeoQImageryProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeoQImageryProvider.js","names":["_layer","require","_source","_AmapImageryProvider","_interopRequireDefault","obj","__esModule","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","Object","prototype","toString","call","slice","constructor","name","Array","from","test","len","length","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","isArray","getSource","_ref","mapStyle","url","URL","Community","Warm","Gray","Blue","tileLayer","XYZ","projection","AmapImageryProvider","mercator","maxZoom","crossOrigin","exports","getLayer","_ref2","tk","dark","_getSource","_getSource2","tileLayerSource","TileLayer","preload","Infinity","title","className","source","zIndex","key","_default"],"sources":["map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js"],"sourcesContent":["import { Tile as TileLayer } from 'ol/layer';\nimport { XYZ } from 'ol/source';\nimport AmapImageryProvider from '../amap/AmapImageryProvider';\n\nexport const getSource = ({ mapStyle, url }) => {\n let URL = {\n Community: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{y}/{x}',\n Warm: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetWarm/MapServer/tile/{z}/{y}/{x}',\n Gray: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}',\n Blue: '//mapnew.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}',\n };\n\n let tileLayer = new XYZ({\n projection: AmapImageryProvider.mercator,\n url: url || URL[mapStyle || 'Blue'],\n maxZoom: 18,\n crossOrigin: 'anonymous',\n });\n\n return [tileLayer];\n};\n\nconst getLayer = ({ mapStyle, tk, dark, url }) => {\n mapStyle = mapStyle || 'Blue';\n\n let [tileLayerSource] = getSource({ mapStyle, tk, url });\n\n let tileLayer = new TileLayer({\n preload: Infinity, // 预加载\n title: '天地图路网',\n name: 'baseMap',\n className: dark && 'ol-map-dark',\n source: tileLayerSource,\n zIndex: 0\n });\n tileLayer.key = '__TDT_TILE';\n\n return [tileLayer];\n};\n\nexport default {\n // mercator: bd09Mercator,\n // transform,\n getLay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
6
|
+
exports.getSource = exports["default"] = void 0;
|
|
7
|
+
var _layer = require("ol/layer");
|
|
8
|
+
var _source = require("ol/source");
|
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
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."); }
|
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
+
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; }
|
|
13
|
+
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; } }
|
|
14
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
+
var getSource = function getSource(options) {
|
|
16
|
+
var tk = options.tk,
|
|
17
|
+
replaceLabel = options.replaceLabel;
|
|
18
|
+
var mapStyle = options.mapStyle || 'vec';
|
|
19
|
+
var P = {
|
|
20
|
+
vec: {
|
|
21
|
+
img: 'vec_w',
|
|
22
|
+
label: 'cva_w'
|
|
23
|
+
},
|
|
24
|
+
img: {
|
|
25
|
+
img: 'img_w',
|
|
26
|
+
label: 'cia_w'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var tileLayer = new _source.XYZ({
|
|
30
|
+
url: "//t{0-7}.tianditu.gov.cn/DataServer?T=".concat(P[mapStyle].img, "&tk=").concat(tk, "&x={x}&y={y}&l={z}"),
|
|
31
|
+
maxZoom: 18,
|
|
32
|
+
crossOrigin: 'anonymous'
|
|
33
|
+
});
|
|
34
|
+
var markLayer = new _source.XYZ({
|
|
35
|
+
url: "//t{0-7}.tianditu.gov.cn/DataServer?T=".concat(P[mapStyle].label, "&tk=").concat(tk, "&x={x}&y={y}&l={z}"),
|
|
36
|
+
maxZoom: 18,
|
|
37
|
+
crossOrigin: 'anonymous'
|
|
38
|
+
});
|
|
39
|
+
if (replaceLabel) {
|
|
40
|
+
markLayer.tileLoadFunction = function (imageTile, src) {
|
|
41
|
+
var tile = imageTile.tileCoord.join("_");
|
|
42
|
+
if (replaceLabel[tile]) {
|
|
43
|
+
return imageTile.getImage().src = replaceLabel[tile];
|
|
44
|
+
}
|
|
45
|
+
imageTile.getImage().src = src;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return [tileLayer, markLayer];
|
|
49
|
+
};
|
|
50
|
+
exports.getSource = getSource;
|
|
51
|
+
var getLayer = function getLayer(options) {
|
|
52
|
+
var dark = options.dark;
|
|
53
|
+
var _getSource = getSource(options),
|
|
54
|
+
_getSource2 = _slicedToArray(_getSource, 2),
|
|
55
|
+
tileLayerSource = _getSource2[0],
|
|
56
|
+
markLayerSource = _getSource2[1];
|
|
57
|
+
var tileLayer = new _layer.Tile({
|
|
58
|
+
preload: Infinity,
|
|
59
|
+
// 预加载
|
|
60
|
+
title: '天地图路网',
|
|
61
|
+
name: 'baseMap',
|
|
62
|
+
className: dark && 'ol-map-dark',
|
|
63
|
+
source: tileLayerSource,
|
|
64
|
+
zIndex: 0
|
|
65
|
+
});
|
|
66
|
+
tileLayer.key = '__TDT_TILE';
|
|
67
|
+
var markLayer = new _layer.Tile({
|
|
68
|
+
preload: Infinity,
|
|
69
|
+
// 预加载
|
|
70
|
+
title: '天地图文字标注',
|
|
71
|
+
name: 'baseMap',
|
|
72
|
+
className: dark && 'ol-map-dark-label',
|
|
73
|
+
source: markLayerSource,
|
|
74
|
+
zIndex: 0
|
|
75
|
+
});
|
|
76
|
+
markLayer.key = '__TDT_MARK';
|
|
77
|
+
return [tileLayer, markLayer];
|
|
78
|
+
};
|
|
79
|
+
var _default = {
|
|
80
|
+
// mercator: bd09Mercator,
|
|
81
|
+
// transform,
|
|
82
|
+
getLayer: getLayer,
|
|
83
|
+
getSource: getSource
|
|
84
|
+
};
|
|
85
|
+
exports["default"] = _default;
|
|
86
|
+
//# sourceMappingURL=TdtImageryProvider.js.map
|