openlayers bbox坐标 投影转化

var proj4326 = new OpenLayers.Projection(“EPSG:4326”); // 初始坐标系var proj900913 = new OpenLayers.Projection(“EPSG:900913”); //需要转化的坐标
/**
* 转化EPSG:900913坐标
* @param {}
* geo
* @return {}
*/
function project2M(geo)
{
geo.transform(proj4326, map.getProjectionObject());
return geo;
}
/**
* 转化为WGS84坐标
*
* @param {}
* geo
* @return {}
*/
function project2WGS(geo)
{
geo.transform(map.getProjectionObject(), proj4326);
return geo;
}

//OpenLayers.Projection.addTransform:添加坐标系转换关系
转载自:https://blog.csdn.net/miss_kiss/article/details/83709349

You may also like...