Merge tag 'ios-v3.7.6' into master

This commit is contained in:
Jason Wray
2018-03-14 12:08:24 -04:00
15 changed files with 110 additions and 117 deletions

View File

@@ -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:
@@ -760,6 +766,34 @@ jobs:
- *show-ccache-stats
- *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:

View File

@@ -1,6 +1,5 @@
package com.mapbox.mapboxsdk.http;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.os.Build;

View File

@@ -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) {

View File

@@ -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

View File

@@ -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))

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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];

View File

@@ -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

View File

@@ -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

View File

@@ -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];
}
}

View File

@@ -3,7 +3,7 @@
#import "MGLFaux3DUserLocationAnnotationView.h"
#import "MGLGeometry.h"
const CGFloat MGLUserLocationHeadingArrowSize = 6;
const CGFloat MGLUserLocationHeadingArrowSize = 8;
@implementation MGLUserLocationHeadingArrowLayer

View File

@@ -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 });
}

View File

@@ -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({