From 2a78b17698c967d380418529f09808d3dc63b19b Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Fri, 13 Nov 2015 17:22:01 -0800 Subject: [PATCH 01/28] provide resource bundle search for premade frameworks --- platform/ios/NSBundle+MGLAdditions.m | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/platform/ios/NSBundle+MGLAdditions.m b/platform/ios/NSBundle+MGLAdditions.m index 3fca7384a..d5842ea59 100644 --- a/platform/ios/NSBundle+MGLAdditions.m +++ b/platform/ios/NSBundle+MGLAdditions.m @@ -8,8 +8,21 @@ void mgl_linkBundleCategory(){} + (NSString *)mgl_resourceBundlePath { - NSString *resourceBundlePath = [[NSBundle bundleForClass:[MGLMapView class]] pathForResource:@"Mapbox" ofType:@"bundle"]; + NSString *resourceBundlePath = nil; + // check for resource bundle in framework bundle (Fabric, premade framework) + // + NSString *frameworkBundlePath = [NSString stringWithFormat:@"%@/Mapbox.framework/Mapbox.bundle", + [[NSBundle mainBundle] privateFrameworksPath]]; + if ([NSBundle bundleWithPath:frameworkBundlePath]) resourceBundlePath = frameworkBundlePath; + + // check for resource bundle in app bundle (static library) + // + if ( ! resourceBundlePath) resourceBundlePath = [[NSBundle bundleForClass: + [MGLMapView class]] pathForResource:@"Mapbox" ofType:@"bundle"]; + + // fall back to resources directly in app bundle (test app) + // if ( ! resourceBundlePath) resourceBundlePath = [[NSBundle mainBundle] bundlePath]; return resourceBundlePath; From 01b4f160d40b5899ed455e02bd673deca96b3a36 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 16 Nov 2015 11:37:18 -0800 Subject: [PATCH 02/28] static framework target for iOS --- Makefile | 1 + ios/framework/Info.plist | 26 ++++++++++++++++++++++++++ ios/framework/modulemap | 5 +++++ ios/framework/umbrella | 3 +++ scripts/ios/framework.sh | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 67 insertions(+) create mode 100644 ios/framework/Info.plist create mode 100644 ios/framework/modulemap create mode 100644 ios/framework/umbrella create mode 100755 scripts/ios/framework.sh diff --git a/Makefile b/Makefile index 348ba3bff..b9e869ed0 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,7 @@ ipackage: Xcode/ios ; @JOBS=$(JOBS) ./scripts/ios/package.sh ipackage-strip: Xcode/ios ; @JOBS=$(JOBS) ./scripts/ios/package.sh strip ipackage-sim: Xcode/ios ; @JOBS=$(JOBS) ./scripts/ios/package.sh sim ipackage-no-bitcode: Xcode/ios ; @JOBS=$(JOBS) ./scripts/ios/package.sh no-bitcode +iframework: Xcode/ios ; ipackage-strip ; ./scripts/ios/framework.sh itest: ipackage-sim ; ./scripts/ios/test.sh endif diff --git a/ios/framework/Info.plist b/ios/framework/Info.plist new file mode 100644 index 000000000..e94d071da --- /dev/null +++ b/ios/framework/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + ##### + CFBundleSignature + ???? + CFBundleVersion + %%%%% + NSPrincipalClass + + + diff --git a/ios/framework/modulemap b/ios/framework/modulemap new file mode 100644 index 000000000..959568cb4 --- /dev/null +++ b/ios/framework/modulemap @@ -0,0 +1,5 @@ +framework module Mapbox { + umbrella header "Mapbox.h" + export * + module * { export * } +} diff --git a/ios/framework/umbrella b/ios/framework/umbrella new file mode 100644 index 000000000..6b980d365 --- /dev/null +++ b/ios/framework/umbrella @@ -0,0 +1,3 @@ + +FOUNDATION_EXPORT double MapboxVersionNumber; +FOUNDATION_EXPORT const unsigned char MapboxVersionString[]; diff --git a/scripts/ios/framework.sh b/scripts/ios/framework.sh new file mode 100755 index 000000000..700c8cf5a --- /dev/null +++ b/scripts/ios/framework.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail +set -u + +cd build/ios/pkg +rm -rf framework +mkdir framework +cd framework + +mkdir Mapbox.framework + +# headers +cp -rv ../static/Headers Mapbox.framework/Headers +cat ../../../../ios/framework/umbrella >> Mapbox.framework/Headers/Mapbox.h + +# resources +cp -rv ../static/Mapbox.bundle Mapbox.framework/Mapbox.bundle + +# binary +cp -v ../static/libMapbox.a Mapbox.framework/Mapbox + +# module map +mkdir Mapbox.framework/Modules +cp -v ../../../../ios/framework/modulemap Mapbox.framework/Modules/module.modulemap + +# Info.plist +VERSION=$( git tag | grep ^ios | sed 's/^ios-//' | sort -r | grep -v '\-rc.' | grep -v '\-pre.' | sed -n '1p' | sed 's/^v//' ) +cp -v ../../../../ios/framework/Info.plist Mapbox.framework +perl -pi -e "s/#####/$VERSION/" Mapbox.framework/Info.plist +perl -pi -e "s/%%%%%/$VERSION/" Mapbox.framework/Info.plist From baa9b7345c3d060f1c726592e1c9094c9102d971 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 16 Nov 2015 12:08:15 -0800 Subject: [PATCH 03/28] refs #3045: fix up target [skip ci] --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b9e869ed0..48fdef164 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ ipackage: Xcode/ios ; @JOBS=$(JOBS) ./scripts/ios/package.sh ipackage-strip: Xcode/ios ; @JOBS=$(JOBS) ./scripts/ios/package.sh strip ipackage-sim: Xcode/ios ; @JOBS=$(JOBS) ./scripts/ios/package.sh sim ipackage-no-bitcode: Xcode/ios ; @JOBS=$(JOBS) ./scripts/ios/package.sh no-bitcode -iframework: Xcode/ios ; ipackage-strip ; ./scripts/ios/framework.sh +iframework: ipackage-strip ; ./scripts/ios/framework.sh itest: ipackage-sim ; ./scripts/ios/test.sh endif From 97502ee8165dd40adea748e421b92aeb7445d17e Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 16 Nov 2015 12:13:22 -0800 Subject: [PATCH 04/28] bump version to ios-v3.0.0-pre.7 --- ios/Mapbox-iOS-SDK.podspec | 2 +- platform/ios/MGLAccountManager.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Mapbox-iOS-SDK.podspec b/ios/Mapbox-iOS-SDK.podspec index 3e4af79a5..e8cc62f56 100644 --- a/ios/Mapbox-iOS-SDK.podspec +++ b/ios/Mapbox-iOS-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.0.0-pre.6-symbols' + m.version = '3.0.0-pre.7-symbols' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa bindings.' diff --git a/platform/ios/MGLAccountManager.m b/platform/ios/MGLAccountManager.m index deceb1910..b78db7094 100644 --- a/platform/ios/MGLAccountManager.m +++ b/platform/ios/MGLAccountManager.m @@ -85,7 +85,7 @@ } + (NSString *)kitDisplayVersion { - return @"3.0.0-pre.6"; + return @"3.0.0-pre.7"; } + (void)initializeIfNeeded { From 915ab694e2e28fa4d8e0bb4ff60caae012dc7a95 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 16 Nov 2015 16:07:44 -0800 Subject: [PATCH 05/28] refs #3045: correct bundle identifier for iOS framework target [skip ci] --- ios/framework/Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/framework/Info.plist b/ios/framework/Info.plist index e94d071da..1dd4a72ae 100644 --- a/ios/framework/Info.plist +++ b/ios/framework/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + com.mapbox.sdk.ios CFBundleInfoDictionaryVersion 6.0 CFBundleName From f8f7cd9259ad6b344537867aeae3795086074042 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 16 Nov 2015 16:25:56 -0800 Subject: [PATCH 06/28] refs #3045: implicitly link dependencies for framework [skip ci] --- ios/framework/modulemap | 3 +++ ios/framework/umbrella | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/ios/framework/modulemap b/ios/framework/modulemap index 959568cb4..122db0c2b 100644 --- a/ios/framework/modulemap +++ b/ios/framework/modulemap @@ -2,4 +2,7 @@ framework module Mapbox { umbrella header "Mapbox.h" export * module * { export * } + link "c++" + link "sqlite3" + link "z" } diff --git a/ios/framework/umbrella b/ios/framework/umbrella index 6b980d365..9c04d5c75 100644 --- a/ios/framework/umbrella +++ b/ios/framework/umbrella @@ -1,3 +1,9 @@ +#import +#import +#import +#import +#import + FOUNDATION_EXPORT double MapboxVersionNumber; FOUNDATION_EXPORT const unsigned char MapboxVersionString[]; From ea4575af68c6ce0b0442670b655746cdbf858727 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 16 Nov 2015 17:46:45 -0800 Subject: [PATCH 07/28] bump version to ios-v3.0.0-pre.8 [skip ci] --- ios/Mapbox-iOS-SDK.podspec | 2 +- platform/ios/MGLAccountManager.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Mapbox-iOS-SDK.podspec b/ios/Mapbox-iOS-SDK.podspec index e8cc62f56..e066f1856 100644 --- a/ios/Mapbox-iOS-SDK.podspec +++ b/ios/Mapbox-iOS-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.0.0-pre.7-symbols' + m.version = '3.0.0-pre.8-symbols' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa bindings.' diff --git a/platform/ios/MGLAccountManager.m b/platform/ios/MGLAccountManager.m index b78db7094..58d15c3b3 100644 --- a/platform/ios/MGLAccountManager.m +++ b/platform/ios/MGLAccountManager.m @@ -85,7 +85,7 @@ } + (NSString *)kitDisplayVersion { - return @"3.0.0-pre.7"; + return @"3.0.0-pre.8"; } + (void)initializeIfNeeded { From 98462d4af88e46e9df21a2a48344cfd0241e07de Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Tue, 17 Nov 2015 14:43:58 -0800 Subject: [PATCH 08/28] add IB additions to umbrella header to avoid framework warnings --- include/mbgl/ios/Mapbox.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/mbgl/ios/Mapbox.h b/include/mbgl/ios/Mapbox.h index 9a1f4f476..004839059 100644 --- a/include/mbgl/ios/Mapbox.h +++ b/include/mbgl/ios/Mapbox.h @@ -4,6 +4,7 @@ #import "MGLMapCamera.h" #import "MGLGeometry.h" #import "MGLMapView.h" +#import "MGLMapView+IBAdditions.h" #import "MGLMultiPoint.h" #import "MGLOverlay.h" #import "MGLPointAnnotation.h" From c4694df37520a6e2e8c6e419198637fd30254d73 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Tue, 17 Nov 2015 15:51:27 -0800 Subject: [PATCH 09/28] more clearly indicate Foundation imports to avoid recursion --- include/mbgl/ios/MGLAccountManager.h | 2 ++ include/mbgl/ios/MGLAnnotation.h | 1 + include/mbgl/ios/MGLGeometry.h | 7 +++---- include/mbgl/ios/MGLMapCamera.h | 6 ++++-- include/mbgl/ios/MGLMapView+IBAdditions.h | 5 ++++- include/mbgl/ios/MGLMapView.h | 3 ++- include/mbgl/ios/MGLMultiPoint.h | 2 ++ include/mbgl/ios/MGLOverlay.h | 2 ++ include/mbgl/ios/MGLPointAnnotation.h | 2 ++ include/mbgl/ios/MGLPolygon.h | 2 ++ include/mbgl/ios/MGLPolyline.h | 2 ++ include/mbgl/ios/MGLShape.h | 2 ++ include/mbgl/ios/MGLStyle.h | 4 +++- include/mbgl/ios/MGLUserLocation.h | 5 +++++ platform/ios/MGLMapboxEvents.h | 2 ++ platform/ios/MGLMultiPoint_Private.h | 2 ++ platform/ios/MGLUserLocation_Private.h | 4 +++- platform/ios/NSBundle+MGLAdditions.h | 2 ++ platform/ios/NSString+MGLAdditions.h | 2 ++ 19 files changed, 47 insertions(+), 10 deletions(-) diff --git a/include/mbgl/ios/MGLAccountManager.h b/include/mbgl/ios/MGLAccountManager.h index 9d6ba3d06..4c239d6a1 100644 --- a/include/mbgl/ios/MGLAccountManager.h +++ b/include/mbgl/ios/MGLAccountManager.h @@ -1,3 +1,5 @@ +#import + #import "MGLTypes.h" NS_ASSUME_NONNULL_BEGIN diff --git a/include/mbgl/ios/MGLAnnotation.h b/include/mbgl/ios/MGLAnnotation.h index 18388d848..aef21ecbc 100644 --- a/include/mbgl/ios/MGLAnnotation.h +++ b/include/mbgl/ios/MGLAnnotation.h @@ -1,3 +1,4 @@ +#import #import #import "MGLTypes.h" diff --git a/include/mbgl/ios/MGLGeometry.h b/include/mbgl/ios/MGLGeometry.h index 05bec9fc0..a2ae9c991 100644 --- a/include/mbgl/ios/MGLGeometry.h +++ b/include/mbgl/ios/MGLGeometry.h @@ -1,10 +1,9 @@ -#pragma once - -#import "MGLTypes.h" - +#import #import #import +#import "MGLTypes.h" + NS_ASSUME_NONNULL_BEGIN /** Defines the area spanned by an MGLCoordinateBounds. */ diff --git a/include/mbgl/ios/MGLMapCamera.h b/include/mbgl/ios/MGLMapCamera.h index 68f3923fd..7c00ad866 100644 --- a/include/mbgl/ios/MGLMapCamera.h +++ b/include/mbgl/ios/MGLMapCamera.h @@ -1,6 +1,8 @@ -#import "Mapbox.h" +#import +#import +#import -#pragma once +#import "MGLTypes.h" NS_ASSUME_NONNULL_BEGIN diff --git a/include/mbgl/ios/MGLMapView+IBAdditions.h b/include/mbgl/ios/MGLMapView+IBAdditions.h index e7a602eac..52d5d433b 100644 --- a/include/mbgl/ios/MGLMapView+IBAdditions.h +++ b/include/mbgl/ios/MGLMapView+IBAdditions.h @@ -1,6 +1,9 @@ -#import "MGLMapView.h" +#import + #import "MGLTypes.h" +@class MGLMapView; + NS_ASSUME_NONNULL_BEGIN @interface MGLMapView (IBAdditions) diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index 1ff6c9eb6..c715725bd 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -4,10 +4,11 @@ #import #import +#import "MGLTypes.h" + NS_ASSUME_NONNULL_BEGIN @class MGLAnnotationImage; -@class MGLMapCamera; @class MGLUserLocation; @class MGLPolyline; @class MGLPolygon; diff --git a/include/mbgl/ios/MGLMultiPoint.h b/include/mbgl/ios/MGLMultiPoint.h index 1fc7ef6dc..5c58016df 100644 --- a/include/mbgl/ios/MGLMultiPoint.h +++ b/include/mbgl/ios/MGLMultiPoint.h @@ -3,6 +3,8 @@ #import "MGLShape.h" +#import "MGLTypes.h" + NS_ASSUME_NONNULL_BEGIN /** The `MGLMultiPoint` class is an abstract superclass used to define shapes composed of multiple points. You should not create instances of this class directly. Instead, you should create instances of the `MGLPolyline` or `MGLPolygon` classes. However, you can use the method and properties of this class to access information about the specific points associated with the line or polygon. */ diff --git a/include/mbgl/ios/MGLOverlay.h b/include/mbgl/ios/MGLOverlay.h index eee362d57..ab827c0d2 100644 --- a/include/mbgl/ios/MGLOverlay.h +++ b/include/mbgl/ios/MGLOverlay.h @@ -4,6 +4,8 @@ #import "MGLAnnotation.h" #import "MGLGeometry.h" +#import "MGLTypes.h" + NS_ASSUME_NONNULL_BEGIN /** The `MGLOverlay` protocol defines a specific type of annotation that represents both a point and an area on a map. Overlay objects are essentially data objects that contain the geographic data needed to represent the map area. For example, overlays can take the form of common shapes such as rectangles and circles. They can also describe polygons and other complex shapes. diff --git a/include/mbgl/ios/MGLPointAnnotation.h b/include/mbgl/ios/MGLPointAnnotation.h index ed5000275..d186cbff1 100644 --- a/include/mbgl/ios/MGLPointAnnotation.h +++ b/include/mbgl/ios/MGLPointAnnotation.h @@ -3,6 +3,8 @@ #import "MGLShape.h" +#import "MGLTypes.h" + NS_ASSUME_NONNULL_BEGIN /** The `MGLPointAnnotation` class defines a concrete annotation object located at a specified point. You can use this class, rather than define your own, in situations where all you want to do is associate a point on the map with a title. */ diff --git a/include/mbgl/ios/MGLPolygon.h b/include/mbgl/ios/MGLPolygon.h index c2fef6de6..a19b984f1 100644 --- a/include/mbgl/ios/MGLPolygon.h +++ b/include/mbgl/ios/MGLPolygon.h @@ -4,6 +4,8 @@ #import "MGLMultiPoint.h" #import "MGLOverlay.h" +#import "MGLTypes.h" + NS_ASSUME_NONNULL_BEGIN /** The `MGLPolygon` class represents a shape consisting of one or more points that define a closed polygon. The points are connected end-to-end in the order they are provided. The first and last points are connected to each other to create the closed shape. */ diff --git a/include/mbgl/ios/MGLPolyline.h b/include/mbgl/ios/MGLPolyline.h index 07c5286c8..c849bc987 100644 --- a/include/mbgl/ios/MGLPolyline.h +++ b/include/mbgl/ios/MGLPolyline.h @@ -4,6 +4,8 @@ #import "MGLMultiPoint.h" #import "MGLOverlay.h" +#import "MGLTypes.h" + NS_ASSUME_NONNULL_BEGIN /** The `MGLPolyline` class represents a shape consisting of one or more points that define connecting line segments. The points are connected end-to-end in the order they are provided. The first and last points are not connected to each other. */ diff --git a/include/mbgl/ios/MGLShape.h b/include/mbgl/ios/MGLShape.h index afc2dbb5a..f54d4bfb7 100644 --- a/include/mbgl/ios/MGLShape.h +++ b/include/mbgl/ios/MGLShape.h @@ -2,6 +2,8 @@ #import "MGLAnnotation.h" +#import "MGLTypes.h" + NS_ASSUME_NONNULL_BEGIN /** The `MGLShape` class is an abstract class that defines the basic properties for all shape-based annotation objects. This class must be subclassed and cannot be used as is. Subclasses are responsible for defining the geometry of the shape and providing an appropriate value for the coordinate property inherited from the `MGLAnnotation` protocol. */ diff --git a/include/mbgl/ios/MGLStyle.h b/include/mbgl/ios/MGLStyle.h index e27b8b32c..88cb8aaa8 100644 --- a/include/mbgl/ios/MGLStyle.h +++ b/include/mbgl/ios/MGLStyle.h @@ -1,4 +1,6 @@ -#import "Mapbox.h" +#import + +#import "MGLTypes.h" NS_ASSUME_NONNULL_BEGIN diff --git a/include/mbgl/ios/MGLUserLocation.h b/include/mbgl/ios/MGLUserLocation.h index 2eea51590..a681ac593 100644 --- a/include/mbgl/ios/MGLUserLocation.h +++ b/include/mbgl/ios/MGLUserLocation.h @@ -1,5 +1,10 @@ +#import +#import + #import "MGLAnnotation.h" +#import "MGLTypes.h" + NS_ASSUME_NONNULL_BEGIN /** The MGLUserLocation class defines a specific type of annotation that identifies the user’s current location. You do not create instances of this class directly. Instead, you retrieve an existing MGLUserLocation object from the userLocation property of the map view displayed in your application. */ diff --git a/platform/ios/MGLMapboxEvents.h b/platform/ios/MGLMapboxEvents.h index 45f809495..920a2227f 100644 --- a/platform/ios/MGLMapboxEvents.h +++ b/platform/ios/MGLMapboxEvents.h @@ -1,3 +1,5 @@ +#import + #import "MGLTypes.h" NS_ASSUME_NONNULL_BEGIN diff --git a/platform/ios/MGLMultiPoint_Private.h b/platform/ios/MGLMultiPoint_Private.h index a1a70a677..fe57064a9 100644 --- a/platform/ios/MGLMultiPoint_Private.h +++ b/platform/ios/MGLMultiPoint_Private.h @@ -1,5 +1,7 @@ #import "MGLMultiPoint.h" +#import + @interface MGLMultiPoint (Private) - (instancetype)initWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count; diff --git a/platform/ios/MGLUserLocation_Private.h b/platform/ios/MGLUserLocation_Private.h index 892ddfa47..48f6d40e8 100644 --- a/platform/ios/MGLUserLocation_Private.h +++ b/platform/ios/MGLUserLocation_Private.h @@ -1,9 +1,11 @@ #import "MGLUserLocation.h" -NS_ASSUME_NONNULL_BEGIN +#import @class MGLMapView; +NS_ASSUME_NONNULL_BEGIN + @interface MGLUserLocation (Private) @property (nonatomic, weak) MGLMapView *mapView; diff --git a/platform/ios/NSBundle+MGLAdditions.h b/platform/ios/NSBundle+MGLAdditions.h index f3800dfd9..a86e85f79 100644 --- a/platform/ios/NSBundle+MGLAdditions.h +++ b/platform/ios/NSBundle+MGLAdditions.h @@ -1,3 +1,5 @@ +#import + #import "MGLTypes.h" NS_ASSUME_NONNULL_BEGIN diff --git a/platform/ios/NSString+MGLAdditions.h b/platform/ios/NSString+MGLAdditions.h index a4941ac85..6064f8b40 100644 --- a/platform/ios/NSString+MGLAdditions.h +++ b/platform/ios/NSString+MGLAdditions.h @@ -1,3 +1,5 @@ +#import + #import "MGLTypes.h" NS_ASSUME_NONNULL_BEGIN From 3aa523c7b1ece998f93c27e6d8ea3f3a92a9a072 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Fri, 23 Oct 2015 15:33:49 -0400 Subject: [PATCH 10/28] [ios] document willStart/didFinish map loading delegate methods Fixes #2706 --- include/mbgl/ios/MGLMapView.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index c715725bd..93532b6a3 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -414,14 +414,20 @@ IB_DESIGNABLE * @param animated Whether the change caused an animated effect on the map. */ - (void)mapView:(MGLMapView *)mapView regionDidChangeAnimated:(BOOL)animated; -#pragma mark - Loading the Map Data +#pragma mark - Loading the Map -/** @name Loading the Map Data */ +/** @name Loading the Map */ -// TODO +/** Tells the delegate that the map view will begin to load. + * + * This method is called whenever the map view starts loading, including when a new style has been set and the map must reload. + * @param mapView The map view that is starting to load. */ - (void)mapViewWillStartLoadingMap:(MGLMapView *)mapView; -// TODO +/** Tells the delegate that the map view has finished loading. + * + * This method is called whenever the map view finishes loading, either after the initial load or after a style change has forced a reload. + * @param mapView The map view that has finished loading. */ - (void)mapViewDidFinishLoadingMap:(MGLMapView *)mapView; // TODO From 5b7866a1bab4b5dbbd2ccc46a6bee1785338467f Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Fri, 23 Oct 2015 15:52:44 -0400 Subject: [PATCH 11/28] [ios] update changelog for willStart/didFinishLoading --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1a99b5c5..9b11e9d6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ Known issues: - A new delegate callback was added for observing taps to annotation callout views. ([#2596](https://github.com/mapbox/mapbox-gl-native/pull/2596)) - `-mapViewRegionIsChanging:` is now sent to the map view’s delegate during gestures. ([#2700](https://github.com/mapbox/mapbox-gl-native/pull/2700)) - Improved gesture recognition while the map is tilted. ([#2770](https://github.com/mapbox/mapbox-gl-native/pull/2770)) +- `-mapViewWillStartLoadingMap:` and `-mapViewDidFinishLoadingMap:` delegate methods now work. ([#2706](https://github.com/mapbox/mapbox-gl-native/pull/2706)) - Removed CoreTelephony.framework dependency. ([#2581](https://github.com/mapbox/mapbox-gl-native/pull/2581)) - Improved user location annotation responsiveness. ([#2643](https://github.com/mapbox/mapbox-gl-native/pull/2643)) From fd0e21321e40d1bc503a1c2b6dadb677ea2c6940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Tue, 17 Nov 2015 16:52:19 -0800 Subject: [PATCH 12/28] Ensure proper will/is/didChange for resetNorth --- platform/ios/MGLMapView.mm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 750f3fabb..4c971c453 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -1555,7 +1555,7 @@ std::chrono::steady_clock::duration durationInSeconds(float duration) - (void)resetNorthAnimated:(BOOL)animated { - _mbglMap->setBearing(0, durationInSeconds(animated ? MGLAnimationDuration : 0)); + [self setDirection:0 animated:animated]; } - (void)resetPosition @@ -1782,10 +1782,18 @@ mbgl::LatLngBounds MGLLatLngBoundsFromCoordinateBounds(MGLCoordinateBounds coord { if ( ! animated && ! self.rotationAllowed) return; - if (self.userTrackingMode == MGLUserTrackingModeFollowWithHeading) + if (self.userTrackingMode == MGLUserTrackingModeFollowWithHeading || + self.userTrackingMode == MGLUserTrackingModeFollowWithCourse) { self.userTrackingMode = MGLUserTrackingModeFollow; } + + [self _setDirection:direction animated:animated]; +} + +- (void)_setDirection:(CLLocationDirection)direction animated:(BOOL)animated +{ + if (direction == self.direction) return; CGFloat duration = animated ? MGLAnimationDuration : 0; @@ -2818,7 +2826,7 @@ CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng) if (headingDirection >= 0 && self.userTrackingMode == MGLUserTrackingModeFollowWithHeading) { - _mbglMap->setBearing(headingDirection, durationInSeconds(MGLAnimationDuration)); + [self _setDirection:headingDirection animated:YES]; } } From 50a33e4e6d5a558f213dcdb61e3f595c5cef4dd3 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 18 Nov 2015 13:21:16 -0800 Subject: [PATCH 13/28] [core] Avoid calling AnnotationManager::updateStyle until the style is loaded Fixes #3037 --- src/mbgl/map/map_context.cpp | 2 +- src/mbgl/style/style.cpp | 6 ++++++ src/mbgl/style/style.hpp | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index 031fbb57c..0c01c822e 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -169,7 +169,7 @@ void MapContext::update() { data.setAnimationTime(Clock::now()); - if (updateFlags & Update::Annotations) { + if (style->isLoaded() && updateFlags & Update::Annotations) { data.getAnnotationManager()->updateStyle(*style); updateFlags |= Update::Classes; } diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 14d93fb12..3523a7207 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -57,6 +57,8 @@ void Style::setJSON(const std::string& json, const std::string&) { glyphStore->setURL(parser.getGlyphURL()); spriteStore->setURL(parser.getSpriteURL()); + + loaded = true; } Style::~Style() { @@ -175,6 +177,10 @@ bool Style::hasTransitions() const { } bool Style::isLoaded() const { + if (!loaded) { + return false; + } + for (const auto& source : sources) { if (!source->isLoaded()) { return false; diff --git a/src/mbgl/style/style.hpp b/src/mbgl/style/style.hpp index 5f18a8fec..4eef6cce7 100644 --- a/src/mbgl/style/style.hpp +++ b/src/mbgl/style/style.hpp @@ -100,6 +100,7 @@ private: void emitTileDataChanged(); void emitResourceLoadingFailed(std::exception_ptr error); + bool loaded = false; bool shouldReparsePartialTiles = false; Observer* observer = nullptr; From 35441a26e9bc6335ae5009455672772572bee004 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Wed, 18 Nov 2015 18:00:12 -0800 Subject: [PATCH 14/28] refs #2922: update display link in all common modes (inc. scrolling) --- platform/ios/MGLMapView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 4c971c453..f06e648d2 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -233,7 +233,7 @@ std::chrono::steady_clock::duration durationInSeconds(float duration) // setup refresh driver _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(updateFromDisplayLink)]; _displayLink.frameInterval = MGLTargetFrameInterval; - [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; + [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; _needsDisplayRefresh = YES; // start paused if in IB From ce679eea40977af09dc5cae2950adc49e63792e0 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Wed, 18 Nov 2015 18:17:06 -0800 Subject: [PATCH 15/28] refs #2380: plop Settings.bundle inside of framework distribution --- ios/framework/Settings.bundle/Root.plist | 33 ++++++++++++++++++ .../Settings.bundle/en.lproj/Root.strings | Bin 0 -> 544 bytes scripts/ios/framework.sh | 3 ++ 3 files changed, 36 insertions(+) create mode 100644 ios/framework/Settings.bundle/Root.plist create mode 100644 ios/framework/Settings.bundle/en.lproj/Root.strings diff --git a/ios/framework/Settings.bundle/Root.plist b/ios/framework/Settings.bundle/Root.plist new file mode 100644 index 000000000..076f402e1 --- /dev/null +++ b/ios/framework/Settings.bundle/Root.plist @@ -0,0 +1,33 @@ + + + + + PreferenceSpecifiers + + + Title + Privacy Settings + Type + PSGroupSpecifier + FooterText + This setting allows the application to share anonymized location and usage data with Mapbox. + + + DefaultValue + + Key + MGLMapboxMetricsEnabled + Title + Mapbox Metrics + Type + PSToggleSwitchSpecifier + TrueValue + + FalseValue + + + + StringsTable + Root + + diff --git a/ios/framework/Settings.bundle/en.lproj/Root.strings b/ios/framework/Settings.bundle/en.lproj/Root.strings new file mode 100644 index 0000000000000000000000000000000000000000..51959f60af99b7c9fce1a5d261818c1fbf8b8500 GIT binary patch literal 544 zcmdUsK?=e!6hvq3DM}CE1;is11ie6Pi!EqVnrhX> Mapbox.framework/Headers/Mapbox.h # resources cp -rv ../static/Mapbox.bundle Mapbox.framework/Mapbox.bundle +# settings bundle +cp -rv ../../../../ios/framework/Settings.bundle Mapbox.framework/Settings.bundle + # binary cp -v ../static/libMapbox.a Mapbox.framework/Mapbox From 73daa180b67aa171c4813b7319d37b7e982114f6 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Wed, 18 Nov 2015 18:43:12 -0800 Subject: [PATCH 16/28] bump version to ios-v3.0.0-pre.9 --- ios/Mapbox-iOS-SDK.podspec | 2 +- platform/ios/MGLAccountManager.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Mapbox-iOS-SDK.podspec b/ios/Mapbox-iOS-SDK.podspec index e066f1856..099de479e 100644 --- a/ios/Mapbox-iOS-SDK.podspec +++ b/ios/Mapbox-iOS-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.0.0-pre.8-symbols' + m.version = '3.0.0-pre.9-symbols' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa bindings.' diff --git a/platform/ios/MGLAccountManager.m b/platform/ios/MGLAccountManager.m index 58d15c3b3..3c3a520b5 100644 --- a/platform/ios/MGLAccountManager.m +++ b/platform/ios/MGLAccountManager.m @@ -85,7 +85,7 @@ } + (NSString *)kitDisplayVersion { - return @"3.0.0-pre.8"; + return @"3.0.0-pre.9"; } + (void)initializeIfNeeded { From 9120c19db206f836f3fddf2c850f4f8f7f97ff0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Thu, 19 Nov 2015 15:38:32 -0800 Subject: [PATCH 17/28] Separate heading for iOS SDK 3.0.0 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b11e9d6d..b7559b661 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ Known issues: ## iOS master +## iOS 3.0.0 + - If you install this SDK via CocoaPods, CocoaPods version 0.38.0 or above is required. ([#2132](https://github.com/mapbox/mapbox-gl-native/pull/2132)) - The `styleID` property has been removed from MGLMapView. Instead, set the `styleURL` property to an NSURL in the form `mapbox://styles/STYLE_ID`. If you previously set the style ID in Interface Builder’s Attributes inspector, delete the `styleID` entry from the User Defined Runtime Attributes section of the Identity inspector, then set the new “Style URL” inspectable to a value in the form `mapbox://styles/STYLE_ID`. ([#2632](https://github.com/mapbox/mapbox-gl-native/pull/2632)) - Default styles such as Streets are no longer bundled with the SDK; instead, they are loaded at runtime from the style API on mapbox.com. As always, you can use these default styles with any valid access token, and Streets continues to be `MGLMapView`’s initial style. The `bundledStyleURLs` property on `MGLMapView` has been deprecated in favor of several class methods on `MGLStyle` that provide direct access to the default styles. ([#2746](https://github.com/mapbox/mapbox-gl-native/pull/2746)) From 462af73b7eab4b568779fc3a13adcca009db84e1 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 19 Nov 2015 17:59:21 -0800 Subject: [PATCH 18/28] [core] Followup fix to #3037 The previous fix resulted in annotations sometimes never being added. This would happen if, during the execution of MapContext::update where Update::Annotations was set, the style itself was loaded but some of its subresources (sprite or sources) were not. #3082 is a follow up issue to make MapContext::update less error-prone. --- src/mbgl/map/map_context.cpp | 2 +- src/mbgl/style/style.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index 0c01c822e..e7316c235 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -169,7 +169,7 @@ void MapContext::update() { data.setAnimationTime(Clock::now()); - if (style->isLoaded() && updateFlags & Update::Annotations) { + if (style->loaded && updateFlags & Update::Annotations) { data.getAnnotationManager()->updateStyle(*style); updateFlags |= Update::Classes; } diff --git a/src/mbgl/style/style.hpp b/src/mbgl/style/style.hpp index 4eef6cce7..dbaf8cf02 100644 --- a/src/mbgl/style/style.hpp +++ b/src/mbgl/style/style.hpp @@ -100,7 +100,6 @@ private: void emitTileDataChanged(); void emitResourceLoadingFailed(std::exception_ptr error); - bool loaded = false; bool shouldReparsePartialTiles = false; Observer* observer = nullptr; @@ -112,6 +111,7 @@ private: bool hasPendingTransitions = false; public: + bool loaded = false; Worker workers; }; From c4558d48f2ac74b3c2413eb8c363688e430b1177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Fri, 20 Nov 2015 00:13:44 -0800 Subject: [PATCH 19/28] [iOS] Set application root as asset root As of #2746, we no longer bundle any styles with the SDK, so the asset: URL scheme is unused. Instead, point asset: to the application root for developer convenience and consistency with the Android and default asset roots. Also fixed an issue that prevented relative URLs from being treated as asset: URLs. Fixes #1208, fixes #3050. --- CHANGELOG.md | 1 + platform/darwin/asset_root.mm | 13 +------------ platform/ios/MGLMapView.mm | 4 ++-- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7559b661..576066fae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ Known issues: - The `styleID` property has been removed from MGLMapView. Instead, set the `styleURL` property to an NSURL in the form `mapbox://styles/STYLE_ID`. If you previously set the style ID in Interface Builder’s Attributes inspector, delete the `styleID` entry from the User Defined Runtime Attributes section of the Identity inspector, then set the new “Style URL” inspectable to a value in the form `mapbox://styles/STYLE_ID`. ([#2632](https://github.com/mapbox/mapbox-gl-native/pull/2632)) - Default styles such as Streets are no longer bundled with the SDK; instead, they are loaded at runtime from the style API on mapbox.com. As always, you can use these default styles with any valid access token, and Streets continues to be `MGLMapView`’s initial style. The `bundledStyleURLs` property on `MGLMapView` has been deprecated in favor of several class methods on `MGLStyle` that provide direct access to the default styles. ([#2746](https://github.com/mapbox/mapbox-gl-native/pull/2746)) - The SDK now builds with Bitcode enabled. A version of libMapbox.a with Bitcode disabled is also available. ([#2332](https://github.com/mapbox/mapbox-gl-native/issues/2332), [#3003](https://github.com/mapbox/mapbox-gl-native/pull/3003)) +- The style URL can be set to a local resource: `asset://local-color.json` and `local-color.json` both resolve to a file named `local-color.json` in the application’s root folder. ([#3087](https://github.com/mapbox/mapbox-gl-native/pull/3087)) - The double-tap-drag gesture for zooming in and out is now consistent with the Google Maps SDK. ([#2153](https://github.com/mapbox/mapbox-gl-native/pull/2153)) - A new `MGLAnnotationImage.enabled` property allows you to disable touch events on individual annotations. ([#2501](https://github.com/mapbox/mapbox-gl-native/pull/2501)) - Fixed a rendering issue that caused one-way arrows along tile boundaries to point due east instead of in the direction of travel. ([#2530](https://github.com/mapbox/mapbox-gl-native/pull/2530)) diff --git a/platform/darwin/asset_root.mm b/platform/darwin/asset_root.mm index f47f5d36d..a4a3d13c8 100644 --- a/platform/darwin/asset_root.mm +++ b/platform/darwin/asset_root.mm @@ -2,24 +2,13 @@ #include -@interface MGLApplicationRootBundleCanary : NSObject -@end - -@implementation MGLApplicationRootBundleCanary -@end - namespace mbgl { namespace platform { // Returns the path to the root folder of the application. const std::string &assetRoot() { static const std::string root = []() -> std::string { - NSString *path = [[NSBundle bundleForClass:[MGLApplicationRootBundleCanary class]] pathForResource:@"Mapbox" ofType:@"bundle"]; - if (!path) { - path = [[[NSBundle mainBundle] resourceURL] path]; - } - return {[path cStringUsingEncoding : NSUTF8StringEncoding], - [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding]}; + return [[[[NSBundle mainBundle] resourceURL] path] UTF8String]; }(); return root; } diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index f06e648d2..646e02cc7 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -192,8 +192,8 @@ std::chrono::steady_clock::duration durationInSeconds(float duration) if ( ! [styleURL scheme]) { - // Assume a relative path into the developer’s bundle. - styleURL = [[NSBundle mainBundle] URLForResource:styleURL.path withExtension:nil]; + // Assume a relative path into the application bundle. + styleURL = [NSURL URLWithString:[@"asset://" stringByAppendingString:[styleURL absoluteString]]]; } _mbglMap->setStyleURL([[styleURL absoluteString] UTF8String]); From b791d1fb81d4e15922313aef321b9ae42384d43b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 20 Nov 2015 01:02:21 -0800 Subject: [PATCH 20/28] [iOS] Added missing documentation comment --- include/mbgl/ios/MGLMapView.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index 93532b6a3..779faa4e9 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -121,12 +121,17 @@ IB_DESIGNABLE * Changing the zoom level scales the map without changing the current center coordinate. At zoom level 0, tiles cover the entire world map; at zoom level 1, tiles cover 1/4 of the world; at zoom level 2, tiles cover 1/16 of the world, and so on. */ - (void)setZoomLevel:(double)zoomLevel animated:(BOOL)animated; -/** Changes the center coordinate and zoom level of the and optionally animates the change. +/** Changes the center coordinate and zoom level of the map and optionally animates the change. * @param centerCoordinate The new center coordinate for the map. * @param zoomLevel The new zoom level for the map. * @param animated Specify `YES` if you want the map view to animate scrolling and zooming to the new location or `NO` if you want the map to display the new location immediately. */ - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel animated:(BOOL)animated; +/** Changes the center coordinate, zoom level, and direction of the map and optionally animates the change. +* @param centerCoordinate The new center coordinate for the map. +* @param zoomLevel The new zoom level for the map. +* @param direction The new direction for the map, measured in degrees relative to true north. +* @param animated Specify `YES` if you want the map view to animate scrolling, zooming, and rotating to the new location or `NO` if you want the map to display the new location immediately. */ - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel direction:(CLLocationDirection)direction animated:(BOOL)animated; /** The coordinate bounds visible in the receiver’s viewport. From 06d400fb9a9a4f612f9fcd8ddd7a68964d01e27e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 20 Nov 2015 01:10:24 -0800 Subject: [PATCH 21/28] Discourage code usage of styleURL__ property A hack atop the hack added in #2632. Pre-declare `styleURL__` with an attribute that prevents it from appearing in code completion suggestions, while leaving it available to Interface Builder, which is unable to parse attributes. --- include/mbgl/ios/MGLMapView.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index 779faa4e9..83ef395cf 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -234,6 +234,9 @@ IB_DESIGNABLE * To display the default style, set this property to `nil`. */ @property (nonatomic, null_resettable) NSURL *styleURL; +/* Discourage programmatic usage of this IB-only property. Interface Builder skips over this declaration because it is unable to parse attributes. See the real declaration in MGLMapView+IBAdditions.h. */ +@property (nonatomic, nullable) IBInspectable NSString *styleURL__ __attribute__((unavailable("styleURL__ is for use within Interface Builder only. Use styleURL in code."))); + /** Currently active style classes, represented as an array of string identifiers. */ @property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses; From 24136b02e94ade8e64b2a5740beb5150f4e23da4 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Fri, 20 Nov 2015 18:37:47 -0800 Subject: [PATCH 22/28] bump version to ios-v3.0.0-pre.10 --- ios/Mapbox-iOS-SDK.podspec | 2 +- platform/ios/MGLAccountManager.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Mapbox-iOS-SDK.podspec b/ios/Mapbox-iOS-SDK.podspec index 099de479e..ba0a60139 100644 --- a/ios/Mapbox-iOS-SDK.podspec +++ b/ios/Mapbox-iOS-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.0.0-pre.9-symbols' + m.version = '3.0.0-pre.10-symbols' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa bindings.' diff --git a/platform/ios/MGLAccountManager.m b/platform/ios/MGLAccountManager.m index 3c3a520b5..52921b17c 100644 --- a/platform/ios/MGLAccountManager.m +++ b/platform/ios/MGLAccountManager.m @@ -85,7 +85,7 @@ } + (NSString *)kitDisplayVersion { - return @"3.0.0-pre.9"; + return @"3.0.0-pre.10"; } + (void)initializeIfNeeded { From c054441071d3ed050fb2a8ff393913aadf83cea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 20 Nov 2015 21:51:24 -0800 Subject: [PATCH 23/28] Fixed linker warnings about overridden styleURL__ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced #3088 with a better fix that relies on Interface Builder’s lack of support for conditional compilation. --- include/mbgl/ios/MGLMapView+IBAdditions.h | 4 ++++ include/mbgl/ios/MGLMapView.h | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/mbgl/ios/MGLMapView+IBAdditions.h b/include/mbgl/ios/MGLMapView+IBAdditions.h index 52d5d433b..f18df56e0 100644 --- a/include/mbgl/ios/MGLMapView+IBAdditions.h +++ b/include/mbgl/ios/MGLMapView+IBAdditions.h @@ -14,12 +14,16 @@ NS_ASSUME_NONNULL_BEGIN // inspectables declared in MGLMapView.h are always sorted before those in // MGLMapView+IBAdditions.h, due to ASCII sort order. +#if TARGET_INTERFACE_BUILDER + // HACK: We want this property to look like a URL bar in the Attributes // inspector, but just calling it styleURL would violate Cocoa naming // conventions and conflict with the existing NSURL property. Fortunately, IB // strips out the two underscores for display. @property (nonatomic, nullable) IBInspectable NSString *styleURL__; +#endif // TARGET_INTERFACE_BUILDER + // Convenience properties related to the initial viewport. These properties // are not meant to be used outside of Interface Builder. latitude and longitude // are backed by properties of type CLLocationDegrees, but these declarations diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index 83ef395cf..779faa4e9 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -234,9 +234,6 @@ IB_DESIGNABLE * To display the default style, set this property to `nil`. */ @property (nonatomic, null_resettable) NSURL *styleURL; -/* Discourage programmatic usage of this IB-only property. Interface Builder skips over this declaration because it is unable to parse attributes. See the real declaration in MGLMapView+IBAdditions.h. */ -@property (nonatomic, nullable) IBInspectable NSString *styleURL__ __attribute__((unavailable("styleURL__ is for use within Interface Builder only. Use styleURL in code."))); - /** Currently active style classes, represented as an array of string identifiers. */ @property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses; From 8a1bd6d3f29e6b72d04ce66d3eafa29a0022b929 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 23 Nov 2015 10:31:46 -0800 Subject: [PATCH 24/28] added some missing changelog entries --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 576066fae..712d3116e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,8 +34,11 @@ Known issues: - A new `MGLAnnotationImage.enabled` property allows you to disable touch events on individual annotations. ([#2501](https://github.com/mapbox/mapbox-gl-native/pull/2501)) - Fixed a rendering issue that caused one-way arrows along tile boundaries to point due east instead of in the direction of travel. ([#2530](https://github.com/mapbox/mapbox-gl-native/pull/2530)) - Fixed an issue that prevented zoom level–dependent style properties from updating after zooming programmatically with animation. ([#2951](https://github.com/mapbox/mapbox-gl-native/pull/2951)) +- Performance and appearance improvements during annotation adds & removes. ([#1688](https://github.com/mapbox/mapbox-gl-native/issues/1688)) +- Overall improved performance during renders by not rendering faster than necessary. ([#1975](https://github.com/mapbox/mapbox-gl-native/issues/1975)) - Fixed a rendering issue with styles that use the `background-pattern` property. ([#2531](https://github.com/mapbox/mapbox-gl-native/pull/2531)) - Fixed a crash when reusing a single `MGLMapView` across multiple `UIViewController`s. ([#2969](https://github.com/mapbox/mapbox-gl-native/pull/2969)) +- Fixed a crash on iPod touch and other devices or simulators without a cell carrier. ([#2687](https://github.com/mapbox/mapbox-gl-native/issues/2687)) - Eliminated flickering when opening and closing an overlay, such as an alert or action sheet. ([#2309](https://github.com/mapbox/mapbox-gl-native/pull/2309)) - Labels can now line wrap on hyphens and other punctuation. ([#2598](https://github.com/mapbox/mapbox-gl-native/pull/2598)) - A new delegate callback was added for observing taps to annotation callout views. ([#2596](https://github.com/mapbox/mapbox-gl-native/pull/2596)) From 8a774ad9a93f79ece44d68238086e9722b19146f Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 23 Nov 2015 11:00:55 -0800 Subject: [PATCH 25/28] show current version changelog section in docs & link externally to full This is going to fail and output nothing for -pre and -rc tags for now until #3046 is addressed. We can't yet grab those but still have final releases sort after them. --- ios/docs/install_docs.sh | 2 +- ios/docs/pod-README.md | 2 ++ scripts/ios/package.sh | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ios/docs/install_docs.sh b/ios/docs/install_docs.sh index 8d1b8f553..43af9432b 100755 --- a/ios/docs/install_docs.sh +++ b/ios/docs/install_docs.sh @@ -17,7 +17,7 @@ README=/tmp/mbgl/GL-README.md cat ./pod-README.md > ${README} echo >> ${README} echo -n "#" >> ${README} -cat ../../CHANGELOG.md >> ${README} +cat ../../CHANGELOG.md | sed -n "/^## iOS ${DOCS_VERSION}/,/^##/p" | sed '$d' >> ${README} # Copy headers to a temporary location where we can substitute macros that appledoc doesn't understand. cp -r ../../include/mbgl/ios /tmp/mbgl perl \ diff --git a/ios/docs/pod-README.md b/ios/docs/pod-README.md index 1fe3ac4f3..23898c5dd 100644 --- a/ios/docs/pod-README.md +++ b/ios/docs/pod-README.md @@ -5,3 +5,5 @@ An open source OpenGL-based vector map solution for iOS with full styling capabi For more information, check out [our online overview](https://www.mapbox.com/ios-sdk/). [![](https://raw.githubusercontent.com/mapbox/mapbox-gl-native/master/ios/screenshot.png)]() + +See the [full changelog](https://github.com/mapbox/mapbox-gl-native/blob/master/CHANGELOG.md) online. diff --git a/scripts/ios/package.sh b/scripts/ios/package.sh index 120870069..41694c2f6 100755 --- a/scripts/ios/package.sh +++ b/scripts/ios/package.sh @@ -128,7 +128,7 @@ README=/tmp/mbgl/README.md cat ios/docs/pod-README.md > ${README} echo >> ${README} echo -n "#" >> ${README} -cat CHANGELOG.md >> ${README} +cat CHANGELOG.md | sed -n "/^## iOS ${DOCS_VERSION}/,/^##/p" | sed '$d' >> ${README} # Copy headers to a temporary location where we can substitute macros that appledoc doesn't understand. cp -r "${OUTPUT}/static/Headers" /tmp/mbgl perl \ From 6c74da947b7b8cb83c4936f9805fcc54b1560e49 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 23 Nov 2015 11:17:45 -0800 Subject: [PATCH 26/28] bump iOS version to 3.0.0-rc.1 --- ios/Mapbox-iOS-SDK.podspec | 2 +- platform/ios/MGLAccountManager.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Mapbox-iOS-SDK.podspec b/ios/Mapbox-iOS-SDK.podspec index ba0a60139..3655c7265 100644 --- a/ios/Mapbox-iOS-SDK.podspec +++ b/ios/Mapbox-iOS-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.0.0-pre.10-symbols' + m.version = '3.0.0-rc.1-symbols' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa bindings.' diff --git a/platform/ios/MGLAccountManager.m b/platform/ios/MGLAccountManager.m index 52921b17c..3e1affb10 100644 --- a/platform/ios/MGLAccountManager.m +++ b/platform/ios/MGLAccountManager.m @@ -85,7 +85,7 @@ } + (NSString *)kitDisplayVersion { - return @"3.0.0-pre.10"; + return @"3.0.0-rc.1"; } + (void)initializeIfNeeded { From e7132e1dec47677db7bf440c7e8faba59fd84545 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 23 Nov 2015 16:38:01 -0800 Subject: [PATCH 27/28] change iOS Bitrise Slack room [skip ci] --- bitrise.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitrise.yml b/bitrise.yml index 90b3f4f25..4b06c523e 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -65,7 +65,7 @@ workflows: run_if: '{{enveq "SKIPCI" "false"}}' inputs: - webhook_url: "$SLACK_HOOK_URL" - - channel: "#gl" + - channel: "#gl-bots" - from_username: Bitrise - from_username_on_error: Bitrise - message: 'Build #${BITRISE_BUILD_NUMBER} (${BITRISE_BUILD_URL}) for mapbox/mapbox-gl-native@${BITRISE_GIT_BRANCH} From 6d4e86f41db54fa2830f726b990236790ea1c525 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 23 Nov 2015 17:03:54 -0800 Subject: [PATCH 28/28] bump podspec to 3.0.0 final (no symbols) --- ios/Mapbox-iOS-SDK.podspec | 2 +- platform/ios/MGLAccountManager.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Mapbox-iOS-SDK.podspec b/ios/Mapbox-iOS-SDK.podspec index 3655c7265..fb6cdce73 100644 --- a/ios/Mapbox-iOS-SDK.podspec +++ b/ios/Mapbox-iOS-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.0.0-rc.1-symbols' + m.version = '3.0.0' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa bindings.' diff --git a/platform/ios/MGLAccountManager.m b/platform/ios/MGLAccountManager.m index 3e1affb10..522f3cb0b 100644 --- a/platform/ios/MGLAccountManager.m +++ b/platform/ios/MGLAccountManager.m @@ -85,7 +85,7 @@ } + (NSString *)kitDisplayVersion { - return @"3.0.0-rc.1"; + return @"3.0.0"; } + (void)initializeIfNeeded {