diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-01-04 12:55:19 -0600 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-01-04 12:55:19 -0600 |
commit | 187b6dc31cf281b5157de1acd92f3e8ef9d0acf9 (patch) | |
tree | 1d9eaac5d1e8393d8fd665aa678581a6086a9eb6 /platform/ios/src | |
parent | c62b0af24fc76b4bb2eb34100611dd3ee9ee5536 (diff) | |
parent | 760ef23ac3faf4437cadb52983383c9501336964 (diff) | |
download | qtlocation-mapboxgl-187b6dc31cf281b5157de1acd92f3e8ef9d0acf9.tar.gz |
Merge branch 'release-agua' into masterupstream/fabian-merge-release-agua
# Conflicts:
# circle.yml
# cmake/core-files.cmake
# platform/android/CHANGELOG.md
# platform/android/MapboxGLAndroidSDK/build.gradle
# platform/android/MapboxGLAndroidSDK/gradle.properties
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/CameraChangeDispatcher.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/text/LocalGlyphRasterizer.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java
# platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
# platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java
# platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/LocalGlyphActivity.java
# platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationTintActivity.java
# platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_local_glyph.xml
# platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
# platform/darwin/src/MGLMapSnapshotter.mm
# platform/darwin/src/MGLRendererConfiguration.h
# platform/ios/CHANGELOG.md
# platform/ios/DEVELOPING.md
# platform/ios/INSTALL.md
# platform/ios/README.md
# platform/ios/resources/bg.lproj/Localizable.strings
# platform/ios/resources/es.lproj/Localizable.strings
# platform/ios/resources/vi.lproj/Localizable.strings
# platform/ios/src/MGLMapView.mm
# platform/macos/macos.xcodeproj/project.pbxproj
# src/mbgl/text/glyph_manager.cpp
Diffstat (limited to 'platform/ios/src')
-rw-r--r-- | platform/ios/src/MGLFaux3DUserLocationAnnotationView.m | 1 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView+IBAdditions.h | 2 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.h | 16 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 33 |
4 files changed, 36 insertions, 16 deletions
diff --git a/platform/ios/src/MGLFaux3DUserLocationAnnotationView.m b/platform/ios/src/MGLFaux3DUserLocationAnnotationView.m index 1ed3d86ad1..a1d9fb1d48 100644 --- a/platform/ios/src/MGLFaux3DUserLocationAnnotationView.m +++ b/platform/ios/src/MGLFaux3DUserLocationAnnotationView.m @@ -63,6 +63,7 @@ const CGFloat MGLUserLocationHeadingUpdateThreshold = 0.01; if (_puckModeActivated) { _puckArrow.fillColor = newTintColor; + _puckArrow.strokeColor = newTintColor; } else { diff --git a/platform/ios/src/MGLMapView+IBAdditions.h b/platform/ios/src/MGLMapView+IBAdditions.h index d02c938c57..6d5351df2b 100644 --- a/platform/ios/src/MGLMapView+IBAdditions.h +++ b/platform/ios/src/MGLMapView+IBAdditions.h @@ -31,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic) IBInspectable double latitude; @property (nonatomic) IBInspectable double longitude; @property (nonatomic) IBInspectable double zoomLevel; +@property (nonatomic) IBInspectable double minimumZoomLevel; +@property (nonatomic) IBInspectable double maximumZoomLevel; // Renamed properties. Interface Builder derives the display name of each // inspectable from the runtime name, but runtime names don’t always make sense diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index e2c070a54f..3c5aa2c122 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -610,7 +610,7 @@ MGL_EXPORT IB_DESIGNABLE * * The default minimumZoomLevel is 0. */ -@property (nonatomic) IBInspectable double minimumZoomLevel; +@property (nonatomic) double minimumZoomLevel; /** * The maximum zoom level the map can be shown at. @@ -621,7 +621,7 @@ MGL_EXPORT IB_DESIGNABLE * The default maximumZoomLevel is 22. The upper bound for this property * is 25.5. */ -@property (nonatomic) IBInspectable double maximumZoomLevel; +@property (nonatomic) double maximumZoomLevel; /** The heading of the map, measured in degrees clockwise from true north. @@ -668,12 +668,24 @@ MGL_EXPORT IB_DESIGNABLE Changing the value of this property updates the receiver immediately. If you want to animate the change, call `-setVisibleCoordinateBounds:animated:` instead. + + If a longitude is less than −180 degrees or greater than 180 degrees, the visible + bounds straddles the antimeridian or international date line. + + For example, a visible bounds that stretches from Tokyo to San Francisco would have + coordinates of (35.68476, -220.24257) and (37.78428, -122.41310). */ @property (nonatomic) MGLCoordinateBounds visibleCoordinateBounds; /** Changes the receiver’s viewport to fit the given coordinate bounds, optionally animating the change. + + To make the visible bounds go across the antimeridian or international date line, + specify some longitudes less than −180 degrees or greater than 180 degrees. + + For example, a visible bounds that stretches from Tokyo to San Francisco would have + coordinates of (35.68476, -220.24257) and (37.78428, -122.41310). @param bounds The bounds that the viewport will show in its entirety. @param animated Specify `YES` to animate the change by smoothly scrolling diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 8dec9e520d..33bbefc9db 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -757,7 +757,7 @@ public: toItem:viewController.topLayoutGuide attribute:NSLayoutAttributeBottom multiplier:1.0 - constant:5.0 + self.contentInset.top]]; + constant:5.0]]; } [self.compassViewConstraints addObject: [NSLayoutConstraint constraintWithItem:self.compassView @@ -767,6 +767,7 @@ public: attribute:NSLayoutAttributeTop multiplier:1.0 constant:5.0 + self.contentInset.top]]; + [self.compassViewConstraints addObject: [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeTrailing @@ -791,7 +792,7 @@ public: toItem:viewController.topLayoutGuide attribute:NSLayoutAttributeBottom multiplier:1.0 - constant:5.0 + self.contentInset.top]]; + constant:5.0]]; } [self.scaleBarConstraints addObject: [NSLayoutConstraint constraintWithItem:self.scaleBar @@ -895,8 +896,10 @@ public: // compass view [self removeConstraints:self.compassViewConstraints]; [self.compassViewConstraints removeAllObjects]; - [self.compassViewConstraints addObject:[self.compassView.topAnchor constraintEqualToAnchor:safeAreaLayoutGuide.topAnchor - constant:5.0 + self.contentInset.top]]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" + [self.compassViewConstraints addObject:[self.compassView.topAnchor constraintEqualToSystemSpacingBelowAnchor:safeAreaLayoutGuide.topAnchor multiplier:1]]; +#pragma clang diagnostic pop [self.compassViewConstraints addObject:[safeAreaLayoutGuide.rightAnchor constraintEqualToAnchor:self.compassView.rightAnchor constant:8.0 + self.contentInset.right]]; [self addConstraints:self.compassViewConstraints]; @@ -904,8 +907,10 @@ public: // scale bar view [self removeConstraints:self.scaleBarConstraints]; [self.scaleBarConstraints removeAllObjects]; - [self.scaleBarConstraints addObject:[self.scaleBar.topAnchor constraintEqualToAnchor:safeAreaLayoutGuide.topAnchor - constant:5.0 + self.contentInset.top]]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" + [self.scaleBarConstraints addObject:[self.scaleBar.topAnchor constraintEqualToSystemSpacingBelowAnchor:safeAreaLayoutGuide.topAnchor multiplier:1]]; +#pragma clang diagnostic pop [self.scaleBarConstraints addObject:[self.scaleBar.leftAnchor constraintEqualToAnchor:safeAreaLayoutGuide.leftAnchor constant:8.0 + self.contentInset.left]]; [self addConstraints:self.scaleBarConstraints]; @@ -1811,18 +1816,17 @@ public: return panCamera; } -- (MGLMapCamera *)cameraByZoomingToZoomLevel:(double)zoom aroundAnchorPoint:(CGPoint)anchorPoint +- (MGLMapCamera *)cameraByZoomingToZoomLevel:(double)zoom aroundAnchorPoint:(CGPoint)anchorPoint { - mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(self.contentInset); - mbgl::CameraOptions currentCameraOptions = _mbglMap->getCameraOptions(padding); - MGLMapCamera *camera; - mbgl::ScreenCoordinate anchor = mbgl::ScreenCoordinate { anchorPoint.x, anchorPoint.y }; + mbgl::EdgeInsets padding = mbgl::EdgeInsets(anchor.y, anchor.x, self.size.height - anchor.y, self.size.width - anchor.x); + mbgl::CameraOptions currentCameraOptions = _mbglMap->getCameraOptions(padding); + currentCameraOptions.zoom = mbgl::util::clamp(zoom, self.minimumZoomLevel, self.maximumZoomLevel); currentCameraOptions.anchor = anchor; - camera = [self cameraForCameraOptions:currentCameraOptions]; + MGLCoordinateBounds bounds = MGLCoordinateBoundsFromLatLngBounds(_mbglMap->latLngBoundsForCamera(currentCameraOptions)); - return camera; + return [self cameraThatFitsCoordinateBounds:bounds]; } - (MGLMapCamera *)cameraByRotatingToDirection:(CLLocationDirection)degrees aroundAnchorPoint:(CGPoint)anchorPoint @@ -2956,6 +2960,7 @@ public: - (void)setMinimumZoomLevel:(double)minimumZoomLevel { + _mbglMap->setMinZoom(minimumZoomLevel); } - (double)minimumZoomLevel @@ -4071,7 +4076,7 @@ public: } else { - if ([annotation isKindOfClass:[MGLShape class]]) + if ([annotation isKindOfClass:[MGLMultiPoint class]]) { return false; } |