在开放图层库中,以下是用于将屏幕坐标转换为经纬度的方法。我无法弄清楚这个方法封装的逻辑?
getLatLonFromPoint: function (point) {
var center = this.getCenter();
//map center lat/lon
var res = this.getResolution();
//pre defined by the user. Represents the change in lat long per screen unit at the given zoom level
var size = this.getSize();
//this is the width and height of the div in which the map has to be displayed
var delta_x = point.x - (size.w / 2);
var delta_y = point.y - (size.h / 2);
return new OpenLayers.LatLon(
center.lat - delta_y * res,
center.lon + delta_x * res );
}
有人可以提供一些指示吗?