[android|ios|osx] Fix return type for pixelForLatLng
This commit is contained in:
@@ -1531,7 +1531,7 @@ jobject JNICALL nativePixelForLatLng(JNIEnv *env, jobject obj, jlong nativeMapVi
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
mbgl::vec2<double> pixel = nativeMapView->getMap().pixelForLatLng(mbgl::LatLng(latitude, longitude));
|
||||
mbgl::ScreenCoordinate pixel = nativeMapView->getMap().pixelForLatLng(mbgl::LatLng(latitude, longitude));
|
||||
|
||||
jobject ret = env->NewObject(pointFClass, pointFConstructorId, static_cast<jfloat>(pixel.x), static_cast<jfloat>(pixel.y));
|
||||
if (ret == nullptr) {
|
||||
|
||||
@@ -2177,7 +2177,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
|
||||
/// Converts a geographic coordinate to a point in the view’s coordinate system.
|
||||
- (CGPoint)convertLatLng:(mbgl::LatLng)latLng toPointToView:(nullable UIView *)view
|
||||
{
|
||||
mbgl::vec2<double> pixel = _mbglMap->pixelForLatLng(latLng);
|
||||
mbgl::ScreenCoordinate pixel = _mbglMap->pixelForLatLng(latLng);
|
||||
return [self convertPoint:CGPointMake(pixel.x, pixel.y) toView:view];
|
||||
}
|
||||
|
||||
|
||||
@@ -2165,7 +2165,7 @@ public:
|
||||
|
||||
/// Converts a geographic coordinate to a point in the view’s coordinate system.
|
||||
- (NSPoint)convertLatLng:(mbgl::LatLng)latLng toPointToView:(nullable NSView *)view {
|
||||
mbgl::vec2<double> pixel = _mbglMap->pixelForLatLng(latLng);
|
||||
mbgl::ScreenCoordinate pixel = _mbglMap->pixelForLatLng(latLng);
|
||||
// Cocoa origin is at the lower-left corner.
|
||||
pixel.y = NSHeight(self.bounds) - pixel.y;
|
||||
return [self convertPoint:NSMakePoint(pixel.x, pixel.y) toView:view];
|
||||
|
||||
Reference in New Issue
Block a user