From 03f26cb508d203a69b93f7461a4bd9d8ea66ed16 Mon Sep 17 00:00:00 2001 From: Tobrun Date: Fri, 21 Apr 2017 23:07:08 +0200 Subject: Cherry pick latlngbounds to release branch (#8788) * [android] - move calculation of LatLngBounds to core * [core] Ignore shortest path in Map::pixelForLatLng * [android] - convert camera position values coming from core (#8794) --- .../mapbox/mapboxsdk/camera/CameraPosition.java | 18 ------ .../mapboxsdk/camera/CameraUpdateFactory.java | 65 ++------------------ .../java/com/mapbox/mapboxsdk/maps/MapboxMap.java | 33 ++++++++++- .../com/mapbox/mapboxsdk/maps/NativeMapView.java | 19 ++++-- .../java/com/mapbox/mapboxsdk/maps/Transform.java | 2 +- .../mapbox/mapboxsdk/maps/widgets/CompassView.java | 3 +- .../activity/camera/LatLngBoundsActivity.java | 69 +++++++++------------- .../mapboxsdk/camera/CameraPositionTest.java | 16 ----- platform/android/build.gradle | 2 +- platform/android/config.cmake | 2 + platform/android/src/jni.cpp | 3 + platform/android/src/map/camera_position.cpp | 38 ++++++++++++ platform/android/src/map/camera_position.hpp | 26 ++++++++ platform/android/src/native_map_view.cpp | 26 ++++---- platform/android/src/native_map_view.hpp | 6 +- 15 files changed, 167 insertions(+), 161 deletions(-) create mode 100644 platform/android/src/map/camera_position.cpp create mode 100644 platform/android/src/map/camera_position.hpp (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java index a8fc58d51c..5e958ff565 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java @@ -231,24 +231,6 @@ public final class CameraPosition implements Parcelable { } } - /** - * Create Builder from an existing array of doubles. - *

- * These values conform to map.ccp representation of a camera position. - *

- * - * @param nativeCameraValues Values containing target, bearing, tilt and zoom - */ - public Builder(double[] nativeCameraValues) { - super(); - if (nativeCameraValues != null && nativeCameraValues.length == 5) { - target(new LatLng(nativeCameraValues[0], nativeCameraValues[1]).wrap()); - bearing(MathUtils.convertNativeBearing(nativeCameraValues[2])); - tilt(nativeCameraValues[3]); - zoom(nativeCameraValues[4]); - } - } - /** * Sets the direction that the camera is pointing in, in degrees clockwise from north. * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java index ef8a4d58e8..64b86054a0 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java @@ -2,7 +2,6 @@ package com.mapbox.mapboxsdk.camera; import android.graphics.Point; import android.graphics.PointF; -import android.graphics.RectF; import android.support.annotation.IntDef; import android.support.annotation.NonNull; @@ -11,7 +10,6 @@ import com.mapbox.mapboxsdk.geometry.LatLngBounds; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.Projection; import com.mapbox.mapboxsdk.maps.UiSettings; -import com.mapbox.services.android.telemetry.utils.MathUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -199,17 +197,13 @@ public final class CameraUpdateFactory { static final class CameraBoundsUpdate implements CameraUpdate { private LatLngBounds bounds; - private RectF padding; + private int[] padding; - CameraBoundsUpdate(LatLngBounds bounds, RectF padding) { + CameraBoundsUpdate(LatLngBounds bounds, int[] padding) { this.bounds = bounds; this.padding = padding; } - CameraBoundsUpdate(LatLngBounds bounds, int[] padding) { - this(bounds, new RectF(padding[0], padding[1], padding[2], padding[3])); - } - CameraBoundsUpdate(LatLngBounds bounds, int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) { this(bounds, new int[] {paddingLeft, paddingTop, paddingRight, paddingBottom}); } @@ -218,64 +212,13 @@ public final class CameraUpdateFactory { return bounds; } - public RectF getPadding() { + public int[] getPadding() { return padding; } @Override public CameraPosition getCameraPosition(@NonNull MapboxMap mapboxMap) { - // Get required objects - Projection projection = mapboxMap.getProjection(); - UiSettings uiSettings = mapboxMap.getUiSettings(); - - // calculate correct padding - int[] mapPadding = mapboxMap.getPadding(); - RectF latLngPadding = getPadding(); - RectF padding = new RectF(latLngPadding.left + mapPadding[0], - latLngPadding.top + mapPadding[1], - latLngPadding.right + mapPadding[2], - latLngPadding.bottom + mapPadding[3]); - - // Calculate the bounds of the possibly rotated shape with respect to the viewport - PointF nePixel = new PointF(-Float.MAX_VALUE, -Float.MAX_VALUE); - PointF swPixel = new PointF(Float.MAX_VALUE, Float.MAX_VALUE); - float viewportHeight = uiSettings.getHeight(); - for (LatLng latLng : getBounds().toLatLngs()) { - PointF pixel = projection.toScreenLocation(latLng); - swPixel.x = Math.min(swPixel.x, pixel.x); - nePixel.x = Math.max(nePixel.x, pixel.x); - swPixel.y = Math.min(swPixel.y, viewportHeight - pixel.y); - nePixel.y = Math.max(nePixel.y, viewportHeight - pixel.y); - } - - // Calculate width/height - float width = nePixel.x - swPixel.x; - float height = nePixel.y - swPixel.y; - - double zoom = 0; - float minScale = 1; - // Calculate the zoom level - if (padding != null) { - float scaleX = (uiSettings.getWidth() - padding.left - padding.right) / width; - float scaleY = (uiSettings.getHeight() - padding.top - padding.bottom) / height; - minScale = scaleX < scaleY ? scaleX : scaleY; - zoom = projection.calculateZoom(minScale); - zoom = MathUtils.clamp(zoom, mapboxMap.getMinZoomLevel(), mapboxMap.getMaxZoomLevel()); - } - - // Calculate the center point - PointF paddedNEPixel = new PointF(nePixel.x + padding.right / minScale, nePixel.y + padding.top / minScale); - PointF paddedSWPixel = new PointF(swPixel.x - padding.left / minScale, swPixel.y - padding.bottom / minScale); - PointF centerPixel = new PointF((paddedNEPixel.x + paddedSWPixel.x) / 2, (paddedNEPixel.y + paddedSWPixel.y) / 2); - centerPixel.y = viewportHeight - centerPixel.y; - LatLng center = projection.fromScreenLocation(centerPixel); - - return new CameraPosition.Builder() - .target(center) - .zoom(zoom) - .tilt(0) - .bearing(0) - .build(); + return mapboxMap.getCameraForLatLngBounds(bounds, padding); } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java index 6edae8b944..e7679a4066 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java @@ -36,6 +36,7 @@ import com.mapbox.mapboxsdk.constants.MyBearingTracking; import com.mapbox.mapboxsdk.constants.MyLocationTracking; import com.mapbox.mapboxsdk.constants.Style; import com.mapbox.mapboxsdk.geometry.LatLng; +import com.mapbox.mapboxsdk.geometry.LatLngBounds; import com.mapbox.mapboxsdk.maps.widgets.MyLocationViewSettings; import com.mapbox.mapboxsdk.style.layers.Filter; import com.mapbox.mapboxsdk.style.layers.Layer; @@ -1504,6 +1505,32 @@ public final class MapboxMap { return annotationManager.getInfoWindowManager().isAllowConcurrentMultipleOpenInfoWindows(); } + // + // LatLngBounds + // + + + /** + * Gets a camera position that would fit a bounds. + * + * @param latLngBounds the bounds to constrain the map with + */ + public CameraPosition getCameraForLatLngBounds(@Nullable LatLngBounds latLngBounds, int[] padding) { + // calculate and set additional bounds padding + int[] mapPadding = getPadding(); + for (int i = 0; i < padding.length; i++) { + padding[i] = mapPadding[i] + padding[i]; + } + projection.setContentPadding(padding, myLocationViewSettings.getPadding()); + + // get padded camera position from LatLngBounds + CameraPosition cameraPosition = nativeMapView.getCameraForLatLngBounds(latLngBounds); + + // reset map padding + setPadding(mapPadding); + return cameraPosition; + } + // // Padding // @@ -1527,7 +1554,11 @@ public final class MapboxMap { * @param bottom The bottom margin in pixels. */ public void setPadding(int left, int top, int right, int bottom) { - projection.setContentPadding(new int[] {left, top, right, bottom}, myLocationViewSettings.getPadding()); + setPadding(new int[] {left, top, right, bottom}); + } + + private void setPadding(int[] padding) { + projection.setContentPadding(padding, myLocationViewSettings.getPadding()); uiSettings.invalidate(); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java index a9394d0b66..fae6311a03 100755 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java @@ -17,8 +17,10 @@ import com.mapbox.mapboxsdk.annotations.Icon; import com.mapbox.mapboxsdk.annotations.Marker; import com.mapbox.mapboxsdk.annotations.Polygon; import com.mapbox.mapboxsdk.annotations.Polyline; +import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.constants.MapboxConstants; import com.mapbox.mapboxsdk.geometry.LatLng; +import com.mapbox.mapboxsdk.geometry.LatLngBounds; import com.mapbox.mapboxsdk.geometry.ProjectedMeters; import com.mapbox.mapboxsdk.storage.FileSource; import com.mapbox.mapboxsdk.style.layers.CannotAddLayerException; @@ -309,6 +311,13 @@ final class NativeMapView { return nativeGetLatLng().wrap(); } + public CameraPosition getCameraForLatLngBounds(LatLngBounds latLngBounds) { + if (isDestroyedOn("getCameraForLatLngBounds")) { + return null; + } + return nativeGetCameraForLatLngBounds(latLngBounds); + } + public void resetPosition() { if (isDestroyedOn("resetPosition")) { return; @@ -717,11 +726,11 @@ final class NativeMapView { nativeFlyTo(angle, center.getLatitude(), center.getLongitude(), duration, pitch, zoom); } - public double[] getCameraValues() { + public CameraPosition getCameraPosition() { if (isDestroyedOn("getCameraValues")) { - return new double[] {}; + return new CameraPosition.Builder().build(); } - return nativeGetCameraValues(); + return nativeGetCameraPosition(); } // Runtime style Api @@ -1005,6 +1014,8 @@ final class NativeMapView { private native LatLng nativeGetLatLng(); + private native CameraPosition nativeGetCameraForLatLngBounds(LatLngBounds latLngBounds); + private native void nativeResetPosition(); private native double nativeGetPitch(); @@ -1095,7 +1106,7 @@ final class NativeMapView { private native void nativeFlyTo(double angle, double latitude, double longitude, long duration, double pitch, double zoom); - private native double[] nativeGetCameraValues(); + private native CameraPosition nativeGetCameraPosition(); private native long nativeGetTransitionDuration(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java index ec4b903a74..15e0fb8925 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java @@ -135,7 +135,7 @@ final class Transform implements MapView.OnMapChangedListener { @Nullable CameraPosition invalidateCameraPosition() { if (mapView != null) { - cameraPosition = new CameraPosition.Builder(mapView.getCameraValues()).build(); + cameraPosition = mapView.getCameraPosition(); if (onCameraChangeListener != null) { onCameraChangeListener.onCameraChange(this.cameraPosition); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/CompassView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/CompassView.java index 5c9cf93ebc..a0d9646915 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/CompassView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/CompassView.java @@ -110,8 +110,7 @@ public final class CompassView extends AppCompatImageView implements Runnable, F * @param bearing the direction value of the map */ public void update(final double bearing) { - // compass needs reverse bearing #8123 - rotation = (float) -bearing; + rotation = (float) bearing; if (!isEnabled()) { return; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/LatLngBoundsActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/LatLngBoundsActivity.java index 5c33f3f168..ba861131a2 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/LatLngBoundsActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/LatLngBoundsActivity.java @@ -1,9 +1,11 @@ package com.mapbox.mapboxsdk.testapp.activity.camera; import android.os.Bundle; +import android.os.Handler; import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxsdk.annotations.MarkerOptions; +import com.mapbox.mapboxsdk.camera.CameraUpdate; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.constants.Style; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -11,14 +13,8 @@ import com.mapbox.mapboxsdk.geometry.LatLngBounds; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; -import com.mapbox.mapboxsdk.maps.UiSettings; import com.mapbox.mapboxsdk.testapp.R; -import java.util.ArrayList; -import java.util.List; - -import timber.log.Timber; - /** * Test activity showcasing using the LatLngBounds camera API. *

@@ -31,6 +27,9 @@ public class LatLngBoundsActivity extends AppCompatActivity implements OnMapRead private static final LatLng LOS_ANGELES = new LatLng(34.053940, -118.242622); private static final LatLng NEW_YORK = new LatLng(40.712730, -74.005953); + private final LatLng CHINA_BOTTOM_LEFT = new LatLng(15.68169, 73.499857); + private final LatLng CHINA_TOP_RIGHT = new LatLng(53.560711, 134.77281); + private MapView mapView; private MapboxMap mapboxMap; @@ -46,41 +45,31 @@ public class LatLngBoundsActivity extends AppCompatActivity implements OnMapRead } @Override - public void onMapReady(MapboxMap map) { + public void onMapReady(final MapboxMap map) { mapboxMap = map; - UiSettings uiSettings = mapboxMap.getUiSettings(); - uiSettings.setAllGesturesEnabled(false); - - mapboxMap.addMarker(new MarkerOptions() - .title("Los Angeles") - .snippet("City Hall") - .position(LOS_ANGELES)); - - mapboxMap.addMarker(new MarkerOptions() - .title("New York") - .snippet("City Hall") - .position(NEW_YORK)); - - List points = new ArrayList<>(); - points.add(NEW_YORK); - points.add(LOS_ANGELES); - - // Create Bounds - final LatLngBounds bounds = new LatLngBounds.Builder() - .includes(points) - .build(); - - // Add map padding - int mapPadding = (int) getResources().getDimension(R.dimen.fab_margin); - mapboxMap.setPadding(mapPadding, mapPadding, mapPadding, mapPadding); - - // Move camera to the bounds with added padding - int padding = (int) getResources().getDimension(R.dimen.coordinatebounds_margin); - mapboxMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding), 1500); - - // Log data - Timber.e("Move to bounds: " + bounds.toString()); - Timber.e("Resulting bounds:" + mapboxMap.getProjection().getVisibleRegion().latLngBounds.toString()); + moveToBounds(new LatLngBounds.Builder().include(NEW_YORK).include(LOS_ANGELES).build(), new int[] {0, 0, 0, 0}); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + moveToBounds(new LatLngBounds.Builder().include(CHINA_BOTTOM_LEFT).include(CHINA_TOP_RIGHT).build(), + new int[] {100, 100, 100, 100 }); + } + }, 5000); + } + + private void moveToBounds(LatLngBounds latLngBounds, int[] padding) { + mapboxMap.clear(); + mapboxMap.addMarker(new MarkerOptions().position(new LatLng(latLngBounds.getLatNorth(),latLngBounds.getLonEast()))); + mapboxMap.addMarker(new MarkerOptions().position(new LatLng(latLngBounds.getLatSouth(), latLngBounds.getLonEast()))); + mapboxMap.addMarker(new MarkerOptions().position(new LatLng(latLngBounds.getLatSouth(), latLngBounds.getLonWest()))); + mapboxMap.addMarker(new MarkerOptions().position(new LatLng(latLngBounds.getLatNorth(), latLngBounds.getLonWest()))); + CameraUpdate update = + CameraUpdateFactory.newLatLngBounds(latLngBounds, + padding[0], + padding[1], + padding[2], + padding[3]); + mapboxMap.moveCamera(update); } @Override diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/test/java/com/mapbox/mapboxsdk/camera/CameraPositionTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/test/java/com/mapbox/mapboxsdk/camera/CameraPositionTest.java index b3eace7856..0c5f3a4be2 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/test/java/com/mapbox/mapboxsdk/camera/CameraPositionTest.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/test/java/com/mapbox/mapboxsdk/camera/CameraPositionTest.java @@ -60,22 +60,6 @@ public class CameraPositionTest { assertEquals("zoom should match", zoom, cameraPosition.zoom, DELTA); } - @Test - public void testJniBuilder() { - double bearing = 180; - double zoom = 12; - double latitude = 10; - double longitude = 11; - double tilt = 44; - - double[] cameraVars = new double[]{latitude, longitude, bearing, tilt, zoom}; - CameraPosition cameraPosition = new CameraPosition.Builder(cameraVars).build(); - assertEquals("bearing should match", bearing, cameraPosition.bearing, DELTA); - assertEquals("latlng should match", new LatLng(latitude, longitude), cameraPosition.target); - assertEquals("tilt should match", tilt, cameraPosition.tilt, DELTA); - assertEquals("zoom should match", zoom, cameraPosition.zoom, DELTA); - } - @Test public void testToString() { LatLng latLng = new LatLng(1, 2); diff --git a/platform/android/build.gradle b/platform/android/build.gradle index 4219f2bdee..52336d7441 100644 --- a/platform/android/build.gradle +++ b/platform/android/build.gradle @@ -3,7 +3,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.0' + classpath 'com.android.tools.build:gradle:2.3.1' classpath 'com.amazonaws:aws-devicefarm-gradle-plugin:1.2' classpath 'com.stanfy.spoon:spoon-gradle-plugin:1.2.1' } diff --git a/platform/android/config.cmake b/platform/android/config.cmake index fdf03b4ec8..c2bc20771d 100644 --- a/platform/android/config.cmake +++ b/platform/android/config.cmake @@ -87,6 +87,8 @@ macro(mbgl_platform_core) platform/android/src/style/conversion/property_value.hpp platform/android/src/style/conversion/types.hpp platform/android/src/style/conversion/types_string_values.hpp + platform/android/src/map/camera_position.cpp + platform/android/src/map/camera_position.hpp # Style conversion Java -> C++ platform/android/src/style/android_conversion.hpp diff --git a/platform/android/src/jni.cpp b/platform/android/src/jni.cpp index bd12cff3fa..a86ae4a695 100755 --- a/platform/android/src/jni.cpp +++ b/platform/android/src/jni.cpp @@ -127,6 +127,9 @@ void registerNatives(JavaVM *vm) { IdentityStops::registerNative(env); IntervalStops::registerNative(env); + // Map + CameraPosition::registerNative(env); + // Connectivity ConnectivityListener::registerNative(env); diff --git a/platform/android/src/map/camera_position.cpp b/platform/android/src/map/camera_position.cpp new file mode 100644 index 0000000000..8d69967014 --- /dev/null +++ b/platform/android/src/map/camera_position.cpp @@ -0,0 +1,38 @@ +#include "camera_position.hpp" +#include "../geometry/lat_lng.hpp" + +namespace mbgl { +namespace android { + +jni::Object CameraPosition::New(jni::JNIEnv &env, mbgl::CameraOptions options) { + static auto constructor = CameraPosition::javaClass.GetConstructor, double, double, double>(env); + + // wrap LatLng values coming from core + auto center = options.center.value(); + center.wrap(); + + // convert bearing, core ranges from [−π rad, π rad], android from 0 to 360 degrees + double bearing_degrees = options.angle.value_or(0) * 180.0 / M_PI; + while (bearing_degrees > 360) { + bearing_degrees -= 360; + } + while (bearing_degrees < 0) { + bearing_degrees += 360; + } + + // convert tilt, core ranges from [0 rad, 1,0472 rad], android ranges from 0 to 60 + double tilt_degrees = options.pitch.value_or(0) * 180 / M_PI; + + return CameraPosition::javaClass.New(env, constructor, LatLng::New(env, center.latitude, center.longitude), options.zoom.value_or(0), tilt_degrees, bearing_degrees); +} + +void CameraPosition::registerNative(jni::JNIEnv &env) { + // Lookup the class + CameraPosition::javaClass = *jni::Class::Find(env).NewGlobalRef(env).release(); +} + +jni::Class CameraPosition::javaClass; + + +} // namespace android +} // namespace mb \ No newline at end of file diff --git a/platform/android/src/map/camera_position.hpp b/platform/android/src/map/camera_position.hpp new file mode 100644 index 0000000000..b9f1646cc9 --- /dev/null +++ b/platform/android/src/map/camera_position.hpp @@ -0,0 +1,26 @@ +#pragma once + +#include +#include + +#include + +namespace mbgl { +namespace android { + +class CameraPosition : private mbgl::util::noncopyable { +public: + + static constexpr auto Name() { return "com/mapbox/mapboxsdk/camera/CameraPosition"; }; + + static jni::Object New(jni::JNIEnv&, mbgl::CameraOptions); + + static jni::Class javaClass; + + static void registerNative(jni::JNIEnv&); + +}; + + +} // namespace android +} // namespace mbgl \ No newline at end of file diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index 529ea23304..ddd7ba45f8 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -44,6 +44,8 @@ #include "bitmap.hpp" #include "run_loop_impl.hpp" #include "java/util.hpp" +#include "geometry/lat_lng_bounds.hpp" +#include "map/camera_position.hpp" namespace mbgl { namespace android { @@ -369,6 +371,10 @@ void NativeMapView::setLatLng(jni::JNIEnv&, jni::jdouble latitude, jni::jdouble map->setLatLng(mbgl::LatLng(latitude, longitude), insets, mbgl::AnimationOptions{mbgl::Milliseconds(duration)}); } +jni::Object NativeMapView::getCameraForLatLngBounds(jni::JNIEnv& env, jni::Object jBounds) { + return CameraPosition::New(env, map->cameraForLatLngBounds(mbgl::android::LatLngBounds::getLatLngBounds(env, jBounds), insets)); +} + void NativeMapView::setReachability(jni::JNIEnv&, jni::jboolean reachable) { if (reachable) { mbgl::NetworkStatus::Reachable(); @@ -494,21 +500,8 @@ void NativeMapView::enableFps(jni::JNIEnv&, jni::jboolean enable) { fpsEnabled = enable; } -jni::Array NativeMapView::getCameraValues(jni::JNIEnv& env) { - //Create buffer with values - jdouble buf[5]; - mbgl::LatLng latLng = map->getLatLng(insets); - buf[0] = latLng.latitude; - buf[1] = latLng.longitude; - buf[2] = -map->getBearing(); - buf[3] = map->getPitch(); - buf[4] = map->getZoom(); - - //Convert to Java array - auto output = jni::Array::New(env, 5); - jni::SetArrayRegion(env, *output, 0, 5, buf); - - return output; +jni::Object NativeMapView::getCameraPosition(jni::JNIEnv& env) { + return CameraPosition::New(env, map->getCameraOptions(insets)); } void NativeMapView::updateMarker(jni::JNIEnv& env, jni::jlong markerId, jni::jdouble lat, jni::jdouble lon, jni::String jid) { @@ -1429,6 +1422,7 @@ void NativeMapView::registerNative(jni::JNIEnv& env) { METHOD(&NativeMapView::flyTo, "nativeFlyTo"), METHOD(&NativeMapView::getLatLng, "nativeGetLatLng"), METHOD(&NativeMapView::setLatLng, "nativeSetLatLng"), + METHOD(&NativeMapView::getCameraForLatLngBounds, "nativeGetCameraForLatLngBounds"), METHOD(&NativeMapView::setReachability, "nativeSetReachability"), METHOD(&NativeMapView::resetPosition, "nativeResetPosition"), METHOD(&NativeMapView::getPitch, "nativeGetPitch"), @@ -1452,7 +1446,7 @@ void NativeMapView::registerNative(jni::JNIEnv& env) { METHOD(&NativeMapView::setContentPadding, "nativeSetContentPadding"), METHOD(&NativeMapView::scheduleSnapshot, "nativeTakeSnapshot"), METHOD(&NativeMapView::enableFps, "nativeSetEnableFps"), - METHOD(&NativeMapView::getCameraValues, "nativeGetCameraValues"), + METHOD(&NativeMapView::getCameraPosition, "nativeGetCameraPosition"), METHOD(&NativeMapView::updateMarker, "nativeUpdateMarker"), METHOD(&NativeMapView::addMarkers, "nativeAddMarkers"), METHOD(&NativeMapView::setDebug, "nativeSetDebug"), diff --git a/platform/android/src/native_map_view.hpp b/platform/android/src/native_map_view.hpp index 08133b85cd..0e2bb3eef6 100755 --- a/platform/android/src/native_map_view.hpp +++ b/platform/android/src/native_map_view.hpp @@ -21,6 +21,8 @@ #include "geometry/projected_meters.hpp" #include "style/layers/layers.hpp" #include "style/sources/sources.hpp" +#include "geometry/lat_lng_bounds.hpp" +#include "map/camera_position.hpp" #include #include @@ -107,6 +109,8 @@ public: void setLatLng(jni::JNIEnv&, jni::jdouble, jni::jdouble, jni::jlong); + jni::Object getCameraForLatLngBounds(jni::JNIEnv&, jni::Object); + void setReachability(jni::JNIEnv&, jni::jboolean); void resetPosition(jni::JNIEnv&); @@ -153,7 +157,7 @@ public: void enableFps(jni::JNIEnv&, jni::jboolean enable); - jni::Array getCameraValues(jni::JNIEnv&); + jni::Object getCameraPosition(jni::JNIEnv&); void updateMarker(jni::JNIEnv&, jni::jlong, jni::jdouble, jni::jdouble, jni::String); -- cgit v1.2.1 From a3e4e67ea68c455178d5c5ef3d864972fcf41147 Mon Sep 17 00:00:00 2001 From: Jordan Kiley Date: Mon, 1 May 2017 15:42:54 -0700 Subject: [ios, macos] Updated `maximumZoomLevel` description, cherry-picked #8818 (#8842) --- platform/darwin/src/MGLStyleLayer.h | 4 ++-- platform/ios/docs/guides/Working with Mapbox Studio.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'platform') diff --git a/platform/darwin/src/MGLStyleLayer.h b/platform/darwin/src/MGLStyleLayer.h index f81643edd7..ac9b739c74 100644 --- a/platform/darwin/src/MGLStyleLayer.h +++ b/platform/darwin/src/MGLStyleLayer.h @@ -63,12 +63,12 @@ MGL_EXPORT @property (nonatomic, assign, getter=isVisible) BOOL visible; /** - The maximum zoom level at which the layer gets parsed and appears. + The maximum zoom level at which the layer gets parsed and appears. This value is a floating-point number. */ @property (nonatomic, assign) float maximumZoomLevel; /** - The minimum zoom level at which the layer gets parsed and appears. + The minimum zoom level at which the layer gets parsed and appears. This value is a floating-point number. */ @property (nonatomic, assign) float minimumZoomLevel; diff --git a/platform/ios/docs/guides/Working with Mapbox Studio.md b/platform/ios/docs/guides/Working with Mapbox Studio.md index 959731a3a7..232b165efd 100644 --- a/platform/ios/docs/guides/Working with Mapbox Studio.md +++ b/platform/ios/docs/guides/Working with Mapbox Studio.md @@ -76,7 +76,7 @@ To implement your prototypes with runtime styling: 1. Implement `-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]`. 2. Add your real data as a source: - * This can be done using vector data from tileset editor ([example](https://www.mapbox.com/ios-sdk/examples/runtime-circle-styles)), custom vector tiles, added as GeoJSON ([example](https://www.mapbox.com/ios-sdk/examples/runtime-add-line), or added manually through the app via `MGLShapeSource` ([example](https://www.mapbox.com/ios-sdk/examples/runtime-multiple-annotations)) + * This can be done using vector data from tileset editor ([example](https://www.mapbox.com/ios-sdk/examples/dds-circle-layer)), custom vector tiles, added as GeoJSON ([example](https://www.mapbox.com/ios-sdk/examples/runtime-add-line), or added manually through the app via `MGLShapeSource` ([example](https://www.mapbox.com/ios-sdk/examples/runtime-multiple-annotations)) 3. For each layer you’ve prototyped in Studio, add its corresponding `MGLStyleLayer` subclass. See [“Configuring the map content’s appearance”](for-style-authors.html#configuring-the-map-content-s-appearance) for the available style layer classes. **Translating style attributes from Studio** -- cgit v1.2.1 From a70f8911c611553ba3b40ec463075ee09c8ece75 Mon Sep 17 00:00:00 2001 From: Jordan Kiley Date: Tue, 2 May 2017 16:20:34 -0700 Subject: [ios] cherry-picked 8837 (#8869) --- platform/ios/ios.xcodeproj/project.pbxproj | 16 ++++++++++++++-- platform/ios/src/MGLMapView.mm | 12 +++++------- platform/ios/src/UIViewController+MGLAdditions.h | 11 +++++++++++ platform/ios/src/UIViewController+MGLAdditions.m | 22 ++++++++++++++++++++++ 4 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 platform/ios/src/UIViewController+MGLAdditions.h create mode 100644 platform/ios/src/UIViewController+MGLAdditions.m (limited to 'platform') diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 9a87f2c631..d856424be2 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -450,6 +450,10 @@ DD4823761D94AE6C00EB71B7 /* line_filter_style.json in Resources */ = {isa = PBXBuildFile; fileRef = DD4823731D94AE6C00EB71B7 /* line_filter_style.json */; }; DD4823771D94AE6C00EB71B7 /* numeric_filter_style.json in Resources */ = {isa = PBXBuildFile; fileRef = DD4823741D94AE6C00EB71B7 /* numeric_filter_style.json */; }; DD58A4C61D822BD000E1F038 /* MGLExpressionTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD58A4C51D822BD000E1F038 /* MGLExpressionTests.mm */; }; + DD9BE4F71EB263C50079A3AF /* UIViewController+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DD9BE4F51EB263C50079A3AF /* UIViewController+MGLAdditions.h */; }; + DD9BE4F81EB263C50079A3AF /* UIViewController+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DD9BE4F61EB263C50079A3AF /* UIViewController+MGLAdditions.m */; }; + DD9BE4F91EB263D20079A3AF /* UIViewController+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DD9BE4F51EB263C50079A3AF /* UIViewController+MGLAdditions.h */; }; + DD9BE4FA1EB263F40079A3AF /* UIViewController+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DD9BE4F61EB263C50079A3AF /* UIViewController+MGLAdditions.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -905,6 +909,8 @@ DD4823731D94AE6C00EB71B7 /* line_filter_style.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = line_filter_style.json; sourceTree = ""; }; DD4823741D94AE6C00EB71B7 /* numeric_filter_style.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = numeric_filter_style.json; sourceTree = ""; }; DD58A4C51D822BD000E1F038 /* MGLExpressionTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLExpressionTests.mm; path = ../../darwin/test/MGLExpressionTests.mm; sourceTree = ""; }; + DD9BE4F51EB263C50079A3AF /* UIViewController+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+MGLAdditions.h"; sourceTree = ""; }; + DD9BE4F61EB263C50079A3AF /* UIViewController+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+MGLAdditions.m"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1060,12 +1066,14 @@ 35CE617F1D4165C2004F2359 /* Categories */ = { isa = PBXGroup; children = ( + 357FE2DB1E02D2B20068B753 /* NSCoder+MGLAdditions.h */, + 357FE2DC1E02D2B20068B753 /* NSCoder+MGLAdditions.mm */, 35CE61801D4165D9004F2359 /* UIColor+MGLAdditions.h */, 35CE61811D4165D9004F2359 /* UIColor+MGLAdditions.mm */, 30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */, 30E578121DAA7D690050F07E /* UIImage+MGLAdditions.mm */, - 357FE2DB1E02D2B20068B753 /* NSCoder+MGLAdditions.h */, - 357FE2DC1E02D2B20068B753 /* NSCoder+MGLAdditions.mm */, + DD9BE4F51EB263C50079A3AF /* UIViewController+MGLAdditions.h */, + DD9BE4F61EB263C50079A3AF /* UIViewController+MGLAdditions.m */, ); name = Categories; sourceTree = ""; @@ -1592,6 +1600,7 @@ DA88485A1CBAFB9800AB86E3 /* MGLUserLocation_Private.h in Headers */, DA27C24F1CBB4C11000B0ECD /* MGLAccountManager_Private.h in Headers */, DA8847FC1CBAFA5100AB86E3 /* MGLStyle.h in Headers */, + DD9BE4F71EB263C50079A3AF /* UIViewController+MGLAdditions.h in Headers */, DAF0D8131DFE0EC500B28378 /* MGLVectorSource_Private.h in Headers */, 354B83961D2E873E005D9406 /* MGLUserLocationAnnotationView.h in Headers */, DA8847F01CBAFA5100AB86E3 /* MGLAnnotation.h in Headers */, @@ -1702,6 +1711,7 @@ 353933FF1D3FB7DD003F57D7 /* MGLSymbolStyleLayer.h in Headers */, DAAF722E1DA903C700312FA4 /* MGLStyleValue_Private.h in Headers */, DABFB8661CBE99E500D62B32 /* MGLPointAnnotation.h in Headers */, + DD9BE4F91EB263D20079A3AF /* UIViewController+MGLAdditions.h in Headers */, DABFB8621CBE99E500D62B32 /* MGLOfflinePack.h in Headers */, DAD1656D1CF41981001FF4B9 /* MGLFeature.h in Headers */, DA17BE311CC4BDAA00402C41 /* MGLMapView_Private.h in Headers */, @@ -2138,6 +2148,7 @@ DA8848541CBAFB9800AB86E3 /* MGLCompactCalloutView.m in Sources */, DA8848251CBAFA6200AB86E3 /* MGLPointAnnotation.mm in Sources */, 35136D3C1D42272500C20EFD /* MGLCircleStyleLayer.mm in Sources */, + DD9BE4F81EB263C50079A3AF /* UIViewController+MGLAdditions.m in Sources */, 350098DE1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.mm in Sources */, DA6408DD1DA4E7D300908C90 /* MGLVectorStyleLayer.m in Sources */, 3566C7681D4A77BA008152BC /* MGLShapeSource.mm in Sources */, @@ -2216,6 +2227,7 @@ DAA4E4291CBB730400178DFB /* NSBundle+MGLAdditions.m in Sources */, DAA4E42E1CBB730400178DFB /* MGLAPIClient.m in Sources */, 35136D3D1D42272500C20EFD /* MGLCircleStyleLayer.mm in Sources */, + DD9BE4FA1EB263F40079A3AF /* UIViewController+MGLAdditions.m in Sources */, 350098DF1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.mm in Sources */, DA6408DE1DA4E7D300908C90 /* MGLVectorStyleLayer.m in Sources */, 3566C7691D4A77BA008152BC /* MGLShapeSource.mm in Sources */, diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 540f6de861..4b5ca8679a 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -40,12 +40,13 @@ #import "NSBundle+MGLAdditions.h" #import "NSDate+MGLAdditions.h" -#import "NSString+MGLAdditions.h" -#import "NSProcessInfo+MGLAdditions.h" #import "NSException+MGLAdditions.h" +#import "NSPredicate+MGLAdditions.h" +#import "NSProcessInfo+MGLAdditions.h" +#import "NSString+MGLAdditions.h" #import "NSURL+MGLAdditions.h" #import "UIImage+MGLAdditions.h" -#import "NSPredicate+MGLAdditions.h" +#import "UIViewController+MGLAdditions.h" #import "MGLFaux3DUserLocationAnnotationView.h" #import "MGLUserLocationAnnotationView.h" @@ -1917,10 +1918,7 @@ public: attributionController.popoverPresentationController.sourceView = self; attributionController.popoverPresentationController.sourceRect = self.attributionButton.frame; - UIViewController *viewController = self.window.rootViewController; - if ([viewController isKindOfClass:[UINavigationController class]]) { - viewController = [(UINavigationController *)viewController viewControllers].firstObject; - } + UIViewController *viewController = [self.window.rootViewController mgl_topMostViewController]; [viewController presentViewController:attributionController animated:YES completion:NULL]; diff --git a/platform/ios/src/UIViewController+MGLAdditions.h b/platform/ios/src/UIViewController+MGLAdditions.h new file mode 100644 index 0000000000..b60375a6f6 --- /dev/null +++ b/platform/ios/src/UIViewController+MGLAdditions.h @@ -0,0 +1,11 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIViewController (MGLAdditions) + +@property (readonly) UIViewController *mgl_topMostViewController; + +@end + +NS_ASSUME_NONNULL_END diff --git a/platform/ios/src/UIViewController+MGLAdditions.m b/platform/ios/src/UIViewController+MGLAdditions.m new file mode 100644 index 0000000000..746fdd8db8 --- /dev/null +++ b/platform/ios/src/UIViewController+MGLAdditions.m @@ -0,0 +1,22 @@ +#import "UIViewController+MGLAdditions.h" + +@implementation UIViewController (MGLAdditions) + +- (UIViewController *)mgl_topMostViewController +{ + if ([self isKindOfClass:[UINavigationController class]]) + { + return [[(UINavigationController *)self visibleViewController] mgl_topMostViewController]; + } + else if ([self isKindOfClass:[UITabBarController class]]) + { + return [[(UITabBarController *)self selectedViewController] mgl_topMostViewController]; + } + else if (self.presentedViewController) + { + return [self.presentedViewController mgl_topMostViewController]; + } + return self; +} + +@end -- cgit v1.2.1 From 25c19902a22e240da4e7ebf1974125b7e67bd21e Mon Sep 17 00:00:00 2001 From: Jordan Kiley Date: Tue, 2 May 2017 16:28:00 -0700 Subject: [ios] Updated podspecs and changelog for v3.5.3 (#8870) --- platform/ios/CHANGELOG.md | 3 +++ platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'platform') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index deb108a1d8..cacc054459 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,6 +2,9 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. +## 3.5.3 - May 2, 2017 +* Fixed an issue that prevented the attribution `UIAlertController` from showing in modal hierarchies. ([#8837](https://github.com/mapbox/mapbox-gl-native/pull/8837)) + ## 3.5.2 - April 7, 2017 * Fixed an issue that caused a crash when the user location annotation was presenting a callout view and the map was moved. ([#8686](https://github.com/mapbox/mapbox-gl-native/pull/8686)) diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index 190087afaf..ec2c12822e 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.5.2' + version = '3.5.3' 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 ae9e470e87..3dc63e77bf 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.5.2' + version = '3.5.3' m.name = 'Mapbox-iOS-SDK' m.version = version -- cgit v1.2.1 From c6c7c2cd743bae543f4041b999ec32fc076ea76a Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Tue, 9 May 2017 12:08:41 -0700 Subject: [ios] Use map view frame to calculate annotation view reuse adjustments (#8926) * [ios] Use map view frame to calculate annotation view reuse adjustments The value for determining the visible viewport buffer and also the distance to move offscreen an annotation view outside of that buffer was based on the annotation view width and height. This changes that to use the map viewport width and height as constants and avoids a class of bugs where the annotation view would become detached from the tracking system when it did not have a size or was animating from a small to large size. --- platform/ios/src/MGLMapView.mm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'platform') diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 4b5ca8679a..51b65f11b1 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -4935,8 +4935,10 @@ public: // If the map is pitched consider the viewport to be exactly the same as the bounds. // Otherwise, add a small buffer. - CGFloat widthAdjustment = self.camera.pitch > 0.0 ? 0.0 : -_largestAnnotationViewSize.width * 2.0; - CGFloat heightAdjustment = self.camera.pitch > 0.0 ? 0.0 : -_largestAnnotationViewSize.height * 2.0; + CGFloat largestWidth = MAX(_largestAnnotationViewSize.width, CGRectGetWidth(self.frame)); + CGFloat largestHeight = MAX(_largestAnnotationViewSize.height, CGRectGetHeight(self.frame)); + CGFloat widthAdjustment = self.camera.pitch > 0.0 ? 0.0 : -largestWidth * 2.0; + CGFloat heightAdjustment = self.camera.pitch > 0.0 ? 0.0 : -largestHeight * 2.0; CGRect viewPort = CGRectInset(self.bounds, widthAdjustment, heightAdjustment); NSArray *visibleAnnotations = [self visibleAnnotationsInRect:viewPort]; @@ -5012,13 +5014,9 @@ public: } else { + // Move the annotation view far out of view to the left CGRect adjustedFrame = annotationView.frame; - if (annotationView.layer.presentationLayer) { - adjustedFrame.origin.x = -CGRectGetWidth(annotationView.layer.presentationLayer.frame) * 10.0; - } else { - // views that are added off screen do not have a presentationLayer - adjustedFrame.origin.x = -CGRectGetWidth(adjustedFrame) * 10.0; - } + adjustedFrame.origin.x = -CGRectGetWidth(self.frame) * 10.0; annotationView.frame = adjustedFrame; [self enqueueAnnotationViewForAnnotationContext:annotationContext]; } -- cgit v1.2.1 From db7bb509e95d737199efa73a47bdcc973966ed97 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Tue, 9 May 2017 13:41:56 -0700 Subject: [ios] Update podspecs and changelog for iOS v3.5.4 --- platform/ios/CHANGELOG.md | 5 +++++ platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'platform') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index cacc054459..d819d2fa92 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,7 +2,12 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. +## 3.5.4 - May 9, 2017 + +* Fixed an issue that caused view backed annotations to become detached from the map view during pan gestures combined with animations of annotation view size or when the annotation view had no size but contained subviews with a non-zero size. ([#8926](https://github.com/mapbox/mapbox-gl-native/pull/8926)) + ## 3.5.3 - May 2, 2017 + * Fixed an issue that prevented the attribution `UIAlertController` from showing in modal hierarchies. ([#8837](https://github.com/mapbox/mapbox-gl-native/pull/8837)) ## 3.5.2 - April 7, 2017 diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index ec2c12822e..26ad13f5b1 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.5.3' + version = '3.5.4' 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 3dc63e77bf..4661027051 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.5.3' + version = '3.5.4' m.name = 'Mapbox-iOS-SDK' m.version = version -- cgit v1.2.1