OpenLayers获取map图片左下角和左上角经纬度

//map
var map = new ol.Map({...});
//获取图像
var view = map.getView();
//获取一个经纬度的数组(两组数据)->[13417639.537659956, 3657508.94839583, 13434990.743080692, 3682503.8566450826]
var arr = view.calculateExtent(map.getSize());
//经纬度转换,只能转单个经纬度,没有找到可以转多个经纬度的方法->[120.53270673486327, 31.190461288984906]
var itude= ol.proj.transform([13417639.537659956, 3657508.94839583], 'EPSG:3857', 'EPSG:4326')

转载自:https://blog.csdn.net/qq_20349639/article/details/80707148

You may also like...