From b8388168dd130c67c77254565cdb576df7905915 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Wed, 1 Jul 2015 10:42:38 -0400 Subject: [PATCH 01/24] split renderSync and transition nudging to allow client view syncing --- include/mbgl/map/map.hpp | 5 ++++- platform/ios/MGLMapView.mm | 3 ++- src/mbgl/map/map.cpp | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 8178fab49..72800a9c1 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -64,7 +64,10 @@ public: void renderStill(StillImageCallback callback); // Triggers a synchronous or asynchronous render. - void renderSync(); + bool renderSync(); + + // Nudges transitions one step, possibly notifying of the need for a rerender. + void nudgeTransitions(bool forceRerender); // Notifies the Map thread that the state has changed and an update might be necessary. void update(Update update = Update::Nothing); diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 6f6a6d9ae..01a716ad9 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -687,7 +687,8 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) _mbglMap->setSourceTileCacheSize(cacheSize); - _mbglMap->renderSync(); + bool needsRerender = _mbglMap->renderSync(); + _mbglMap->nudgeTransitions(needsRerender); } } diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 37cd3be33..449d77fbe 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -48,7 +48,7 @@ void Map::renderStill(StillImageCallback callback) { FrameData{ view.getFramebufferSize() }, callback); } -void Map::renderSync() { +bool Map::renderSync() { if (renderState == RenderState::never) { view.notifyMapChange(MapChangeWillStartRenderingMap); } @@ -69,9 +69,13 @@ void Map::renderSync() { view.notifyMapChange(MapChangeDidFinishRenderingMapFullyRendered); } + return result.needsRerender; +} + +void Map::nudgeTransitions(bool forceRerender) { if (transform->needsTransition()) { update(Update(transform->updateTransitions(Clock::now()))); - } else if (result.needsRerender) { + } else if (forceRerender) { update(); } } From a67e80219f90c409dfce8bfef91d9131dabd8d4f Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Wed, 8 Jul 2015 12:21:40 -0700 Subject: [PATCH 02/24] refs #1125, 1813: update user dot tracking in one place Now that we have cleanup around the map viewport change notifications, this only needs to happen in one place: the GL frame draw loop. --- platform/ios/MGLMapView.mm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 01a716ad9..f527a9a2e 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -688,6 +688,9 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) _mbglMap->setSourceTileCacheSize(cacheSize); bool needsRerender = _mbglMap->renderSync(); + + [self updateUserLocationAnnotationView]; + _mbglMap->nudgeTransitions(needsRerender); } } @@ -2352,8 +2355,6 @@ CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng) self.userLocationAnnotationView.haloLayer.hidden = ! CLLocationCoordinate2DIsValid(self.userLocation.coordinate) || newLocation.horizontalAccuracy > 10; - - [self updateUserLocationAnnotationView]; } - (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager @@ -2510,8 +2511,6 @@ CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng) case mbgl::MapChangeRegionWillChange: case mbgl::MapChangeRegionWillChangeAnimated: { - [self updateUserLocationAnnotationView]; - [self deselectAnnotation:self.selectedAnnotation animated:NO]; BOOL animated = (change == mbgl::MapChangeRegionWillChangeAnimated); @@ -2546,7 +2545,6 @@ CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng) } case mbgl::MapChangeRegionIsChanging: { - [self updateUserLocationAnnotationView]; [self updateCompass]; if ([self.delegate respondsToSelector:@selector(mapViewRegionIsChanging:)]) @@ -2558,7 +2556,6 @@ CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng) case mbgl::MapChangeRegionDidChange: case mbgl::MapChangeRegionDidChangeAnimated: { - [self updateUserLocationAnnotationView]; [self updateCompass]; if (self.pan.state == UIGestureRecognizerStateChanged || From 49fe6df0dbcfb70222b10b72be681b68526e7891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Wed, 8 Jul 2015 12:41:34 -0700 Subject: [PATCH 03/24] Assert if -mapView:symbolNameForAnnotation: is implemented Fixes #1851. --- platform/ios/MGLMapView.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index f527a9a2e..3fd0ed02c 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -455,6 +455,14 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) if (_delegate == delegate) return; _delegate = delegate; + + if ([delegate respondsToSelector:@selector(mapView:symbolNameForAnnotation:)]) + { + [NSException raise:@"Method unavailable" format: + @"-mapView:symbolNameForAnnotation: has been removed from the MGLMapViewDelegate protocol, but %@ still implements it. " + @"Implement -[%@ mapView:imageForAnnotation:] instead.", + NSStringFromClass([delegate class]), NSStringFromClass([delegate class])]; + } } #pragma mark - Layout - From 184afb01adf4553c5c91d761b0d667eaafe646c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Wed, 8 Jul 2015 13:13:32 -0700 Subject: [PATCH 04/24] Removed documentation for unavailable method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So it doesn’t show up in the generated docset. --- include/mbgl/ios/MGLMapView.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index 900728034..4b21d5bad 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -345,10 +345,6 @@ IB_DESIGNABLE /** @name Managing the Display of Annotations */ -/** Returns the style's symbol name to use for the marker for the specified point annotation object. -* @param mapView The map view that requested the annotation symbol name. -* @param annotation The object representing the annotation that is about to be displayed. -* @return The marker symbol to display for the specified annotation or `nil` if you want to display the default symbol. */ - (nullable NSString *)mapView:(MGLMapView *)mapView symbolNameForAnnotation:(id )annotation __attribute__((unavailable("Use -mapView:imageForAnnotation:."))); /** Returns an image object to use for the marker for the specified point annotation object. From 0fd9fe78dbb27cdd8cdea1d664596c226a6273b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Wed, 1 Jul 2015 23:48:16 -0700 Subject: [PATCH 05/24] Defer initialization until app enters foreground Defer the creation of EAGLEContext and GLKView and the loading of OpenGL ES extensions. It is GLKView that drives the background crash, and Apple documentation specifically warns not to initialize an EAGLContext in the background. All the while, it should be safe for client code to avail itself of any public methods on MGLMapView. Fixes #1460. --- platform/ios/MGLMapView.mm | 105 ++++++++++++++++++++++--------------- 1 file changed, 64 insertions(+), 41 deletions(-) diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 3fd0ed02c..6220c8971 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -206,58 +206,28 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) - (void)commonInit { _isTargetingInterfaceBuilder = NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent; + + BOOL background = [UIApplication sharedApplication].applicationState == UIApplicationStateBackground; + if (!background) + { + [self createGLView]; + } - // create context - // - _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; - NSAssert(_context, @"Failed to create OpenGL ES context."); - // setup accessibility - // self.accessibilityLabel = @"Map"; - - // create GL view - // - _glView = [[GLKView alloc] initWithFrame:self.bounds context:_context]; - _glView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - _glView.enableSetNeedsDisplay = YES; - _glView.drawableStencilFormat = GLKViewDrawableStencilFormat8; - _glView.drawableDepthFormat = GLKViewDrawableDepthFormat16; - - const float scaleFactor = [UIScreen instancesRespondToSelector:@selector(nativeScale)] ? [[UIScreen mainScreen] nativeScale] : [[UIScreen mainScreen] scale]; - _glView.contentScaleFactor = scaleFactor; - _glView.delegate = self; - [_glView bindDrawable]; - [self insertSubview:_glView atIndex:0]; - - _glView.contentMode = UIViewContentModeCenter; - self.backgroundColor = [UIColor clearColor]; self.clipsToBounds = YES; - // load extensions - // - mbgl::gl::InitializeExtensions([](const char * name) { - static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengles")); - if (!framework) { - throw std::runtime_error("Failed to load OpenGL framework."); - } - - CFStringRef str = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII); - void* symbol = CFBundleGetFunctionPointerForName(framework, str); - CFRelease(str); - - return reinterpret_cast(symbol); - }); - // setup mbgl map // + const float scaleFactor = [UIScreen instancesRespondToSelector:@selector(nativeScale)] ? [[UIScreen mainScreen] nativeScale] : [[UIScreen mainScreen] scale]; _mbglView = new MBGLView(self, scaleFactor); _mbglFileSource = new mbgl::DefaultFileSource([MGLFileCache obtainSharedCacheWithObject:self]); - // Start paused on the IB canvas + // Start paused _mbglMap = new mbgl::Map(*_mbglView, *_mbglFileSource, mbgl::MapMode::Continuous); - if (_isTargetingInterfaceBuilder) { + if (_isTargetingInterfaceBuilder || background) { + self.dormant = YES; _mbglMap->pause(); } @@ -404,7 +374,59 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) }]; } --(void)reachabilityChanged:(NSNotification*)notification +- (void)createGLView +{ + if (_context || [UIApplication sharedApplication].applicationState == UIApplicationStateBackground) { + return; + } + + // create context + // + _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; + NSAssert(_context, @"Failed to create OpenGL ES context."); + + // create GL view + // + _glView = [[GLKView alloc] initWithFrame:self.bounds context:_context]; + _glView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + _glView.enableSetNeedsDisplay = YES; + _glView.drawableStencilFormat = GLKViewDrawableStencilFormat8; + _glView.drawableDepthFormat = GLKViewDrawableDepthFormat16; + _glView.contentScaleFactor = [UIScreen instancesRespondToSelector:@selector(nativeScale)] ? [[UIScreen mainScreen] nativeScale] : [[UIScreen mainScreen] scale]; + _glView.delegate = self; + [_glView bindDrawable]; + [self insertSubview:_glView atIndex:0]; + + _glView.contentMode = UIViewContentModeCenter; + + // load extensions + // + mbgl::gl::InitializeExtensions([](const char * name) { + static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengles")); + if (!framework) { + throw std::runtime_error("Failed to load OpenGL framework."); + } + + CFStringRef str = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII); + void* symbol = CFBundleGetFunctionPointerForName(framework, str); + CFRelease(str); + + return reinterpret_cast(symbol); + }); +} + +- (void)viewWillEnterForeground +{ + [[NSNotificationCenter defaultCenter] removeObserver:self + name:UIApplicationWillEnterForegroundNotification + object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self + name:UIApplicationDidBecomeActiveNotification + object:nil]; + [self commonInit]; +} + +- (void)reachabilityChanged:(NSNotification *)notification { MGLReachability *reachability = [notification object]; if ([reachability isReachable]) { @@ -777,6 +799,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) { MGLAssertIsMainThread(); + [self createGLView]; if (self.isDormant) { self.dormant = NO; From 9e5dd29afeb1c2d562ecb9cad520c8e8ffffe144 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Wed, 8 Jul 2015 15:41:27 -0700 Subject: [PATCH 06/24] bump podspec to 0.5.0-rc.1 w/ symbols --- ios/MapboxGL.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/MapboxGL.podspec b/ios/MapboxGL.podspec index 5b4597909..fb4ca8518 100644 --- a/ios/MapboxGL.podspec +++ b/ios/MapboxGL.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'MapboxGL' - m.version = '0.4.5-symbols' + m.version = '0.5.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.' From b8522ba03aec5cc6159a9af26c5e6bed0a6f4f50 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Wed, 8 Jul 2015 15:41:52 -0700 Subject: [PATCH 07/24] [publish ios-v0.5.0-rc.1] From 82cddb5af29d30181c1b61bab6183471456b6d2a Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 9 Jul 2015 08:54:44 -0700 Subject: [PATCH 08/24] fixes #1858: proper shape placement in style layers --- src/mbgl/map/map_context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index 5b1825bff..aff323d3f 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -206,7 +206,7 @@ void MapContext::updateAnnotationTiles(const std::unordered_settype = (shapeStyle.is() ? StyleLayerType::Line : StyleLayerType::Fill); // add to end of other shape layers just before (last) point layer - style->layers.emplace((style->layers.end() - 2), shapeLayer); + style->layers.emplace((style->layers.end() - 1), shapeLayer); // create shape bucket & connect to source util::ptr shapeBucket = std::make_shared(shapeLayer->type); From 3318a3ced0d0c115e8ba4be40e669619ce4537af Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 9 Jul 2015 09:48:09 -0700 Subject: [PATCH 09/24] refs #1859: use traditional struct declaration --- include/mbgl/map/map.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 72800a9c1..294d0efcd 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -36,14 +36,17 @@ enum class AnnotationType : uint8_t { Shape = 1 << 1, }; +struct EdgeInsets { + double top = 0; + double left = 0; + double bottom = 0; + double right = 0; +}; + using AnnotationIDs = std::vector; using AnnotationSegment = std::vector; using AnnotationSegments = std::vector; -using EdgeInsets = struct { - double top, left, bottom, right; -}; - class Map : private util::noncopyable { friend class View; From 2df80af3d3616c0e174ae1b2e24b5010960bd845 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 9 Jul 2015 13:41:42 -0700 Subject: [PATCH 10/24] Revert "Defer initialization until app enters foreground" This reverts commit 0fd9fe78dbb27cdd8cdea1d664596c226a6273b5. --- platform/ios/MGLMapView.mm | 105 +++++++++++++++---------------------- 1 file changed, 41 insertions(+), 64 deletions(-) diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 6220c8971..3fd0ed02c 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -206,28 +206,58 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) - (void)commonInit { _isTargetingInterfaceBuilder = NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent; - - BOOL background = [UIApplication sharedApplication].applicationState == UIApplicationStateBackground; - if (!background) - { - [self createGLView]; - } + // create context + // + _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; + NSAssert(_context, @"Failed to create OpenGL ES context."); + // setup accessibility + // self.accessibilityLabel = @"Map"; + + // create GL view + // + _glView = [[GLKView alloc] initWithFrame:self.bounds context:_context]; + _glView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + _glView.enableSetNeedsDisplay = YES; + _glView.drawableStencilFormat = GLKViewDrawableStencilFormat8; + _glView.drawableDepthFormat = GLKViewDrawableDepthFormat16; + + const float scaleFactor = [UIScreen instancesRespondToSelector:@selector(nativeScale)] ? [[UIScreen mainScreen] nativeScale] : [[UIScreen mainScreen] scale]; + _glView.contentScaleFactor = scaleFactor; + _glView.delegate = self; + [_glView bindDrawable]; + [self insertSubview:_glView atIndex:0]; + + _glView.contentMode = UIViewContentModeCenter; + self.backgroundColor = [UIColor clearColor]; self.clipsToBounds = YES; + // load extensions + // + mbgl::gl::InitializeExtensions([](const char * name) { + static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengles")); + if (!framework) { + throw std::runtime_error("Failed to load OpenGL framework."); + } + + CFStringRef str = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII); + void* symbol = CFBundleGetFunctionPointerForName(framework, str); + CFRelease(str); + + return reinterpret_cast(symbol); + }); + // setup mbgl map // - const float scaleFactor = [UIScreen instancesRespondToSelector:@selector(nativeScale)] ? [[UIScreen mainScreen] nativeScale] : [[UIScreen mainScreen] scale]; _mbglView = new MBGLView(self, scaleFactor); _mbglFileSource = new mbgl::DefaultFileSource([MGLFileCache obtainSharedCacheWithObject:self]); - // Start paused + // Start paused on the IB canvas _mbglMap = new mbgl::Map(*_mbglView, *_mbglFileSource, mbgl::MapMode::Continuous); - if (_isTargetingInterfaceBuilder || background) { - self.dormant = YES; + if (_isTargetingInterfaceBuilder) { _mbglMap->pause(); } @@ -374,59 +404,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) }]; } -- (void)createGLView -{ - if (_context || [UIApplication sharedApplication].applicationState == UIApplicationStateBackground) { - return; - } - - // create context - // - _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; - NSAssert(_context, @"Failed to create OpenGL ES context."); - - // create GL view - // - _glView = [[GLKView alloc] initWithFrame:self.bounds context:_context]; - _glView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - _glView.enableSetNeedsDisplay = YES; - _glView.drawableStencilFormat = GLKViewDrawableStencilFormat8; - _glView.drawableDepthFormat = GLKViewDrawableDepthFormat16; - _glView.contentScaleFactor = [UIScreen instancesRespondToSelector:@selector(nativeScale)] ? [[UIScreen mainScreen] nativeScale] : [[UIScreen mainScreen] scale]; - _glView.delegate = self; - [_glView bindDrawable]; - [self insertSubview:_glView atIndex:0]; - - _glView.contentMode = UIViewContentModeCenter; - - // load extensions - // - mbgl::gl::InitializeExtensions([](const char * name) { - static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengles")); - if (!framework) { - throw std::runtime_error("Failed to load OpenGL framework."); - } - - CFStringRef str = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII); - void* symbol = CFBundleGetFunctionPointerForName(framework, str); - CFRelease(str); - - return reinterpret_cast(symbol); - }); -} - -- (void)viewWillEnterForeground -{ - [[NSNotificationCenter defaultCenter] removeObserver:self - name:UIApplicationWillEnterForegroundNotification - object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self - name:UIApplicationDidBecomeActiveNotification - object:nil]; - [self commonInit]; -} - -- (void)reachabilityChanged:(NSNotification *)notification +-(void)reachabilityChanged:(NSNotification*)notification { MGLReachability *reachability = [notification object]; if ([reachability isReachable]) { @@ -799,7 +777,6 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) { MGLAssertIsMainThread(); - [self createGLView]; if (self.isDormant) { self.dormant = NO; From 7aa83b3c9635b3c952b4d8e3d77dfc48d157f847 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Wed, 8 Jul 2015 22:30:52 -0700 Subject: [PATCH 11/24] test on Xcode 6.4 / iOS 8.4 --- .travis.yml | 4 ++-- scripts/ios/test.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e5b94a813..ccd4cd035 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,10 +25,10 @@ matrix: sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5' ] packages: [ 'gdb', 'clang-3.5', 'libstdc++-4.9-dev', 'libstdc++6', 'libllvm3.4', 'xutils-dev', 'libxxf86vm-dev', 'x11proto-xf86vidmode-dev', 'mesa-utils' ] - os: osx - osx_image: beta-xcode6.3 + osx_image: beta-xcode6.4 env: FLAVOR=osx BUILDTYPE=Debug - os: osx - osx_image: beta-xcode6.3 + osx_image: beta-xcode6.4 env: FLAVOR=ios BUILDTYPE=Release - os: linux env: FLAVOR=android ANDROID_ABI=arm-v7 BUILDTYPE=Release diff --git a/scripts/ios/test.sh b/scripts/ios/test.sh index bfaed4646..170aa0f64 100755 --- a/scripts/ios/test.sh +++ b/scripts/ios/test.sh @@ -7,5 +7,5 @@ set -u xctool \ -project ./test/ios/ios-tests.xcodeproj \ -scheme 'Mapbox GL Tests' \ - -sdk iphonesimulator8.3 \ + -sdk iphonesimulator8.4 \ test From 5f316975568e03c64873ef496c6ff6ee013d28fa Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 9 Jul 2015 13:58:28 -0700 Subject: [PATCH 12/24] bump podspec to 0.5.0rc2 --- ios/MapboxGL.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/MapboxGL.podspec b/ios/MapboxGL.podspec index fb4ca8518..896f69c96 100644 --- a/ios/MapboxGL.podspec +++ b/ios/MapboxGL.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'MapboxGL' - m.version = '0.5.0-rc.1-symbols' + m.version = '0.5.0-rc.2-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.' From c780f1617e459e3e13fadff3a34fa3a835908951 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 9 Jul 2015 13:59:11 -0700 Subject: [PATCH 13/24] [publish ios-v0.5.0-rc.2] From 91b2912c2d910dc4ff3ce4258ac742d42f35c907 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 9 Jul 2015 22:27:41 -0700 Subject: [PATCH 14/24] bump podspec to 0.5.0 final (no symbols) --- ios/MapboxGL.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/MapboxGL.podspec b/ios/MapboxGL.podspec index 896f69c96..c042f4f01 100644 --- a/ios/MapboxGL.podspec +++ b/ios/MapboxGL.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'MapboxGL' - m.version = '0.5.0-rc.2-symbols' + m.version = '0.5.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.' From 7d250934b15f85f701d6c28a0a68959fe1144f52 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 9 Jul 2015 22:28:02 -0700 Subject: [PATCH 15/24] [publish ios-v0.5.0] From 4acf6c4268231b09c81dd376f1f672ade1c278d9 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 9 Jul 2015 22:54:54 -0700 Subject: [PATCH 16/24] updated changelog for 0.5.0 --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07f6672aa..0afd3f64b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## 0.5.0 + +### Core + +- Support for runtime marker imagery. ([#941](https://github.com/mapbox/mapbox-gl-native/pull/941)) +- Added `Map::fitBounds()` for region-based viewport setting. ([#1092](https://github.com/mapbox/mapbox-gl-native/issues/1092)) +- Added a raster satellite bundled style and improved raster rendering. ([#963](https://github.com/mapbox/mapbox-gl-native/issues/963)) +- Improved round line joins for semi-transparent lines. ([#1839](https://github.com/mapbox/mapbox-gl-native/pull/1839)) +- Improved map render lifecycle notifications. ([#1026](https://github.com/mapbox/mapbox-gl-native/issues/1026)) +- Fixed a bug that caused annotations not to show at zoom level zero. ([#1279](https://github.com/mapbox/mapbox-gl-native/issues/1279)) +- Fixed a bug with the ordering of shape layers. ([#1866](https://github.com/mapbox/mapbox-gl-native/pull/1866)) +- Other bug fixes and performance improvements. + +### iOS + +- **Breaking:** Removed `-[MGLMapViewDelegate mapView:symbolNameForAnnotation:]` since runtime imagery can be used. ([#1851](https://github.com/mapbox/mapbox-gl-native/issues/1851)) +- **Breaking:** Reversed the compass `direction` polarity to be consistent with other map frameworks. ([#1780](https://github.com/mapbox/mapbox-gl-native/issues/1780)) +- Added `MGLAnnotationImage` and `MGLGeometry` routines. +- Improved `UIView` tracking to the map. ([#1813](https://github.com/mapbox/mapbox-gl-native/pull/1813)) +- Exposed compass, Mapbox logo, and attribution button as hideable views. ([#1770](https://github.com/mapbox/mapbox-gl-native/pull/1770)) +- Build against iOS 8.4. ([#1868](https://github.com/mapbox/mapbox-gl-native/pull/1868)) + ## 0.4.0 ### Core From 9bb50321030a99fcb8215d5a7b78a60772ed3e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 10 Jul 2015 11:33:43 -0700 Subject: [PATCH 17/24] Replaced release notes for 0.5.0 Replaced the release notes with more detailed ones from . This change also fixes a build error due to a reference to a method that had been removed. --- CHANGELOG.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0afd3f64b..5867b2d13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,11 +15,18 @@ ### iOS -- **Breaking:** Removed `-[MGLMapViewDelegate mapView:symbolNameForAnnotation:]` since runtime imagery can be used. ([#1851](https://github.com/mapbox/mapbox-gl-native/issues/1851)) -- **Breaking:** Reversed the compass `direction` polarity to be consistent with other map frameworks. ([#1780](https://github.com/mapbox/mapbox-gl-native/issues/1780)) -- Added `MGLAnnotationImage` and `MGLGeometry` routines. +- **Breaking:** Headers now make use of lightweight generics, eliminating many unnecessary casts when working with annotations in Swift 2.0 in Xcode 7. ([#1711](https://github.com/mapbox/mapbox-gl-native/pull/1711)) +- **Breaking:** `-mapView:symbolNameForAnnotation:` has been removed from the `MGLMapViewDelegate` protocol. Implement `-mapView:imageForAnnotation:` instead, which accepts images at runtime. ([#941](https://github.com/mapbox/mapbox-gl-native/pull/941)) +- **Breaking:** `MGLMapView.direction` is now expressed in terms of degrees clockwise from true north, as indicated in the documentation, rather than counterclockwise. ([#1789](https://github.com/mapbox/mapbox-gl-native/pull/1789)) +- A Satellite style showing Mapbox Satellite imagery is now bundled with Mapbox GL. ([#1845](https://github.com/mapbox/mapbox-gl-native/pull/1845)) - Improved `UIView` tracking to the map. ([#1813](https://github.com/mapbox/mapbox-gl-native/pull/1813)) -- Exposed compass, Mapbox logo, and attribution button as hideable views. ([#1770](https://github.com/mapbox/mapbox-gl-native/pull/1770)) +- Delegate method `-[MGLMapViewDelegate mapView:didFailToLocateUserWithError:]` now works. ([#1608](https://github.com/mapbox/mapbox-gl-native/pull/1608)) +- It is now possible to fit the map’s viewport to a coordinate bounding box via `-[MGLMapView setVisibleCoordinateBounds:animated:]` or to a specific set of coordinates via `-[MGLMapView setVisibleCoordinates:count:edgePadding:animated:]`. ([#1783](https://github.com/mapbox/mapbox-gl-native/pull/1783), [#1795](https://github.com/mapbox/mapbox-gl-native/pull/1795)) +- The logo and ℹ️ no longer disappear or get distorted after embedding MGLMapView in a different view, and you can now access these subviews directly via properties on MGLMapView. ([#1779](https://github.com/mapbox/mapbox-gl-native/pull/1779), [#1815](https://github.com/mapbox/mapbox-gl-native/pull/1815)) +- Raster tiles now look sharper midway between two zoom levels. ([#1843](https://github.com/mapbox/mapbox-gl-native/pull/1843)) +- Resetting the map rotation to north no longer also resets the user location tracking mode. ([#1809](https://github.com/mapbox/mapbox-gl-native/pull/1809)) +- `-[MGLMapView convertPoint:toCoordinateFromView:]` now returns accurate coordinates on iPhone 6. ([#1827](https://github.com/mapbox/mapbox-gl-native/pull/1827)) +- Fixed an issue in which `-[MGLMapView direction]` would sometimes return 360 instead of 0. ([#1829](https://github.com/mapbox/mapbox-gl-native/pull/1829)) - Build against iOS 8.4. ([#1868](https://github.com/mapbox/mapbox-gl-native/pull/1868)) ## 0.4.0 From 06fd6d5c1e3ba2fb0c7dc899406ec5a90174a906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 10 Jul 2015 11:42:46 -0700 Subject: [PATCH 18/24] Cherry-picked part of 987d961e5bd2a7b9a68c4f05dd8b599eb1357add to fix the build --- platform/ios/MGLMapboxEvents.m | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index eb8d909db..314d50dd0 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -604,10 +604,7 @@ const NSTimeInterval MGLFlushInterval = 60; [request setHTTPBody:jsonData]; // Send non blocking HTTP Request to server - NSURLSessionDataTask *task = [_session dataTaskWithRequest:request completionHandler:^(__unused NSData * __nullable data, __unused NSURLResponse * __nullable response, __unused NSError * __nullable error) - { - }]; - [task resume]; + [[_session dataTaskWithRequest:request] resume]; } }); } From 97b7307f3519ecd749502043281e918287c0b616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 10 Jul 2015 10:45:55 -0700 Subject: [PATCH 19/24] Force -ObjC in Mapbox GL pod Fixes #1849. --- ios/MapboxGL.podspec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ios/MapboxGL.podspec b/ios/MapboxGL.podspec index c042f4f01..e581312e7 100644 --- a/ios/MapboxGL.podspec +++ b/ios/MapboxGL.podspec @@ -29,6 +29,9 @@ Pod::Spec.new do |m| m.frameworks = 'CoreLocation', 'CoreTelephony', 'GLKit', 'ImageIO', 'MobileCoreServices', 'QuartzCore', 'SystemConfiguration' m.libraries = 'c++', 'sqlite3', 'z' - m.xcconfig = { 'OTHER_CPLUSPLUSFLAGS' => '-std=gnu++11 -stdlib=libc++' } + m.xcconfig = { + 'OTHER_CPLUSPLUSFLAGS' => '-std=gnu++11 -stdlib=libc++', + 'OTHER_LDFLAGS' => '-ObjC', + } end From 1350ed76540781823e584ec996cace3895021430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Sat, 11 Jul 2015 15:57:11 -0700 Subject: [PATCH 20/24] Fetch tags before relying on a list of them Cherry-picked from 482b8bde6314b38c061040fe2f885bc2068014b1 to fix the build. --- scripts/ios/package.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ios/package.sh b/scripts/ios/package.sh index 25306bb06..91e70dbba 100755 --- a/scripts/ios/package.sh +++ b/scripts/ios/package.sh @@ -109,6 +109,7 @@ if [ -z `which appledoc` ]; then exit 1 fi DOCS_OUTPUT="${OUTPUT}/static/Docs" +git fetch --tags DOCS_VERSION=$( git tag --sort -v:refname | grep -v '\-rc.' | sed -n '1p' | sed 's/^v//' ) rm -rf /tmp/mbgl mkdir -p /tmp/mbgl/ From c066931a49adc3b78a2f8c31e500dc3073c394c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Sat, 11 Jul 2015 15:14:16 -0700 Subject: [PATCH 21/24] Opt into Xcode 6.4 Cherry-picked from 5f7575dd8feea880fd4ab1c414e281db2ef66cf6 to fix the build. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ccd4cd035..f25079de5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,10 +25,10 @@ matrix: sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5' ] packages: [ 'gdb', 'clang-3.5', 'libstdc++-4.9-dev', 'libstdc++6', 'libllvm3.4', 'xutils-dev', 'libxxf86vm-dev', 'x11proto-xf86vidmode-dev', 'mesa-utils' ] - os: osx - osx_image: beta-xcode6.4 + osx_image: xcode6.4 env: FLAVOR=osx BUILDTYPE=Debug - os: osx - osx_image: beta-xcode6.4 + osx_image: xcode6.4 env: FLAVOR=ios BUILDTYPE=Release - os: linux env: FLAVOR=android ANDROID_ABI=arm-v7 BUILDTYPE=Release From b65f30966bb05ebcff4dd6add0c7ea149cd1bdfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Mon, 13 Jul 2015 10:15:33 -0700 Subject: [PATCH 22/24] Updated changelog for 0.5.1 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5867b2d13..45b1959a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.5.1 + +### iOS + +- Added support for CocoaPods 0.38.0. ([#1876](https://github.com/mapbox/mapbox-gl-native/pull/1876)) + ## 0.5.0 ### Core From 970ad1fe1b25cd2fc6e33f84e890ddd90f6874f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Mon, 13 Jul 2015 10:50:51 -0700 Subject: [PATCH 23/24] Updated podspec for 0.5.1 --- ios/MapboxGL.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/MapboxGL.podspec b/ios/MapboxGL.podspec index e581312e7..a49fb7deb 100644 --- a/ios/MapboxGL.podspec +++ b/ios/MapboxGL.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'MapboxGL' - m.version = '0.5.0' + m.version = '0.5.1' 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.' From f5e38ee21a0d6db9e7d21bf4e904b5e76789c9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Mon, 13 Jul 2015 10:52:57 -0700 Subject: [PATCH 24/24] [publish ios-v0.5.1]