[ios] Meters per point at latitude

Renamed -metersPerPixelAtLatitude: to -metersPerPointAtLatitude:, leaving the old name as a deprecated alias. In Cocoa Touch terminology, “point” is the visual unit backed by pixels.
This commit is contained in:
Minh Nguyễn
2015-12-22 17:06:43 -08:00
committed by Minh Nguyễn
parent 35aeb06fe2
commit d745ff0923
3 changed files with 14 additions and 7 deletions

View File

@@ -436,7 +436,7 @@ const CGFloat MGLUserLocationAnnotationArrowSize = MGLUserLocationAnnotationPuck
- (CGFloat)calculateAccuracyRingSize
{
CGFloat latRadians = self.annotation.coordinate.latitude * M_PI / 180.0f;
CGFloat pixelRadius = self.annotation.location.horizontalAccuracy / cos(latRadians) / [self.mapView metersPerPixelAtLatitude:self.annotation.coordinate.latitude];
CGFloat pixelRadius = self.annotation.location.horizontalAccuracy / cos(latRadians) / [self.mapView metersPerPointAtLatitude:self.annotation.coordinate.latitude];
return pixelRadius * 2;
}