Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios, osx] Wrap coordinates converted from points
Browse files Browse the repository at this point in the history
ref #4444
  • Loading branch information
1ec5 committed Mar 24, 2016
1 parent 34cea82 commit fc76689
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2150,7 +2150,7 @@ - (CLLocationCoordinate2D)convertPoint:(CGPoint)point toCoordinateFromView:(null
- (mbgl::LatLng)convertPoint:(CGPoint)point toLatLngFromView:(nullable UIView *)view
{
CGPoint convertedPoint = [self convertPoint:point fromView:view];
return _mbglMap->latLngForPixel(mbgl::ScreenCoordinate(convertedPoint.x, convertedPoint.y));
return _mbglMap->latLngForPixel(mbgl::ScreenCoordinate(convertedPoint.x, convertedPoint.y)).wrapped();
}

- (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(nullable UIView *)view
Expand Down
2 changes: 1 addition & 1 deletion platform/osx/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2160,7 +2160,7 @@ - (CLLocationCoordinate2D)convertPoint:(NSPoint)point toCoordinateFromView:(null
convertedPoint.x,
// mbgl origin is at the top-left corner.
NSHeight(self.bounds) - convertedPoint.y,
});
}).wrapped();
}

- (NSRect)convertCoordinateBounds:(MGLCoordinateBounds)bounds toRectToView:(nullable NSView *)view {
Expand Down

0 comments on commit fc76689

Please sign in to comment.