[core, ios, osx, android, glfw] Flipped origin of Map::latLngForPixel(), Map::pixelForLatLng()
Map and Transform methods assume an origin at the top-left corner of the view, like iOS, Android, and GLFW but unlike OS X. Transform is responsible for flipping coordinates between the top-left origin of Map and the bottom-left origin of TransformState. Fixes #3574.
This commit is contained in:
committed by
Minh Nguyễn
parent
bf87eaa7b8
commit
47b69100f9
@@ -2264,9 +2264,6 @@ public final class MapView extends FrameLayout {
|
||||
float x = point.x;
|
||||
float y = point.y;
|
||||
|
||||
// flip y direction vertically to match core GL
|
||||
y = getHeight() - y;
|
||||
|
||||
return mNativeMapView.latLngForPixel(new PointF(x / mScreenDensity, y / mScreenDensity));
|
||||
}
|
||||
|
||||
@@ -2289,9 +2286,6 @@ public final class MapView extends FrameLayout {
|
||||
float x = point.x * mScreenDensity;
|
||||
float y = point.y * mScreenDensity;
|
||||
|
||||
// flip y direction vertically to match core GL
|
||||
y = getHeight() - y;
|
||||
|
||||
return new PointF(x, y);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user