Open GoogleCodeExporter opened 8 years ago
How can I get the coordinates ,that origin is the upper left corner of the
mapview
Original comment by hanhe...@gmail.com
on 12 Oct 2013 at 10:47
I tested this.
GeoPoint point = new GeoPoint((int) (39.90923 * 1E6), (int) (116.397428 * 1E6));
Point pntC = mapView.getProjection().toPixels(point,null);
IGeoPoint point2 = mapView.getProjection().fromPixels(pntC.x, pntC.y);
point2 is (84254150,230097656)
point point2 not equal
Original comment by hanhe...@gmail.com
on 14 Oct 2013 at 3:11
I changed toPixels like this :
@Override
public Point toPixels(final IGeoPoint in, final Point out) {
Point pnt = toMapPixels(in, out);
final Rect screenRect = getIntrinsicScreenRect();
pnt.x = pnt.x - screenRect.left ;
pnt.y = pnt.y - screenRect.top ;
return pnt;
}
It worked!i
Original comment by hanhe...@gmail.com
on 14 Oct 2013 at 3:14
Original issue reported on code.google.com by
hanhe...@gmail.com
on 12 Oct 2013 at 10:33