compensate for Android screen ratio in conversion routines

This commit is contained in:
Justin R. Miller
2015-07-30 16:24:17 -07:00
parent 88d7a92655
commit b88fc75f74

View File

@@ -490,11 +490,12 @@ public class MapView extends SurfaceView {
}
public LatLng fromScreenLocation(PointF point) {
return mNativeMapView.latLngForPixel(point);
return mNativeMapView.latLngForPixel(new PointF(point.x / mScreenDensity, point.y / mScreenDensity));
}
public PointF toScreenLocation(LatLng location) {
return mNativeMapView.pixelForLatLng(location);
PointF point = mNativeMapView.pixelForLatLng(location);
return new PointF(point.x * mScreenDensity, point.y * mScreenDensity);
}
//