日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

使用openlayers投影阿伯斯(Albers)

發布時間:2023/12/10 编程问答 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 使用openlayers投影阿伯斯(Albers) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

ps:實習第一周
因業務需求需要使用阿伯斯投影(Albers)
順便提供個查詢坐標系的網址:http://epsg.io/
沒學過openlayers所以開始學習

遇到問題

前面和正常投影轉換一樣
https://blog.csdn.net/SmileCoffin/article/details/56278882
問題是 轉換的坐標在實際使用出現偏差
必須電腦上點擊獲取坐標才行
設置可視范圍 使用坐標轉換出現誤差 只能自己修改
let extent = [8088444.867106596,1576952.1725742612,19821007.30158975,7643807.013628789]

<script> import proj4 from 'proj4'; import Projection from 'ol/proj/Projection'; import {register} from 'ol/proj/proj4'; import 'ol/ol.css'; import {Map, View} from 'ol'; import TileLayer from 'ol/layer/Tile'; import OSM from 'ol/source/OSM'; import {transform} from 'ol/proj' import {getCenter} from 'ol/extent' export default {mounted() {this.initmap()},methods: {initmap(){proj4.defs("ESRI:102028","+proj=aea+ at_1=7+lat_2=-32+lat_0=-15+lon_0=125+x_0=0+y_0=0+datum=WGS84+units=m+no_defs");// proj4.defs("EPSG:4490","+proj=longlat +ellps=GRS80 +no_defs");register(proj4)var projectionAb = new Projection({code: 'EPSG:102028',units: 'm',axisOrientation: 'neu',global: false});let extent = [8088444.867106596,1576952.1725742612,19821007.30158975,7643807.013628789]const map = new Map({target: 'map',layers: [new TileLayer({source: new OSM()})],view: new View({projection: projectionAb,center:getCenter(extent),extent:extent,zoom: 1})});map.on('click', function(event){console.log(event.coordinate)})console.log(getCenter(extent),'點擊獲取坐標')}}, } </script>

總結

以上是生活随笔為你收集整理的使用openlayers投影阿伯斯(Albers)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。