使用移动GIS平台Imobile 9d 901,在获取当前坐标后。直接使用setCenter方法,发现移动位置错误,需要经过转化后,才能正常移动。
错误移动
Point2D center = new Point2D(mCenterL, mCenterB);
mMapControl.getMap().setCenter(center);
mMapControl.getMap().refresh();
正常移动
Point2D center = new Point2D(mCenterL, mCenterB);
PrjCoordSys Prj = mMapControl.getMap().getPrjCoordSys();
if (Prj.getType() != PrjCoordSysType.PCS_EARTH_LONGITUDE_LATITUDE) {
Point2Ds points = new Point2Ds();
points.add(center);
PrjCoordSys desPrjCoorSys = new PrjCoordSys();
desPrjCoorSys.setType(PrjCoordSysType.PCS_EARTH_LONGITUDE_LATITUDE);
CoordSysTranslator.convert(points, desPrjCoorSys, Prj,
new CoordSysTransParameter(),
CoordSysTransMethod.MTH_GEOCENTRIC_TRANSLATION);
center.setX(points.getItem(0).getX());
center.setY(points.getItem(0).getY());
}
mMapControl.getMap().setCenter(center);
mMapControl.getMap().refresh();