summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2018-03-14 12:08:24 -0400
committerJason Wray <jason@mapbox.com>2018-03-14 12:48:30 -0400
commit11d506f8034c02103bc33e06ae8913be7908a877 (patch)
tree45aca5ceffc6547a61c5f9818dec8deb65ba133e
parentd7bc36db6f3aa46246bc1aae1c5c63c56b5ce262 (diff)
parent4544b7aae9ab96ff89f3e46a1ee38ce0af95054f (diff)
downloadqtlocation-mapboxgl-11d506f8034c02103bc33e06ae8913be7908a877.tar.gz
Merge tag 'ios-v3.7.6' into master
-rw-r--r--circle.yml34
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java1
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java6
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java5
-rw-r--r--platform/ios/CHANGELOG.md8
-rw-r--r--platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec2
-rw-r--r--platform/ios/Mapbox-iOS-SDK-symbols.podspec2
-rw-r--r--platform/ios/Mapbox-iOS-SDK.podspec2
-rw-r--r--platform/ios/app/MBXViewController.m43
-rw-r--r--platform/ios/bitrise.yml98
-rwxr-xr-xplatform/ios/scripts/document.sh2
-rw-r--r--platform/ios/src/MGLMapView.mm10
-rw-r--r--platform/ios/src/MGLUserLocationHeadingArrowLayer.m2
-rw-r--r--src/mbgl/style/conversion/tileset.cpp2
-rw-r--r--test/style/conversion/tileset.test.cpp10
15 files changed, 110 insertions, 117 deletions
diff --git a/circle.yml b/circle.yml
index 122d8f3b9a..836f5931dd 100644
--- a/circle.yml
+++ b/circle.yml
@@ -34,6 +34,12 @@ workflows:
- ios-debug
#- ios-sanitize-address
- ios-sanitize-thread
+ - ios-release:
+ filters:
+ tags:
+ only: /ios-.*/
+ branches:
+ ignore: /.*/
- macos-debug
- macos-debug-qt5
- macos-release-node4:
@@ -761,6 +767,34 @@ jobs:
- *save-cache
# ------------------------------------------------------------------------------
+ ios-release:
+ macos:
+ xcode: "9.2.0"
+ environment:
+ HOMEBREW_NO_AUTO_UPDATE: 1
+ shell: /bin/bash --login -eo pipefail
+ steps:
+ - checkout
+ - *install-macos-dependencies
+ - run:
+ name: Install packaging dependencies
+ command: |
+ echo "ruby-2.3" > ~/.ruby-version
+ sudo gem install jazzy --no-document
+ brew install awscli wget
+ - *generate-cache-key
+ - *restore-cache
+ - *reset-ccache-stats
+ - run:
+ name: Build, package, and upload iOS release
+ command: |
+ export VERSION_TAG=${CIRCLE_TAG}
+ export GITHUB_TOKEN=${DANGER_GITHUB_API_TOKEN}
+ platform/ios/scripts/deploy-packages.sh
+ - *show-ccache-stats
+ - *save-cache
+
+# ------------------------------------------------------------------------------
macos-debug:
macos:
xcode: "9.2.0"
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java
index caee493e6f..48e3d462ca 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java
@@ -1,6 +1,5 @@
package com.mapbox.mapboxsdk.http;
-
import android.content.Context;
import android.content.pm.PackageInfo;
import android.os.Build;
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
index 90feb228ab..5a32979b69 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
@@ -1065,10 +1065,8 @@ public class MapView extends FrameLayout {
// Called when user pushes a zoom button on the ZoomButtonController
@Override
public void onZoom(boolean zoomIn) {
- if (uiSettings.isZoomGesturesEnabled()) {
- cameraChangeDispatcher.onCameraMoveStarted(CameraChangeDispatcher.REASON_API_ANIMATION);
- onZoom(zoomIn, mapGestureDetector.getFocalPoint());
- }
+ cameraChangeDispatcher.onCameraMoveStarted(CameraChangeDispatcher.REASON_API_ANIMATION);
+ onZoom(zoomIn, mapGestureDetector.getFocalPoint());
}
private void onZoom(boolean zoomIn, @Nullable PointF focalPoint) {
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java
index 12d8dfe85b..2f6110d8b1 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java
@@ -973,12 +973,7 @@ public final class UiSettings {
initMargins[3] = bottom;
// convert initial margins with padding
- int[] contentPadding = projection.getContentPadding();
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) view.getLayoutParams();
- left += contentPadding[0];
- top += contentPadding[1];
- right += contentPadding[2];
- bottom += contentPadding[3];
layoutParams.setMargins(left, top, right, bottom);
// support RTL
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md
index 471dd949c1..7c2fa639c1 100644
--- a/platform/ios/CHANGELOG.md
+++ b/platform/ios/CHANGELOG.md
@@ -33,6 +33,14 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* Added a Hebrew localization. ([#10967](https://github.com/mapbox/mapbox-gl-native/pull/10967))
* Long-pressing the attribution button causes the SDK’s version number to be displayed in the action sheet that appears. ([#10650](https://github.com/mapbox/mapbox-gl-native/pull/10650))
+## 3.7.6 - March 12, 2018
+
+* Fixed an issue where full-resolution tiles could fail to replace lower-resolution placeholders. ([#11227](https://github.com/mapbox/mapbox-gl-native/pull/11227))
+* Fixed an issue where tilesets with bounds that cover the entire world would fail to render. ([#11425](https://github.com/mapbox/mapbox-gl-native/pull/11425))
+* Fixed a memory leak in `MGLMapSnapshotter`. ([#11193](https://github.com/mapbox/mapbox-gl-native/pull/11193))
+* Fixed an issue where the pinch gesture could drift beyond bounds imposed by `-[MGLMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]`. ([#11423](https://github.com/mapbox/mapbox-gl-native/pull/11423))
+* Improved the visibility of the heading indicator arrow. ([#11337](https://github.com/mapbox/mapbox-gl-native/pull/11337))
+
## 3.7.5 - February 16, 2018
* Fixed an issue where requesting location services permission would trigger an unrecoverable loop. ([#11229](https://github.com/mapbox/mapbox-gl-native/pull/11229))
diff --git a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec
index bf2f854b50..268b7b9da6 100644
--- a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec
+++ b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |m|
- version = '3.7.5'
+ version = '3.7.6'
m.name = 'Mapbox-iOS-SDK-nightly-dynamic'
m.version = "#{version}-nightly"
diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec
index e0c787e5da..a1b2441d29 100644
--- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec
+++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |m|
- version = '3.7.5'
+ version = '3.7.6'
m.name = 'Mapbox-iOS-SDK-symbols'
m.version = "#{version}-symbols"
diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec
index ea7ce47a8b..7e696a23cf 100644
--- a/platform/ios/Mapbox-iOS-SDK.podspec
+++ b/platform/ios/Mapbox-iOS-SDK.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |m|
- version = '3.7.5'
+ version = '3.7.6'
m.name = 'Mapbox-iOS-SDK'
m.version = version
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 282dc901d6..6e31df384c 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -18,6 +18,11 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
{ .latitude = -13.15589555, .longitude = -74.2178961777998 },
};
+static const MGLCoordinateBounds colorado = {
+ .sw = { .latitude = 36.986207, .longitude = -109.049896},
+ .ne = { .latitude = 40.989329, .longitude = -102.062592},
+};
+
static NSString * const MBXViewControllerAnnotationViewReuseIdentifer = @"MBXViewControllerAnnotationViewReuseIdentifer";
typedef NS_ENUM(NSInteger, MBXSettingsSections) {
@@ -86,6 +91,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
MBXSettingsMiscellaneousToggleTwoMaps,
MBXSettingsMiscellaneousCountryLabels,
MBXSettingsMiscellaneousShowSnapshots,
+ MBXSettingsMiscellaneousShouldLimitCameraChanges,
MBXSettingsMiscellaneousPrintLogFile,
MBXSettingsMiscellaneousDeleteLogFile,
};
@@ -124,6 +130,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
@property (nonatomic) BOOL usingLocaleBasedCountryLabels;
@property (nonatomic) BOOL reuseQueueStatsEnabled;
@property (nonatomic) BOOL showZoomLevelEnabled;
+@property (nonatomic) BOOL shouldLimitCameraChanges;
@end
@@ -366,7 +373,8 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
@"Embedded Map View",
[NSString stringWithFormat:@"%@ Second Map", ([self.view viewWithTag:2] == nil ? @"Show" : @"Hide")],
[NSString stringWithFormat:@"Show Labels in %@", (_usingLocaleBasedCountryLabels ? @"Default Language" : [[NSLocale currentLocale] displayNameForKey:NSLocaleIdentifier value:[self bestLanguageForUser]])],
- @"Show Snapshots"
+ @"Show Snapshots",
+ [NSString stringWithFormat:@"%@ Camera Changes", (_shouldLimitCameraChanges ? @"Unlimit" : @"Limit")],
]];
if (self.debugLoggingEnabled)
@@ -658,6 +666,14 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
[self performSegueWithIdentifier:@"ShowSnapshots" sender:nil];
break;
}
+ case MBXSettingsMiscellaneousShouldLimitCameraChanges:
+ {
+ self.shouldLimitCameraChanges = !self.shouldLimitCameraChanges;
+ if (self.shouldLimitCameraChanges) {
+ [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(39.748947, -104.995882) zoomLevel:10 direction:0 animated:NO];
+ }
+ break;
+ }
default:
NSAssert(NO, @"All miscellaneous setting rows should be implemented");
break;
@@ -1885,6 +1901,31 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
_usingLocaleBasedCountryLabels = [[self bestLanguageForUser] isEqualToString:@"en"];
}
+- (BOOL)mapView:(MGLMapView *)mapView shouldChangeFromCamera:(MGLMapCamera *)oldCamera toCamera:(MGLMapCamera *)newCamera {
+ if (_shouldLimitCameraChanges) {
+ // Get the current camera to restore it after.
+ MGLMapCamera *currentCamera = mapView.camera;
+
+ // From the new camera obtain the center to test if it’s inside the boundaries.
+ CLLocationCoordinate2D newCameraCenter = newCamera.centerCoordinate;
+
+ // Set the map’s visible bounds to newCamera.
+ mapView.camera = newCamera;
+ MGLCoordinateBounds newVisibleCoordinates = mapView.visibleCoordinateBounds;
+
+ // Revert the camera.
+ mapView.camera = currentCamera;
+
+ // Test if the newCameraCenter and newVisibleCoordinates are inside Colorado.
+ BOOL inside = MGLCoordinateInCoordinateBounds(newCameraCenter, colorado);
+ BOOL intersects = MGLCoordinateInCoordinateBounds(newVisibleCoordinates.ne, colorado) && MGLCoordinateInCoordinateBounds(newVisibleCoordinates.sw, colorado);
+
+ return inside && intersects;
+ } else {
+ return YES;
+ }
+}
+
- (void)mapViewRegionIsChanging:(MGLMapView *)mapView
{
[self updateHUD];
diff --git a/platform/ios/bitrise.yml b/platform/ios/bitrise.yml
deleted file mode 100644
index 24bd054dbc..0000000000
--- a/platform/ios/bitrise.yml
+++ /dev/null
@@ -1,98 +0,0 @@
----
-format_version: 1.0.0
-default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
-trigger_map:
-- pattern: nightly-release
- workflow: nightly-release
-- pattern: release-from-tag
- workflow: release-from-tag
-- pattern: "*"
- is_pull_request_allowed: true
- workflow: primary
-workflows:
- primary:
- steps:
- - script:
- title: Skip Workflow
- inputs:
- - content: echo "This workflow is obsolete — see CircleCi."
- nightly-release:
- steps:
- - script:
- title: Install Dependencies
- inputs:
- - content: |-
- #!/bin/bash
- set -eu -o pipefail
- brew install cmake
- - is_debug: 'yes'
- - script:
- title: Configure AWS-CLI
- inputs:
- - content: |-
- #!/bin/bash
- pip install awscli
- - script:
- title: Build package
- inputs:
- - content: |-
- #!/bin/bash
- set -eu -o pipefail
- export BUILDTYPE=Release
- export BUILD_DEVICE=true
- export FORMAT=dynamic
- make ipackage-strip
- CLOUDWATCH=true platform/ios/scripts/metrics.sh
- platform/ios/scripts/deploy-nightly.sh
- - is_debug: 'yes'
- - slack:
- title: Post to Slack
- inputs:
- - webhook_url: "$SLACK_HOOK_URL"
- - channel: "#gl-bots"
- - from_username: 'Bitrise iOS Nightly 💤'
- - from_username_on_error: 'Bitrise iOS Nightly 💤'
- - message: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
- for <https://github.com/mapbox/mapbox-gl-native/compare/${BITRISE_GIT_BRANCH}@%7B1day%7D...${BITRISE_GIT_BRANCH}|mapbox/mapbox-gl-native@${BITRISE_GIT_BRANCH}>
- completed successfully.'
- - message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
- for <https://github.com/mapbox/mapbox-gl-native/compare/${BITRISE_GIT_BRANCH}@%7B1day%7D...${BITRISE_GIT_BRANCH}|mapbox/mapbox-gl-native@${BITRISE_GIT_BRANCH}>
- failed.'
- - icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png
- - icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png
- release-from-tag:
- steps:
- - script:
- title: Install Dependencies
- inputs:
- - content: |-
- #!/bin/bash
- set -eu -o pipefail
- brew install cmake
- sudo easy_install pip
- sudo pip install awscli
- - is_debug: 'yes'
- - script:
- title: Build package
- inputs:
- - content: |-
- #!/bin/bash
- set -eu -o pipefail
- export VERSION_TAG=${BITRISE_GIT_TAG}
- platform/ios/scripts/deploy-packages.sh
- - is_debug: 'yes'
- - slack:
- title: Post to Slack
- inputs:
- - webhook_url: "$SLACK_HOOK_URL"
- - channel: "#gl-bots"
- - from_username: 'Bitrise iOS Deploy'
- - from_username_on_error: 'Bitrise iOS Deploy'
- - message: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
- for <https://github.com/mapbox/mapbox-gl-native/releases/tag/${BITRISE_GIT_TAG}|`${BITRISE_GIT_TAG}`>
- completed successfully.'
- - message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
- for <https://github.com/mapbox/mapbox-gl-native/releases/tag/${BITRISE_GIT_TAG}|`${BITRISE_GIT_TAG}`>
- failed.'
- - icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png
- - icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png
diff --git a/platform/ios/scripts/document.sh b/platform/ios/scripts/document.sh
index 57b596a4b9..43cbe3067a 100755
--- a/platform/ios/scripts/document.sh
+++ b/platform/ios/scripts/document.sh
@@ -6,7 +6,7 @@ set -u
if [ -z `which jazzy` ]; then
echo "Installing jazzy…"
- gem install jazzy --no-rdoc --no-ri
+ gem install jazzy --no-document
if [ -z `which jazzy` ]; then
echo "Unable to install jazzy. See https://github.com/mapbox/mapbox-gl-native/blob/master/platform/ios/INSTALL.md"
exit 1
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index cad14343a8..6be6a71f66 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -1470,10 +1470,12 @@ public:
double zoom = log2(newScale);
MGLMapCamera *toCamera = [self cameraByZoomingToZoomLevel:zoom aroundAnchorPoint:centerPoint];
- if ([self _shouldChangeFromCamera:oldCamera toCamera:toCamera])
+ if ( ! [self _shouldChangeFromCamera:oldCamera toCamera:toCamera])
{
drift = NO;
- } else {
+ }
+ else
+ {
if (drift)
{
_mbglMap->setZoom(zoom, mbgl::ScreenCoordinate { centerPoint.x, centerPoint.y }, MGLDurationFromTimeInterval(duration));
@@ -1706,7 +1708,9 @@ public:
{
[weakSelf unrotateIfNeededForGesture];
}];
- } else {
+ }
+ else
+ {
[self unrotateIfNeededForGesture];
}
}
diff --git a/platform/ios/src/MGLUserLocationHeadingArrowLayer.m b/platform/ios/src/MGLUserLocationHeadingArrowLayer.m
index 912ce30c35..d81cb5a09a 100644
--- a/platform/ios/src/MGLUserLocationHeadingArrowLayer.m
+++ b/platform/ios/src/MGLUserLocationHeadingArrowLayer.m
@@ -3,7 +3,7 @@
#import "MGLFaux3DUserLocationAnnotationView.h"
#import "MGLGeometry.h"
-const CGFloat MGLUserLocationHeadingArrowSize = 6;
+const CGFloat MGLUserLocationHeadingArrowSize = 8;
@implementation MGLUserLocationHeadingArrowLayer
diff --git a/src/mbgl/style/conversion/tileset.cpp b/src/mbgl/style/conversion/tileset.cpp
index 6d89cef944..a2c4aa80b3 100644
--- a/src/mbgl/style/conversion/tileset.cpp
+++ b/src/mbgl/style/conversion/tileset.cpp
@@ -103,6 +103,8 @@ optional<Tileset> Converter<Tileset>::operator()(const Convertible& value, Error
error = { "bounds left longitude should be less than right longitude" };
return {};
}
+ *left = util::max(-180.0, *left);
+ *right = util::min(180.0, *right);
result.bounds = LatLngBounds::hull({ *bottom, *left }, { *top, *right });
}
diff --git a/test/style/conversion/tileset.test.cpp b/test/style/conversion/tileset.test.cpp
index 9487277cca..f10aa0e318 100644
--- a/test/style/conversion/tileset.test.cpp
+++ b/test/style/conversion/tileset.test.cpp
@@ -62,6 +62,16 @@ TEST(Tileset, ValidWorldBounds) {
EXPECT_EQ(converted->bounds, LatLngBounds::hull({90, -180}, {-90, 180}));
}
+TEST(Tileset, BoundsAreClamped) {
+ Error error;
+ mbgl::optional<Tileset> converted = convertJSON<Tileset>(R"JSON({
+ "tiles": ["http://mytiles"],
+ "bounds": [-181.0000005,-90,180.00000000000006,90]
+ })JSON", error);
+ EXPECT_TRUE((bool) converted);
+ EXPECT_EQ(converted->bounds, LatLngBounds::hull({90, -180}, {-90, 180}));
+}
+
TEST(Tileset, FullConversion) {
Error error;
Tileset converted = *convertJSON<Tileset>(R"JSON({