diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 571f6b51b8..12275c1e29 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,12 +1,2 @@ -# iOS -/platform/ios/ @mapbox/maps-ios-reviewers -/platform/ios/docs/ @mapbox/docs - -# macOS -/platform/macos/ @1ec5 @mapbox/maps-ios-reviewers -/platform/macos/docs @mapbox/docs - - -# Darwin -/platform/darwin/ @1ec5 @mapbox/maps-ios-reviewers +@mapbox/maps-ios diff --git a/README.md b/README.md index 5e68d453aa..3c1ec56ff6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Mapbox Maps SDKs for iOS and macOS -Mapbox Maps SDK v10 beta is now available at [mapbox/mapbox-maps-ios](https://github.com/mapbox/mapbox-maps-ios). Mapbox maintains this repo to address bug fixes and security vulnerabilities. +The latest version of Mapbox Maps SDK is now available at [mapbox/mapbox-maps-ios](https://github.com/mapbox/mapbox-maps-ios). This version offers superior performance, features, and developer experience, and is the recommended mobile SDK solution for all Mapbox customers. +Mapbox maintains this repo to address bug fixes and security vulnerabilities. Please note that this project will cease to receive updates, including compatibility and bugfixes, after April 4, 2023. [Here is a helpful guide](https://docs.mapbox.com/ios/maps/guides/) about our latest SDK features and how to migrate to our latest version. The Mapbox Maps SDK for iOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 9.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://www.mapbox.com/developers/vector-tiles/), and renders them using Mapbox GL Native. diff --git a/package.json b/package.json index 2a44ec2392..9145b48859 100644 --- a/package.json +++ b/package.json @@ -28,11 +28,11 @@ "csscolorparser": "~1.0.2", "d3-queue": "3.0.7", "diff": "4.0.1", - "ejs": "^2.5.7", + "ejs": "^3.1.7", "esm": "~3.2.25", "express": "^4.11.1", "json-stringify-pretty-compact": "^2.0.0", - "jsonwebtoken": "^8.3.0", + "jsonwebtoken": "^9.0.0", "lodash": "^4.16.4", "lodash.template": "4.5.0", "mapbox-gl-styles": "2.0.2", diff --git a/platform/ios/src/MGLFaux3DUserLocationAnnotationView.mm b/platform/ios/src/MGLFaux3DUserLocationAnnotationView.mm index 8a68fb5bc3..6fa92b4b5a 100644 --- a/platform/ios/src/MGLFaux3DUserLocationAnnotationView.mm +++ b/platform/ios/src/MGLFaux3DUserLocationAnnotationView.mm @@ -72,8 +72,6 @@ - (void)update } } - - } - (void)drawPreciseLocationPuck { @@ -92,6 +90,8 @@ - (void)setTintColor:(UIColor *)tintColor { UIColor *puckArrowFillColor = tintColor; UIColor *puckArrowStrokeColor = tintColor; + UIColor *puckBorderBackgroundColor = UIColor.whiteColor; + UIColor *puckArrowBackgroundColor = UIColor.whiteColor; UIColor *approximateFillColor = tintColor; @@ -104,6 +104,7 @@ - (void)setTintColor:(UIColor *)tintColor MGLUserLocationAnnotationViewStyle *style = [self.mapView.delegate mapViewStyleForDefaultUserLocationAnnotationView:self.mapView]; puckArrowFillColor = style.puckArrowFillColor ? style.puckArrowFillColor : puckArrowFillColor; + puckArrowBackgroundColor = style.puckArrowBackgroundColor ? style.puckArrowBackgroundColor : puckArrowBackgroundColor; if (@available(iOS 14, *)) { approximateFillColor = style.approximateHaloFillColor ? style.approximateHaloFillColor : approximateFillColor; @@ -111,12 +112,14 @@ - (void)setTintColor:(UIColor *)tintColor haloFillColor = style.haloFillColor ? style.haloFillColor : haloFillColor; dotFillColor = style.puckFillColor ? style.puckFillColor : dotFillColor; + puckBorderBackgroundColor = style.puckBorderBackgroundColor ? style.puckBorderBackgroundColor : puckBorderBackgroundColor; headingFillColor = style.puckFillColor ? style.puckFillColor : headingFillColor; } if (_puckModeActivated) { _puckArrow.fillColor = [puckArrowFillColor CGColor]; + _puckArrow.backgroundColor = [puckArrowBackgroundColor CGColor]; _puckArrow.strokeColor = [puckArrowStrokeColor CGColor]; } else if (_approximateModeActivated) @@ -128,6 +131,7 @@ - (void)setTintColor:(UIColor *)tintColor _accuracyRingLayer.backgroundColor = [accuracyFillColor CGColor]; _haloLayer.backgroundColor = [haloFillColor CGColor]; _dotLayer.backgroundColor = [dotFillColor CGColor]; + _dotBorderLayer.backgroundColor = [puckBorderBackgroundColor CGColor]; [_headingIndicatorLayer updateTintColor:[headingFillColor CGColor]]; } @@ -206,14 +210,17 @@ - (void)drawPuck } UIColor *arrowColor = self.mapView.tintColor; + UIColor *puckArrowBackgroundColor = UIColor.whiteColor; + 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; puckShadowColor = style.puckShadowColor ? style.puckShadowColor : puckShadowColor; + puckArrowBackgroundColor = style.puckArrowBackgroundColor ? style.puckArrowBackgroundColor : puckArrowBackgroundColor; + shadowOpacity = style.puckShadowOpacity; } @@ -222,7 +229,7 @@ - (void)drawPuck if ( ! _puckDot) { _puckDot = [self circleLayerWithSize:MGLUserLocationAnnotationPuckSize]; - _puckDot.backgroundColor = [[UIColor whiteColor] CGColor]; + _puckDot.backgroundColor = [puckArrowBackgroundColor CGColor]; _puckDot.shadowColor = [puckShadowColor CGColor]; _puckDot.shadowOpacity = shadowOpacity; _puckDot.shadowPath = [[UIBezierPath bezierPathWithOvalInRect:_puckDot.bounds] CGPath]; @@ -302,6 +309,7 @@ - (void)drawDot UIColor *haloColor = self.mapView.tintColor; UIColor *puckBackgroundColor = self.mapView.tintColor; UIColor *puckShadowColor = UIColor.blackColor; + UIColor *puckBorderBackgroundColor = UIColor.whiteColor; CGFloat shadowOpacity = 0.25; @@ -310,6 +318,7 @@ - (void)drawDot haloColor = style.haloFillColor ? style.haloFillColor : haloColor; puckBackgroundColor = style.puckFillColor ? style.puckFillColor : puckBackgroundColor; puckShadowColor = style.puckShadowColor ? style.puckShadowColor : puckShadowColor; + puckBorderBackgroundColor = style.puckBorderBackgroundColor ? style.puckBorderBackgroundColor : puckBorderBackgroundColor; shadowOpacity = style.puckShadowOpacity; } @@ -467,7 +476,7 @@ - (void)drawDot if ( ! _dotBorderLayer) { _dotBorderLayer = [self circleLayerWithSize:MGLUserLocationAnnotationDotSize]; - _dotBorderLayer.backgroundColor = [[UIColor whiteColor] CGColor]; + _dotBorderLayer.backgroundColor = [puckBorderBackgroundColor CGColor]; _dotBorderLayer.shadowColor = [puckShadowColor CGColor]; _dotBorderLayer.shadowOpacity = shadowOpacity; _dotBorderLayer.shadowPath = [[UIBezierPath bezierPathWithOvalInRect:_dotBorderLayer.bounds] CGPath]; diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index cb2d21a6bb..5b77a1ca2e 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -41,6 +42,7 @@ #import "NSBundle+MGLAdditions.h" #import "NSDate+MGLAdditions.h" +#import "NSDictionary+MGLAdditions.h" #import "NSException+MGLAdditions.h" #import "NSPredicate+MGLPrivateAdditions.h" #import "NSString+MGLAdditions.h" @@ -138,6 +140,9 @@ typedef NS_ENUM(NSUInteger, MGLUserTrackingState) { /// Rotation threshold while a pinch gesture is occurring. static NSString * const MGLRotationThresholdWhileZoomingKey = @"MGLRotationThresholdWhileZooming"; +/// Key of a settings provisioning object. +static NSString * const MGLRendererSettingsKey = @"MGLRendererSettings"; + /// Reuse identifier and file name of the default point annotation image. static NSString * const MGLDefaultStyleMarkerSymbolName = @"default_marker"; @@ -532,6 +537,16 @@ - (void)commonInit // is not necessary here, since the shared manager already calls it. [MGLNetworkConfiguration sharedManager]; + // Provision in-memory settings from NSUserDefaults. + NSDictionary * provisioning = [[NSUserDefaults standardUserDefaults] dictionaryForKey:MGLRendererSettingsKey]; + if (provisioning != nil) { + mbgl::PropertyMap provisioningMap = provisioning.mgl_propertyMap; + auto& settings = mbgl::platform::Settings::getInstance(); + for (auto& pair : provisioningMap) { + settings.set(pair.first, pair.second); + } + } + self.accessibilityLabel = NSLocalizedStringWithDefaultValue(@"MAP_A11Y_LABEL", nil, nil, @"Map", @"Accessibility label"); self.accessibilityTraits = UIAccessibilityTraitAllowsDirectInteraction | UIAccessibilityTraitAdjustable; self.backgroundColor = [UIColor clearColor]; diff --git a/platform/ios/src/MGLUserLocationAnnotationViewStyle.h b/platform/ios/src/MGLUserLocationAnnotationViewStyle.h index 26c580a4c7..5d174eb631 100644 --- a/platform/ios/src/MGLUserLocationAnnotationViewStyle.h +++ b/platform/ios/src/MGLUserLocationAnnotationViewStyle.h @@ -11,9 +11,13 @@ MGL_EXPORT @interface MGLUserLocationAnnotationViewStyle : NSObject /** - The fill color for the puck view. + The fill color for the dot puck view. */ @property (nonatomic) UIColor *puckFillColor; +/** + The fill color for the background for the dot puck border. + */ +@property (nonatomic) UIColor *puckBorderBackgroundColor; /** The shadow color for the puck view. */ @@ -29,7 +33,11 @@ MGL_EXPORT */ @property (nonatomic) UIColor *puckArrowFillColor; /** - The fill color for the puck view. + The fill color for the background arrow puck. + */ +@property (nonatomic) UIColor *puckArrowBackgroundColor; +/** + The halo fill color for the puck view. */ @property (nonatomic) UIColor *haloFillColor; /**