From 850b2e29889091684b088ad64741aa469a8db628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Tue, 26 Jul 2016 22:45:29 -0700 Subject: [ios] Fixed crash drawing compass on iOS 8.1 (#5791) Fixes #5780. --- platform/ios/CHANGELOG.md | 4 ++++ platform/ios/src/MGLMapView.mm | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 049d165c2c..e55624f8bb 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,6 +2,10 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. +## 3.3.2 + +* Fixed a crash that occurred when initializing an MGLMapView on iOS 8.1 or below. ([#5791](https://github.com/mapbox/mapbox-gl-native/pull/5791)) + ## 3.3.1 * Fixed a crash that occurred when a sprite URL lacks a file extension. See [this comment](https://github.com/mapbox/mapbox-gl-native/issues/5722#issuecomment-233701251) to determine who may be affected by this bug. ([#5723](https://github.com/mapbox/mapbox-gl-native/pull/5723)) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 4d692fa718..b36efe3bd7 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -586,9 +586,18 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) UIGraphicsBeginImageContextWithOptions(scaleImage.size, NO, [UIScreen mainScreen].scale); [scaleImage drawInRect:{ CGPointZero, scaleImage.size }]; - CGFloat weight = &UIFontWeightUltraLight ? UIFontWeightUltraLight : -0.8; + CGFloat northSize = 9; + UIFont *northFont; + if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) + { + northFont = [UIFont systemFontOfSize:northSize weight:UIFontWeightUltraLight]; + } + else + { + northFont = [UIFont systemFontOfSize:northSize]; + } NSAttributedString *north = [[NSAttributedString alloc] initWithString:NSLocalizedStringWithDefaultValue(@"COMPASS_NORTH", nil, nil, @"N", @"Compass abbreviation for north") attributes:@{ - NSFontAttributeName: [UIFont systemFontOfSize:9 weight:weight], + NSFontAttributeName: northFont, NSForegroundColorAttributeName: [UIColor whiteColor], }]; CGRect stringRect = CGRectMake((scaleImage.size.width - north.size.width) / 2, -- cgit v1.2.1 From bc845b96b0d945cc0feea9177017d661f56a5f06 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Wed, 27 Jul 2016 23:32:21 -0700 Subject: [ios] Limit annotation view pan gesture check to own recognizer (#5813) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows non-dragging pans that are initiated on views to pan the underlying map. Annotation views each have long press and pan gesture recognizers. If a view is not draggable or not in a positive dragging state, the pan gesture recognizer should not begin. This commit makes the criteria for rejecting pans more strict — only `_panGestureRecognizer` should be rejected, not the entire `UIPanGestureRecognizer` class. --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLAnnotationView.mm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index e55624f8bb..e3f259ddf1 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -5,6 +5,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CON ## 3.3.2 * Fixed a crash that occurred when initializing an MGLMapView on iOS 8.1 or below. ([#5791](https://github.com/mapbox/mapbox-gl-native/pull/5791)) +* Fixed an issue where pan gestures that originated on view annotations would not pan the underlying map. ([#5813](https://github.com/mapbox/mapbox-gl-native/pull/5813)) ## 3.3.1 diff --git a/platform/ios/src/MGLAnnotationView.mm b/platform/ios/src/MGLAnnotationView.mm index f8591f036b..7064ccbd76 100644 --- a/platform/ios/src/MGLAnnotationView.mm +++ b/platform/ios/src/MGLAnnotationView.mm @@ -235,7 +235,7 @@ { BOOL isDragging = self.dragState == MGLAnnotationViewDragStateDragging; - if ([gestureRecognizer isKindOfClass:UIPanGestureRecognizer.class] && !(isDragging)) + if (gestureRecognizer == _panGestureRecognizer && !(isDragging)) { return NO; } -- cgit v1.2.1 From 438dfa947d142053d75eb606f1bd6998e8d96c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Thu, 28 Jul 2016 14:52:33 -0700 Subject: [ios] Omit accuracy halo from annotation hit testing (#5816) Fixes #5571. --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLMapView.mm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index e3f259ddf1..1dbf22b4ba 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -6,6 +6,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CON * Fixed a crash that occurred when initializing an MGLMapView on iOS 8.1 or below. ([#5791](https://github.com/mapbox/mapbox-gl-native/pull/5791)) * Fixed an issue where pan gestures that originated on view annotations would not pan the underlying map. ([#5813](https://github.com/mapbox/mapbox-gl-native/pull/5813)) +* Fixed an issue that caused the user dot to be selected when tapping an annotation that lies within the user dot’s accuracy circle. ([#5816](https://github.com/mapbox/mapbox-gl-native/pull/5816)) ## 3.3.1 diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index b36efe3bd7..4ec3619189 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1394,8 +1394,8 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) CGPoint tapPoint = [singleTap locationInView:self]; - if (self.userLocationVisible - && [self.userLocationAnnotationView.layer.presentationLayer hitTest:tapPoint]) + CALayer *hitLayer = self.userLocationVisible ? [self.userLocationAnnotationView.layer.presentationLayer hitTest:tapPoint] : nil; + if (hitLayer && hitLayer != self.userLocationAnnotationView.haloLayer.presentationLayer) { if ( ! _userLocationAnnotationIsSelected) { -- cgit v1.2.1 From 05f2af2e339ecff861addf324580ebb631337c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Thu, 28 Jul 2016 15:04:13 -0700 Subject: [ios] Fact-checked, economized changelog entries #5791 affects iOS 7.x, not 8.1 or 8.2. Describe #5813 in simpler terms. --- platform/ios/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 1dbf22b4ba..913d32b35d 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -4,8 +4,8 @@ Mapbox welcomes participation and contributions from everyone. Please read [CON ## 3.3.2 -* Fixed a crash that occurred when initializing an MGLMapView on iOS 8.1 or below. ([#5791](https://github.com/mapbox/mapbox-gl-native/pull/5791)) -* Fixed an issue where pan gestures that originated on view annotations would not pan the underlying map. ([#5813](https://github.com/mapbox/mapbox-gl-native/pull/5813)) +* Speculatively fixed a crash that occurred when initializing an MGLMapView on iOS 7.x. ([#5791](https://github.com/mapbox/mapbox-gl-native/pull/5791)) +* View-backed annotations no longer prevent the user from starting to pan the map. ([#5813](https://github.com/mapbox/mapbox-gl-native/pull/5813)) * Fixed an issue that caused the user dot to be selected when tapping an annotation that lies within the user dot’s accuracy circle. ([#5816](https://github.com/mapbox/mapbox-gl-native/pull/5816)) ## 3.3.1 -- cgit v1.2.1 From 85183dd46eb22152d1af778ea9bc7aeeff5966cf Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Thu, 28 Jul 2016 15:11:49 -0700 Subject: ios-v3.3.2 --- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index 1597c9c7af..8957642f8a 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.3.1-symbols' + m.version = '3.3.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 Touch APIs.' diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index 8990c2b36a..6ff31a70e0 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.3.1' + m.version = '3.3.2' 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 Touch APIs.' -- cgit v1.2.1 From e643ffe7f43786fb0b60c09c681d5360c9485fc4 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Fri, 29 Jul 2016 09:48:26 -0700 Subject: [core] Add changes to respect minzoom and maxzoom This adds only the changes made in https://github.com/mapbox/mapbox-gl-native/pull/5828 to address the issue where the style zoom levels were not respected when deciding when to render a layer. --- src/mbgl/style/layer_impl.cpp | 9 ++++++--- src/mbgl/style/layer_impl.hpp | 2 +- src/mbgl/style/style.cpp | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/mbgl/style/layer_impl.cpp b/src/mbgl/style/layer_impl.cpp index 74cc80d253..56f66d1789 100644 --- a/src/mbgl/style/layer_impl.cpp +++ b/src/mbgl/style/layer_impl.cpp @@ -11,9 +11,12 @@ bool Layer::Impl::hasRenderPass(RenderPass pass) const { return bool(passes & pass); } -bool Layer::Impl::needsRendering() const { - return passes != RenderPass::None && visibility != VisibilityType::None; -} +bool Layer::Impl::needsRendering(float zoom) const { + return passes != RenderPass::None + && visibility != VisibilityType::None + && minZoom <= zoom + && maxZoom >= zoom; + } } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layer_impl.hpp b/src/mbgl/style/layer_impl.hpp index dcd5d9906b..c84e9b9dea 100644 --- a/src/mbgl/style/layer_impl.hpp +++ b/src/mbgl/style/layer_impl.hpp @@ -59,7 +59,7 @@ public: bool hasRenderPass(RenderPass) const; // Checks whether this layer can be rendered. - bool needsRendering() const; + bool needsRendering(float zoom) const; virtual float getQueryRadius() const { return 0; } virtual bool queryIntersectsGeometry( diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 5ca36b030f..d9b49d4309 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -212,7 +212,7 @@ void Style::recalculate(float z, const TimePoint& timePoint, MapMode mode) { hasPendingTransitions |= layer->baseImpl->recalculate(parameters); Source* source = getSource(layer->baseImpl->source); - if (source && layer->baseImpl->needsRendering()) { + if (source && layer->baseImpl->needsRendering(z)) { source->enabled = true; if (!source->loaded && !source->isLoading()) { source->load(fileSource); -- cgit v1.2.1 From b928ac5bd407efb8e4fad1e47d843eb203014841 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Fri, 29 Jul 2016 10:37:36 -0700 Subject: ios-v3.3.3 Bump version number and update changelog. --- platform/ios/CHANGELOG.md | 4 ++++ platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 913d32b35d..1b90d20999 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,6 +2,10 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. +## 3.3.3 + +* Fixes an issue where the style zoom levels were not respected when deciding when to render a layer. ([#5811](https://github.com/mapbox/mapbox-gl-native/issues/5811)) + ## 3.3.2 * Speculatively fixed a crash that occurred when initializing an MGLMapView on iOS 7.x. ([#5791](https://github.com/mapbox/mapbox-gl-native/pull/5791)) diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index 8957642f8a..cfcc54d325 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.3.2-symbols' + m.version = '3.3.3-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 Touch APIs.' diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index 6ff31a70e0..a315085f3a 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.3.2' + m.version = '3.3.3' 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 Touch APIs.' -- cgit v1.2.1