Just a few bug fixes
This commit is contained in:
@@ -228,6 +228,8 @@
|
||||
4BC5769425E3D3D6006E06EB /* MGLUserLocationAnnotationViewStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC5769125E3D3D6006E06EB /* MGLUserLocationAnnotationViewStyle.h */; };
|
||||
4BC5769525E3D3D6006E06EB /* MGLUserLocationAnnotationViewStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BC5769225E3D3D6006E06EB /* MGLUserLocationAnnotationViewStyle.m */; };
|
||||
4BC5769625E3D3D6006E06EB /* MGLUserLocationAnnotationViewStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BC5769225E3D3D6006E06EB /* MGLUserLocationAnnotationViewStyle.m */; };
|
||||
4BC576C925E443CE006E06EB /* MGLFaux3DUserLocationAnnotationView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BC576C825E443CE006E06EB /* MGLFaux3DUserLocationAnnotationView.mm */; };
|
||||
4BC576CA25E443CE006E06EB /* MGLFaux3DUserLocationAnnotationView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BC576C825E443CE006E06EB /* MGLFaux3DUserLocationAnnotationView.mm */; };
|
||||
550570C622958FB400228ECF /* MGLMapView+Impl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 550570C422958FB300228ECF /* MGLMapView+Impl.mm */; };
|
||||
550570C722958FB400228ECF /* MGLMapView+Impl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 550570C422958FB300228ECF /* MGLMapView+Impl.mm */; };
|
||||
550570C822958FB400228ECF /* MGLMapView+Impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 550570C522958FB400228ECF /* MGLMapView+Impl.h */; };
|
||||
@@ -534,7 +536,6 @@
|
||||
DA88485A1CBAFB9800AB86E3 /* MGLUserLocation_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA88484B1CBAFB9800AB86E3 /* MGLUserLocation_Private.h */; };
|
||||
DA88485B1CBAFB9800AB86E3 /* MGLUserLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88484C1CBAFB9800AB86E3 /* MGLUserLocation.m */; };
|
||||
DA88485C1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.h in Headers */ = {isa = PBXBuildFile; fileRef = DA88484D1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.h */; };
|
||||
DA88485D1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88484E1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.m */; };
|
||||
DA8848601CBAFC2E00AB86E3 /* Mapbox.h in Headers */ = {isa = PBXBuildFile; fileRef = DA88485E1CBAFC2E00AB86E3 /* Mapbox.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
DA88488B1CBB037E00AB86E3 /* SMCalloutView.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8848891CBB037E00AB86E3 /* SMCalloutView.h */; };
|
||||
DA88488C1CBB037E00AB86E3 /* SMCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88488A1CBB037E00AB86E3 /* SMCalloutView.m */; };
|
||||
@@ -572,7 +573,6 @@
|
||||
DAA4E42F1CBB730400178DFB /* MGLCompactCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848451CBAFB9800AB86E3 /* MGLCompactCalloutView.m */; };
|
||||
DAA4E4321CBB730400178DFB /* MGLMapView.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA88484A1CBAFB9800AB86E3 /* MGLMapView.mm */; };
|
||||
DAA4E4331CBB730400178DFB /* MGLUserLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88484C1CBAFB9800AB86E3 /* MGLUserLocation.m */; };
|
||||
DAA4E4341CBB730400178DFB /* MGLFaux3DUserLocationAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88484E1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.m */; };
|
||||
DAA4E4351CBB730400178DFB /* SMCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88488A1CBB037E00AB86E3 /* SMCalloutView.m */; };
|
||||
DAAF722B1DA903C700312FA4 /* MGLStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAF72291DA903C700312FA4 /* MGLStyleValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
DAAF722C1DA903C700312FA4 /* MGLStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAF72291DA903C700312FA4 /* MGLStyleValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -913,6 +913,7 @@
|
||||
40FDA76A1CCAAA6800442548 /* MBXAnnotationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBXAnnotationView.m; sourceTree = "<group>"; };
|
||||
4BC5769125E3D3D6006E06EB /* MGLUserLocationAnnotationViewStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLUserLocationAnnotationViewStyle.h; sourceTree = "<group>"; };
|
||||
4BC5769225E3D3D6006E06EB /* MGLUserLocationAnnotationViewStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLUserLocationAnnotationViewStyle.m; sourceTree = "<group>"; };
|
||||
4BC576C825E443CE006E06EB /* MGLFaux3DUserLocationAnnotationView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFaux3DUserLocationAnnotationView.mm; sourceTree = "<group>"; };
|
||||
550570C422958FB300228ECF /* MGLMapView+Impl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "MGLMapView+Impl.mm"; sourceTree = "<group>"; };
|
||||
550570C522958FB400228ECF /* MGLMapView+Impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MGLMapView+Impl.h"; sourceTree = "<group>"; };
|
||||
554180411D2E97DE00012372 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
|
||||
@@ -1190,7 +1191,6 @@
|
||||
DA88484B1CBAFB9800AB86E3 /* MGLUserLocation_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLUserLocation_Private.h; sourceTree = "<group>"; };
|
||||
DA88484C1CBAFB9800AB86E3 /* MGLUserLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLUserLocation.m; sourceTree = "<group>"; };
|
||||
DA88484D1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFaux3DUserLocationAnnotationView.h; sourceTree = "<group>"; };
|
||||
DA88484E1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLFaux3DUserLocationAnnotationView.m; sourceTree = "<group>"; };
|
||||
DA88485E1CBAFC2E00AB86E3 /* Mapbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mapbox.h; path = src/Mapbox.h; sourceTree = SOURCE_ROOT; };
|
||||
DA8848891CBB037E00AB86E3 /* SMCalloutView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMCalloutView.h; sourceTree = "<group>"; };
|
||||
DA88488A1CBB037E00AB86E3 /* SMCalloutView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMCalloutView.m; sourceTree = "<group>"; };
|
||||
@@ -2132,6 +2132,7 @@
|
||||
DAD165841CF4D06B001FF4B9 /* Annotations */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4BC576C825E443CE006E06EB /* MGLFaux3DUserLocationAnnotationView.mm */,
|
||||
404326881D5B9B1A007111BD /* MGLAnnotationContainerView_Private.h */,
|
||||
40EDA1BD1CFE0D4A00D9EA68 /* MGLAnnotationContainerView.h */,
|
||||
40EDA1BE1CFE0D4A00D9EA68 /* MGLAnnotationContainerView.m */,
|
||||
@@ -2145,7 +2146,6 @@
|
||||
DA8848441CBAFB9800AB86E3 /* MGLCompactCalloutView.h */,
|
||||
DA8848451CBAFB9800AB86E3 /* MGLCompactCalloutView.m */,
|
||||
DA88484D1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.h */,
|
||||
DA88484E1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.m */,
|
||||
DA88484B1CBAFB9800AB86E3 /* MGLUserLocation_Private.h */,
|
||||
DA8848391CBAFB8500AB86E3 /* MGLUserLocation.h */,
|
||||
DA88484C1CBAFB9800AB86E3 /* MGLUserLocation.m */,
|
||||
@@ -2995,7 +2995,6 @@
|
||||
3510FFEC1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm in Sources */,
|
||||
DAED38651D62D0FC00D7640F /* NSURL+MGLAdditions.m in Sources */,
|
||||
354B83981D2E873E005D9406 /* MGLUserLocationAnnotationView.m in Sources */,
|
||||
DA88485D1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.m in Sources */,
|
||||
DAD165701CF41981001FF4B9 /* MGLFeature.mm in Sources */,
|
||||
30E578191DAA855E0050F07E /* UIImage+MGLAdditions.mm in Sources */,
|
||||
550570C622958FB400228ECF /* MGLMapView+Impl.mm in Sources */,
|
||||
@@ -3043,6 +3042,7 @@
|
||||
35D13AB91D3D15E300AFB4E0 /* MGLStyleLayer.mm in Sources */,
|
||||
74CB5EB3219B252C00102936 /* MGLStyleLayerManager.mm in Sources */,
|
||||
DA35A2CB1CCAAAD200E826B2 /* NSValue+MGLAdditions.m in Sources */,
|
||||
4BC576C925E443CE006E06EB /* MGLFaux3DUserLocationAnnotationView.mm in Sources */,
|
||||
071BBB001EE7613F001FB02A /* MGLImageSource.mm in Sources */,
|
||||
DA8848321CBAFA6200AB86E3 /* NSString+MGLAdditions.m in Sources */,
|
||||
408AA8581DAEDA1E00022900 /* NSDictionary+MGLAdditions.mm in Sources */,
|
||||
@@ -3139,6 +3139,7 @@
|
||||
DA35A2CC1CCAAAD200E826B2 /* NSValue+MGLAdditions.m in Sources */,
|
||||
408AA8591DAEDA1E00022900 /* NSDictionary+MGLAdditions.mm in Sources */,
|
||||
74CB5EB4219B252C00102936 /* MGLStyleLayerManager.mm in Sources */,
|
||||
4BC576CA25E443CE006E06EB /* MGLFaux3DUserLocationAnnotationView.mm in Sources */,
|
||||
DAA4E4281CBB730400178DFB /* MGLTypes.m in Sources */,
|
||||
DA35A2A21CC9E95F00E826B2 /* MGLCoordinateFormatter.m in Sources */,
|
||||
357FE2E01E02D2B20068B753 /* NSCoder+MGLAdditions.mm in Sources */,
|
||||
@@ -3156,7 +3157,6 @@
|
||||
355AE0021E9281DA00F3939D /* MGLScaleBar.mm in Sources */,
|
||||
4018B1C81CDC287F00F666AF /* MGLAnnotationView.mm in Sources */,
|
||||
07D8C6FB1F67560100381808 /* MGLComputedShapeSource.mm in Sources */,
|
||||
DAA4E4341CBB730400178DFB /* MGLFaux3DUserLocationAnnotationView.m in Sources */,
|
||||
DACA86292019218600E9693A /* MGLRasterDEMSource.mm in Sources */,
|
||||
35B82BFB1D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm in Sources */,
|
||||
966FCF4F1F3A5C9200F2B6DE /* MGLUserLocationHeadingBeamLayer.m in Sources */,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#import "MGLFaux3DUserLocationAnnotationView.h"
|
||||
|
||||
#import "MGLMapView.h"
|
||||
#import "MGLMapView_Private.h"
|
||||
#import "MGLMapViewDelegate.h"
|
||||
#import "MGLUserLocation.h"
|
||||
#import "MGLUserLocationHeadingIndicator.h"
|
||||
@@ -32,7 +32,7 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
CALayer *_dotBorderLayer;
|
||||
CALayer *_dotLayer;
|
||||
CALayer *_haloLayer;
|
||||
|
||||
|
||||
CALayer *_approximateLayer;
|
||||
|
||||
CLLocationDirection _oldHeadingAccuracy;
|
||||
@@ -72,6 +72,8 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)drawPreciseLocationPuck {
|
||||
@@ -86,7 +88,6 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
_haloLayer.hidden = ! CLLocationCoordinate2DIsValid(self.mapView.userLocation.coordinate) || self.mapView.userLocation.location.horizontalAccuracy > 10;
|
||||
}
|
||||
|
||||
|
||||
- (void)setTintColor:(UIColor *)tintColor
|
||||
{
|
||||
UIColor *puckArrowFillColor = tintColor;
|
||||
@@ -129,6 +130,7 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
_dotLayer.backgroundColor = [dotFillColor CGColor];
|
||||
[_headingIndicatorLayer updateTintColor:[headingFillColor CGColor]];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)updatePitch
|
||||
@@ -202,12 +204,12 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
|
||||
[self updateFrameWithSize:MGLUserLocationAnnotationPuckSize];
|
||||
}
|
||||
|
||||
|
||||
UIColor *arrowColor = self.mapView.tintColor;
|
||||
UIColor *puckShadowColor = UIColor.blackColor;
|
||||
CGFloat shadowOpacity = 0.25;
|
||||
|
||||
|
||||
|
||||
if ([self.mapView.delegate respondsToSelector:@selector(mapViewStyleForDefaultUserLocationAnnotationView:)]) {
|
||||
MGLUserLocationAnnotationViewStyle *style = [self.mapView.delegate mapViewStyleForDefaultUserLocationAnnotationView:self.mapView];
|
||||
arrowColor = style.puckArrowFillColor ? style.puckArrowFillColor : arrowColor;
|
||||
@@ -296,13 +298,13 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
|
||||
[self updateFrameWithSize:MGLUserLocationAnnotationDotSize];
|
||||
}
|
||||
|
||||
|
||||
|
||||
UIColor *haloColor = self.mapView.tintColor;
|
||||
UIColor *puckBackgroundColor = self.mapView.tintColor;
|
||||
UIColor *puckShadowColor = UIColor.blackColor;
|
||||
CGFloat shadowOpacity = 0.25;
|
||||
|
||||
|
||||
if ([self.mapView.delegate respondsToSelector:@selector(mapViewStyleForDefaultUserLocationAnnotationView:)]) {
|
||||
MGLUserLocationAnnotationViewStyle *style = [self.mapView.delegate mapViewStyleForDefaultUserLocationAnnotationView:self.mapView];
|
||||
haloColor = style.haloFillColor ? style.haloFillColor : haloColor;
|
||||
@@ -379,7 +381,7 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
//
|
||||
if (_accuracyRingLayer && (_oldZoom != self.mapView.zoomLevel || _oldHorizontalAccuracy != self.userLocation.location.horizontalAccuracy))
|
||||
{
|
||||
CGFloat accuracyRingSize = [self calculateAccuracyRingSize];
|
||||
CGFloat accuracyRingSize = [self calculateAccuracyRingSize: self.mapView.zoomLevel];
|
||||
|
||||
// only show the accuracy ring if it won't be obscured by the location dot
|
||||
if (accuracyRingSize > MGLUserLocationAnnotationDotSize + 15)
|
||||
@@ -421,7 +423,7 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
//
|
||||
if ( ! _accuracyRingLayer && self.userLocation.location.horizontalAccuracy)
|
||||
{
|
||||
CGFloat accuracyRingSize = [self calculateAccuracyRingSize];
|
||||
CGFloat accuracyRingSize = [self calculateAccuracyRingSize: self.mapView.zoomLevel];
|
||||
_accuracyRingLayer = [self circleLayerWithSize:accuracyRingSize];
|
||||
_accuracyRingLayer.backgroundColor = [self.mapView.tintColor CGColor];
|
||||
_accuracyRingLayer.opacity = 0.1;
|
||||
@@ -518,10 +520,12 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
|
||||
[self updateFaux3DEffect];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)drawApproximate
|
||||
{
|
||||
|
||||
if ( ! _approximateModeActivated)
|
||||
{
|
||||
self.layer.sublayers = nil;
|
||||
@@ -533,15 +537,15 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
_haloLayer = nil;
|
||||
_puckDot = nil;
|
||||
_puckArrow = nil;
|
||||
|
||||
|
||||
_approximateModeActivated = YES;
|
||||
}
|
||||
|
||||
|
||||
UIColor *backgroundColor = self.mapView.tintColor;
|
||||
UIColor *strokeColor = UIColor.blackColor;
|
||||
CGFloat borderSize = 2.0;
|
||||
CGFloat opacity = 0.25;
|
||||
|
||||
|
||||
if ([self.mapView.delegate respondsToSelector:@selector(mapViewStyleForDefaultUserLocationAnnotationView:)]) {
|
||||
MGLUserLocationAnnotationViewStyle *style = [self.mapView.delegate mapViewStyleForDefaultUserLocationAnnotationView:self.mapView];
|
||||
if (@available(iOS 14, *)) {
|
||||
@@ -552,17 +556,31 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
}
|
||||
}
|
||||
|
||||
// approximate ring
|
||||
if ( ! _approximateLayer && self.userLocation.location.horizontalAccuracy)
|
||||
{
|
||||
CGFloat accuracyRingSize = [self calculateAccuracyRingSize: MAX(self.mapView.zoomLevel, MGLUserLocationApproximateZoomThreshold)];
|
||||
_approximateLayer = [self circleLayerWithSize:accuracyRingSize];
|
||||
_approximateLayer.backgroundColor = [backgroundColor CGColor];
|
||||
_approximateLayer.opacity = opacity;
|
||||
_approximateLayer.shouldRasterize = NO;
|
||||
_approximateLayer.allowsGroupOpacity = NO;
|
||||
_approximateLayer.borderWidth = borderSize;
|
||||
_approximateLayer.borderColor = [strokeColor CGColor];
|
||||
|
||||
[self.layer addSublayer:_approximateLayer];
|
||||
}
|
||||
|
||||
// update approximate ring (if zoom or horizontal accuracy have changed)
|
||||
if (_approximateLayer && (_oldZoom != self.mapView.zoomLevel || _oldHorizontalAccuracy != self.userLocation.location.horizontalAccuracy))
|
||||
{
|
||||
CGFloat borderWidth = 2;
|
||||
if (self.mapView.zoomLevel < MGLUserLocationApproximateZoomThreshold) {
|
||||
borderSize = 3;
|
||||
borderSize = 1.0;
|
||||
}
|
||||
_approximateLayer.borderWidth = borderSize;
|
||||
|
||||
|
||||
if (self.mapView.zoomLevel >= MGLUserLocationApproximateZoomThreshold) {
|
||||
CGFloat accuracyRingSize = [self calculateAccuracyRingSize];
|
||||
CGFloat accuracyRingSize = [self calculateAccuracyRingSize: self.mapView.zoomLevel];
|
||||
|
||||
_approximateLayer.hidden = NO;
|
||||
|
||||
@@ -577,26 +595,11 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
|
||||
[CATransaction commit];
|
||||
}
|
||||
|
||||
|
||||
// store accuracy and zoom so we're not redrawing unchanged location updates
|
||||
_oldHorizontalAccuracy = self.userLocation.location.horizontalAccuracy;
|
||||
_oldZoom = self.mapView.zoomLevel;
|
||||
}
|
||||
|
||||
// approximate ring
|
||||
if ( ! _approximateLayer && self.userLocation.location.horizontalAccuracy)
|
||||
{
|
||||
CGFloat accuracyRingSize = [self calculateAccuracyRingSize];
|
||||
_approximateLayer = [self circleLayerWithSize:accuracyRingSize];
|
||||
approximateLayer.backgroundColor = [backgroundColor CGColor];
|
||||
_approximateLayer.opacity = opacity;
|
||||
_approximateLayer.shouldRasterize = NO;
|
||||
_approximateLayer.allowsGroupOpacity = NO;
|
||||
_approximateLayer.borderWidth = borderSize;
|
||||
_approximateLayer.borderColor = [strokeColor CGColor];
|
||||
|
||||
[self.layer addSublayer:_approximateLayer];
|
||||
}
|
||||
}
|
||||
|
||||
- (CALayer *)circleLayerWithSize:(CGFloat)layerSize
|
||||
@@ -625,10 +628,10 @@ const CGFloat MGLUserLocationApproximateZoomThreshold = 7.0;
|
||||
return animationGroup;
|
||||
}
|
||||
|
||||
- (CGFloat)calculateAccuracyRingSize
|
||||
- (CGFloat)calculateAccuracyRingSize:(double)zoomLevel
|
||||
{
|
||||
// diameter in screen points
|
||||
return round(self.userLocation.location.horizontalAccuracy / [self.mapView metersPerPointAtLatitude:self.userLocation.coordinate.latitude] * 2.0);
|
||||
return round(self.userLocation.location.horizontalAccuracy / [self.mapView metersPerPointAtLatitude:self.userLocation.coordinate.latitude zoomLevel:zoomLevel] * 2.0);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -2002,4 +2002,6 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic) MGLMapDebugMaskOptions debugMask;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -4056,6 +4056,11 @@ public:
|
||||
return mbgl::Projection::getMetersPerPixelAtLatitude(latitude, self.zoomLevel);
|
||||
}
|
||||
|
||||
- (CLLocationDistance)metersPerPointAtLatitude:(CLLocationDegrees)latitude zoomLevel:(double)zoomLevel
|
||||
{
|
||||
return mbgl::Projection::getMetersPerPixelAtLatitude(latitude, zoomLevel);
|
||||
}
|
||||
|
||||
#pragma mark - Camera Change Reason -
|
||||
|
||||
- (void)resetCameraChangeReason
|
||||
|
||||
@@ -46,6 +46,8 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const _Nonnull MGLUnderlyingMapUna
|
||||
- (void)didFailToLoadImage:(nonnull NSString *)imageName;
|
||||
- (BOOL)shouldRemoveStyleImage:(nonnull NSString *)imageName;
|
||||
|
||||
- (CLLocationDistance)metersPerPointAtLatitude:(CLLocationDegrees)latitude zoomLevel:(double)zoomLevel;
|
||||
|
||||
/** Triggers another render pass even when it is not necessary. */
|
||||
- (void)setNeedsRerender;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user