Closed GoogleCodeExporter closed 8 years ago
I don't see a problem in fromPixels but rather in toPixels. Even when calling
toPixels() of the mapcenter, the Result is very odd.
Try:
mapView.getProjection().toPixels(mapView.getMapCenter(), out)
Expected:
out should point to mapView.height/2, mapView.width/2
Actual Result:
out points to -18944, -6912
Original comment by tobias.n...@gmail.com
on 7 Feb 2012 at 2:21
mMapView.getOverlays().add( new Overlay(this)
{
@Override
protected void draw(Canvas arg0, MapView map, boolean arg2)
{
Projection projecton = map.getProjection();
IGeoPoint gepoint = map.getMapCenter();
Point point = projecton.toPixels(gepoint, null);
Log.d(TAG, "Found center ("+gepoint.getLatitudeE6()+","+gepoint.getLongitudeE6()+") matching screen point ("+point.x+","+point.y+") ");
}
} );
The osmdroid projection only returns nonsense:
05-13 21:23:57.328: D/OsmMap(24173): Found center (48875554,5899658) matching
screen point (4296,-40908)
Original comment by rcgr...@gmail.com
on 13 May 2012 at 7:25
Original comment by kurtzm...@gmail.com
on 10 Dec 2013 at 9:42
Fixed in Github.
Original comment by kurtzm...@gmail.com
on 16 Apr 2014 at 10:29
Original issue reported on code.google.com by
jpetti...@gmail.com
on 22 Dec 2011 at 10:09