【ArcGIS for Android】经纬度坐标、地图投影坐标、屏幕坐标互相转换

 

SpatialReference mSR4326 = SpatialReference.create(4326);
SpatialReference mSR3857 = SpatialReference.create(3857);

 

1. 屏幕坐标转换成投影坐标

@Override
public boolean onSingleTap(MotionEvent point) {

SpatialReference sr = map.getSpatialReference();

Point dp = map.toMapPoint(point.getX(), point.getY());

}


2. 投影坐标转换成经纬度

Point wgsPoint = (Point) GeometryEngine.project(dp ,map.getSpatialReference(),mSR3857);

3、经纬度转换成投影坐标

Point mapPoint = (Point) GeometryEngine.project(wgsPoint ,mSR4326,map.getSpatialReference());

4、投影坐标转换成屏幕坐标

Point screenPoint = map.toScreenPoint(mapPoint);

posted @ 2017-03-28 17:03  咸鱼翻身  阅读(6326)  评论(1编辑  收藏  举报