From e5810536bcedfbb83bc2b5aa48fcb7d2ada05e37 Mon Sep 17 00:00:00 2001 From: Tobrun Date: Tue, 20 Feb 2018 15:22:44 +0100 Subject: [PATCH 01/28] [android] - decouple map padding from overlain views --- .../src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java | 5 ----- 1 file changed, 5 deletions(-) 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 3fd3e1220..44f106bdd 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 @@ -950,12 +950,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 From c6537adbd1704b81e3182b14ee468e682060fd64 Mon Sep 17 00:00:00 2001 From: Tobrun Date: Tue, 20 Feb 2018 16:40:32 +0100 Subject: [PATCH 02/28] [android] - don't disable zoom button controller zooming whem zooming gestures are disabled --- .../java/com/mapbox/mapboxsdk/maps/MapView.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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 a8e065c45..3c5b82c3b 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 @@ -22,6 +22,7 @@ import android.view.ViewTreeObserver; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.ZoomButtonsController; + import com.mapbox.mapboxsdk.R; import com.mapbox.mapboxsdk.annotations.Annotation; import com.mapbox.mapboxsdk.annotations.MarkerViewManager; @@ -36,10 +37,7 @@ import com.mapbox.mapboxsdk.maps.widgets.MyLocationViewSettings; import com.mapbox.mapboxsdk.net.ConnectivityReceiver; import com.mapbox.mapboxsdk.storage.FileSource; import com.mapbox.services.android.telemetry.MapboxTelemetry; -import timber.log.Timber; -import javax.microedition.khronos.egl.EGLConfig; -import javax.microedition.khronos.opengles.GL10; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; @@ -48,6 +46,11 @@ import java.util.Iterator; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; +import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.opengles.GL10; + +import timber.log.Timber; + import static com.mapbox.mapboxsdk.maps.widgets.CompassView.TIME_MAP_NORTH_ANIMATION; import static com.mapbox.mapboxsdk.maps.widgets.CompassView.TIME_WAIT_IDLE; @@ -1004,10 +1007,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) { From ca17625f1ced08afed6767345470b96f902faa88 Mon Sep 17 00:00:00 2001 From: Chris Loer Date: Mon, 26 Feb 2018 13:22:15 -0800 Subject: [PATCH 03/28] [core,node] Pin 'nan' to ~2.8 to avoid Callback::Call deprecation. Alternative fix to #11288, until we figure out a proper async_hooks implementation. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fb62bc63e..1ebad0bca 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ }, "license": "BSD-2-Clause", "dependencies": { - "nan": "^2.4.0", - "node-pre-gyp": "^0.6.36", + "nan": "~2.8", + "node-pre-gyp": "^0.6.37", "npm-run-all": "^4.0.2" }, "devDependencies": { From aacd55c64b0bfdba457af5444a6965386aad6045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Wed, 21 Feb 2018 12:35:44 +0100 Subject: [PATCH 04/28] [core] continue loading style even if we mutate it When we load a stale style from cache, and the user immediately starts mutating it, we should continue loading the style so that we'll get a fresh copy of the data into our cache and avoid perpetually showing the stale style. --- src/mbgl/style/style_impl.cpp | 5 ----- test/map/map.test.cpp | 21 ++++++++++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/mbgl/style/style_impl.cpp b/src/mbgl/style/style_impl.cpp index 3214c6316..39e1c1772 100644 --- a/src/mbgl/style/style_impl.cpp +++ b/src/mbgl/style/style_impl.cpp @@ -53,11 +53,6 @@ void Style::Impl::loadURL(const std::string& url_) { url = url_; styleRequest = fileSource.request(Resource::style(url), [this](Response res) { - // Once we get a fresh style, or the style is mutated, stop revalidating. - if (res.isFresh() || mutated) { - styleRequest.reset(); - } - // Don't allow a loaded, mutated style to be overwritten with a new version. if (mutated && loaded) { return; diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp index 935817529..9b7f0b5d5 100644 --- a/test/map/map.test.cpp +++ b/test/map/map.test.cpp @@ -252,7 +252,7 @@ TEST(Map, DoubleStyleLoad) { } TEST(Map, StyleFresh) { - // The map should not revalidate fresh styles. + // The map should continue to revalidate fresh styles. MapTest test; @@ -264,11 +264,11 @@ TEST(Map, StyleFresh) { response.expires = Timestamp::max(); test.fileSource.respond(Resource::Style, response); - EXPECT_EQ(0u, test.fileSource.requests.size()); + EXPECT_EQ(1u, test.fileSource.requests.size()); } TEST(Map, StyleExpired) { - // The map should allow expired styles to be revalidated, so long as no mutations are made. + // The map should allow expired styles to be revalidated until we get a fresh style. using namespace std::chrono_literals; @@ -284,11 +284,22 @@ TEST(Map, StyleExpired) { test.fileSource.respond(Resource::Style, response); EXPECT_EQ(1u, test.fileSource.requests.size()); + // Mutate layer. From now on, sending a response to the style won't overwrite it anymore, but + // we should continue to wait for a fresh response. test.map.getStyle().addLayer(std::make_unique("bg")); EXPECT_EQ(1u, test.fileSource.requests.size()); + // Send another expired response, and confirm that we didn't overwrite the style, but continue + // to wait for a fresh response. test.fileSource.respond(Resource::Style, response); - EXPECT_EQ(0u, test.fileSource.requests.size()); + EXPECT_EQ(1u, test.fileSource.requests.size()); + EXPECT_NE(nullptr, test.map.getStyle().getLayer("bg")); + + // Send a fresh response, and confirm that we didn't overwrite the style, but continue to wait + // for a fresh response. + response.expires = util::now() + 1h; + test.fileSource.respond(Resource::Style, response); + EXPECT_EQ(1u, test.fileSource.requests.size()); EXPECT_NE(nullptr, test.map.getStyle().getLayer("bg")); } @@ -352,7 +363,7 @@ TEST(Map, StyleEarlyMutation) { response.data = std::make_shared(util::read_file("test/fixtures/api/water.json")); test.fileSource.respond(Resource::Style, response); - EXPECT_EQ(0u, test.fileSource.requests.size()); + EXPECT_EQ(1u, test.fileSource.requests.size()); EXPECT_NE(nullptr, test.map.getStyle().getLayer("water")); } From 6d2cbb0a403b9faada81a756afa111e35618500b Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Tue, 27 Feb 2018 12:04:20 -0500 Subject: [PATCH 05/28] [ios, macos] Fix a memory leak when creating an EAGLContext in MGLMapSnapshotter. (#11193) --- platform/darwin/src/headless_backend_eagl.mm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/platform/darwin/src/headless_backend_eagl.mm b/platform/darwin/src/headless_backend_eagl.mm index 1daaeaf54..f291c0805 100644 --- a/platform/darwin/src/headless_backend_eagl.mm +++ b/platform/darwin/src/headless_backend_eagl.mm @@ -7,9 +7,13 @@ namespace mbgl { struct EAGLImpl : public HeadlessBackend::Impl { - EAGLImpl(EAGLContext* glContext_) : glContext(glContext_) { - [reinterpret_cast(glContext) retain]; - reinterpret_cast(glContext).multiThreaded = YES; + EAGLImpl() { + glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; + + if (glContext == nil) { + throw std::runtime_error("Error creating GL context object"); + } + glContext.multiThreaded = YES; } ~EAGLImpl() { @@ -45,12 +49,9 @@ bool HeadlessBackend::hasDisplay() { } void HeadlessBackend::createContext() { - EAGLContext* glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; - if (glContext == nil) { - throw std::runtime_error("Error creating GL context object"); - } - - impl.reset(new EAGLImpl(glContext)); + impl.reset(); + impl = std::make_unique(); + } } // namespace mbgl From b74930c5fcf6b2a7652436fec9bcab4e12a49669 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Tue, 27 Feb 2018 15:46:28 -0500 Subject: [PATCH 06/28] [ios] Improved heading indicator arrow visibility --- platform/ios/CHANGELOG.md | 4 ++++ platform/ios/src/MGLUserLocationHeadingArrowLayer.m | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 7d23a3fba..e2052abb8 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.7.6 + +* 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/src/MGLUserLocationHeadingArrowLayer.m b/platform/ios/src/MGLUserLocationHeadingArrowLayer.m index 912ce30c3..d81cb5a09 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 From 20c79d9e71a660a6d3b4e377b033f0d68a5327fa Mon Sep 17 00:00:00 2001 From: Cameron Mace Date: Wed, 28 Feb 2018 14:38:26 -0500 Subject: [PATCH 07/28] upgraded telem version (#11338) * upgraded telem version * use telem method instead of Okhttp * use telem util in test --- .../main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java | 6 +++--- .../com/mapbox/mapboxsdk/telemetry/HttpTransportTest.java | 5 ++--- platform/android/dependencies.gradle | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) 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 caee493e6..129e75965 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; @@ -27,9 +26,10 @@ import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; -import okhttp3.internal.Util; import timber.log.Timber; +import static com.mapbox.services.android.telemetry.utils.TelemetryUtils.toHumanReadableAscii; + import static android.util.Log.DEBUG; import static android.util.Log.INFO; import static android.util.Log.WARN; @@ -204,7 +204,7 @@ class HTTPRequest implements Callback { private String getUserAgent() { if (USER_AGENT_STRING == null) { - return USER_AGENT_STRING = Util.toHumanReadableAscii( + return USER_AGENT_STRING = toHumanReadableAscii( String.format("%s %s (%s) Android/%s (%s)", getApplicationIdentifier(), BuildConfig.MAPBOX_VERSION_STRING, diff --git a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/telemetry/HttpTransportTest.java b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/telemetry/HttpTransportTest.java index 94a6dc219..5b5449632 100644 --- a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/telemetry/HttpTransportTest.java +++ b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/telemetry/HttpTransportTest.java @@ -2,8 +2,7 @@ package com.mapbox.mapboxsdk.telemetry; import org.junit.Test; -import okhttp3.internal.Util; - +import static com.mapbox.services.android.telemetry.utils.TelemetryUtils.toHumanReadableAscii; import static junit.framework.Assert.assertEquals; public class HttpTransportTest { @@ -15,6 +14,6 @@ public class HttpTransportTest { final String asciiVersion = "Sveriges Fj?ll/1.0/1 MapboxEventsAndroid/4.0.0-SNAPSHOT"; assertEquals("asciiVersion and swedishUserAgent should match", asciiVersion, - Util.toHumanReadableAscii(swedishUserAgent)); + toHumanReadableAscii(swedishUserAgent)); } } diff --git a/platform/android/dependencies.gradle b/platform/android/dependencies.gradle index 541b3c523..f3ec2f5a2 100644 --- a/platform/android/dependencies.gradle +++ b/platform/android/dependencies.gradle @@ -7,7 +7,7 @@ ext { versionCode = 11 versionName = "5.0.0" - mapboxServicesVersion = "2.2.9" + mapboxServicesVersion = "2.2.10" supportLibVersion = "25.4.0" espressoVersion = '3.0.1' testRunnerVersion = '1.0.1' From 7623ed99bcf8cd6a1034ffac6cdef87e2268762a Mon Sep 17 00:00:00 2001 From: osana Date: Mon, 19 Feb 2018 22:55:43 -0500 Subject: [PATCH 08/28] [android] jni clean up - missing a couple DeleteLocalRef --- platform/android/src/conversion/collection.hpp | 1 + platform/android/src/file_source.cpp | 5 ++++- platform/android/src/map/camera_position.cpp | 4 +++- platform/android/src/map/image.cpp | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/platform/android/src/conversion/collection.hpp b/platform/android/src/conversion/collection.hpp index 549121c7e..2b953e73f 100644 --- a/platform/android/src/conversion/collection.hpp +++ b/platform/android/src/conversion/collection.hpp @@ -28,6 +28,7 @@ inline jni::jobject* toArrayList(JNIEnv& env, jni::jarray& array) { inline std::vector toVector(JNIEnv& env, jni::jarray& array) { std::vector vector; std::size_t len = jni::GetArrayLength(env, array); + vector.reserve(len); for (std::size_t i = 0; i < len; i++) { jni::jstring* jstr = reinterpret_cast(jni::GetObjectArrayElement(env, array, i)); diff --git a/platform/android/src/file_source.cpp b/platform/android/src/file_source.cpp index 6a9d7badb..612619a30 100644 --- a/platform/android/src/file_source.cpp +++ b/platform/android/src/file_source.cpp @@ -124,8 +124,11 @@ jni::Class FileSource::ResourceTransformC std::string FileSource::ResourceTransformCallback::onURL(jni::JNIEnv& env, jni::Object callback, int kind, std::string url_) { static auto method = FileSource::ResourceTransformCallback::javaClass.GetMethod(env, "onURL"); auto url = jni::Make(env, url_); + url = callback.Call(env, method, kind, url); - return jni::Make(env, url); + auto urlStr = jni::Make(env, url); + jni::DeleteLocalRef(env, url); + return urlStr; } } // namespace android diff --git a/platform/android/src/map/camera_position.cpp b/platform/android/src/map/camera_position.cpp index 1fc5f9789..01ffc6530 100644 --- a/platform/android/src/map/camera_position.cpp +++ b/platform/android/src/map/camera_position.cpp @@ -33,7 +33,9 @@ mbgl::CameraOptions CameraPosition::getCameraOptions(jni::JNIEnv& env, jni::Obje static auto tilt = CameraPosition::javaClass.GetField(env, "tilt"); static auto zoom = CameraPosition::javaClass.GetField(env, "zoom"); - auto center = LatLng::getLatLng(env, position.Get(env, target)); + auto jtarget = position.Get(env, target); + auto center = LatLng::getLatLng(env, jtarget); + jni::DeleteLocalRef(env, jtarget); return mbgl::CameraOptions { center, diff --git a/platform/android/src/map/image.cpp b/platform/android/src/map/image.cpp index 5f5c90edd..52e0e0d25 100644 --- a/platform/android/src/map/image.cpp +++ b/platform/android/src/map/image.cpp @@ -16,7 +16,9 @@ mbgl::style::Image Image::getImage(jni::JNIEnv& env, jni::Object image) { auto width = image.Get(env, widthField); auto pixelRatio = image.Get(env, pixelRatioField); auto pixels = image.Get(env, bufferField); - auto name = jni::Make(env, image.Get(env, nameField)); + auto jName = image.Get(env, nameField); + auto name = jni::Make(env, jName); + jni::DeleteLocalRef(env, jName); jni::NullCheck(env, &pixels); std::size_t size = pixels.Length(env); From 0fe1219bfd5dc93f6cf256cb247f58496022d2c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Paczos?= Date: Thu, 22 Feb 2018 10:01:48 +0100 Subject: [PATCH 09/28] [android] expose ImageSource coordinates setter (#11262) --- .../mapbox/mapboxsdk/style/sources/ImageSource.java | 11 +++++++++++ platform/android/src/style/sources/image_source.cpp | 8 +++++++- platform/android/src/style/sources/image_source.hpp | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/ImageSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/ImageSource.java index 84e5e96fa..b7679b5a1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/ImageSource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/ImageSource.java @@ -124,6 +124,15 @@ public class ImageSource extends Source { return nativeGetUrl(); } + /** + * Updates the latitude and longitude of the four corners of the image + * + * @param latLngQuad latitude and longitude of the four corners of the image + */ + public void setCoordinates(LatLngQuad latLngQuad) { + nativeSetCoordinates(latLngQuad); + } + protected native void initialize(String layerId, LatLngQuad payload); protected native void nativeSetUrl(String url); @@ -132,6 +141,8 @@ public class ImageSource extends Source { protected native void nativeSetImage(Bitmap bitmap); + protected native void nativeSetCoordinates(LatLngQuad latLngQuad); + @Override protected native void finalize() throws Throwable; } diff --git a/platform/android/src/style/sources/image_source.cpp b/platform/android/src/style/sources/image_source.cpp index d46b367c5..e28a7862f 100644 --- a/platform/android/src/style/sources/image_source.cpp +++ b/platform/android/src/style/sources/image_source.cpp @@ -43,6 +43,11 @@ namespace android { source.as()->setImage(Bitmap::GetImage(env, bitmap)); } + void ImageSource::setCoordinates(jni::JNIEnv& env, jni::Object coordinatesObject) { + source.as()->setCoordinates( + LatLngQuad::getLatLngArray(env, coordinatesObject)); + } + jni::Class ImageSource::javaClass; jni::jobject* ImageSource::createJavaPeer(jni::JNIEnv& env) { @@ -64,7 +69,8 @@ namespace android { "finalize", METHOD(&ImageSource::setURL, "nativeSetUrl"), METHOD(&ImageSource::getURL, "nativeGetUrl"), - METHOD(&ImageSource::setImage, "nativeSetImage") + METHOD(&ImageSource::setImage, "nativeSetImage"), + METHOD(&ImageSource::setCoordinates, "nativeSetCoordinates") ); } diff --git a/platform/android/src/style/sources/image_source.hpp b/platform/android/src/style/sources/image_source.hpp index 9787a7294..c60058011 100644 --- a/platform/android/src/style/sources/image_source.hpp +++ b/platform/android/src/style/sources/image_source.hpp @@ -29,6 +29,7 @@ public: jni::String getURL(jni::JNIEnv&); void setImage(jni::JNIEnv&, jni::Object); + void setCoordinates(jni::JNIEnv&, jni::Object); jni::jobject* createJavaPeer(jni::JNIEnv&); From 54c3fcdec86a46649fa22af169d88fc377554157 Mon Sep 17 00:00:00 2001 From: Tobrun Date: Mon, 19 Feb 2018 19:08:07 +0100 Subject: [PATCH 10/28] [android] - check if hosting Activity isn't finishing before showing an dialog --- .../mapboxsdk/maps/AttributionDialogManager.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AttributionDialogManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AttributionDialogManager.java index 2956d864e..48de768e6 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AttributionDialogManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AttributionDialogManager.java @@ -1,5 +1,6 @@ package com.mapbox.mapboxsdk.maps; +import android.app.Activity; import android.app.AlertDialog; import android.content.ActivityNotFoundException; import android.content.Context; @@ -49,7 +50,17 @@ class AttributionDialogManager implements View.OnClickListener, DialogInterface. @Override public void onClick(View view) { attributionSet = new AttributionBuilder(mapboxMap).build(); - showAttributionDialog(); + + boolean isActivityFinishing = false; + if (context instanceof Activity) { + isActivityFinishing = ((Activity) context).isFinishing(); + } + + // check is hosting activity isn't finishing + // https://github.com/mapbox/mapbox-gl-native/issues/11238 + if (!isActivityFinishing) { + showAttributionDialog(); + } } private void showAttributionDialog() { From b00e92fa94bd2e23cf31e4244c1a9db9c7a462ea Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Mon, 19 Feb 2018 18:24:04 +0200 Subject: [PATCH 11/28] [core] check opengl error state after custom layer invocations --- src/mbgl/renderer/layers/render_custom_layer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mbgl/renderer/layers/render_custom_layer.cpp b/src/mbgl/renderer/layers/render_custom_layer.cpp index adafd8583..a429b8d82 100644 --- a/src/mbgl/renderer/layers/render_custom_layer.cpp +++ b/src/mbgl/renderer/layers/render_custom_layer.cpp @@ -5,6 +5,7 @@ #include #include #include +#include namespace mbgl { @@ -46,11 +47,11 @@ void RenderCustomLayer::render(PaintParameters& paintParameters, RenderSource*) if (context != impl().context || !initialized) { //If the context changed, deinitialize the previous one before initializing the new one. if (context && !contextDestroyed && impl().deinitializeFn) { - impl().deinitializeFn(context); + MBGL_CHECK_ERROR(impl().deinitializeFn(context)); } context = impl().context; assert(impl().initializeFn); - impl().initializeFn(impl().context); + MBGL_CHECK_ERROR(impl().initializeFn(impl().context)); initialized = true; } @@ -75,7 +76,7 @@ void RenderCustomLayer::render(PaintParameters& paintParameters, RenderSource*) parameters.fieldOfView = state.getFieldOfView(); assert(impl().renderFn); - impl().renderFn(context, parameters); + MBGL_CHECK_ERROR(impl().renderFn(context, parameters)); // Reset the view back to our original one, just in case the CustomLayer changed // the viewport or Framebuffer. From eec0db49e40f40e1545c8711cf8e394042862df3 Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Mon, 19 Feb 2018 18:33:15 +0200 Subject: [PATCH 12/28] [core] blacklist vao usage on mali t720 (sapphire 650) Avoids problems on (amongst others) Samsung Galaxy J3 --- src/mbgl/gl/context.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index d1a37a861..4b77954d1 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -249,10 +249,17 @@ UniqueTexture Context::createTexture() { bool Context::supportsVertexArrays() const { static bool blacklisted = []() { - // Blacklist Adreno 2xx, 3xx as it crashes on glBuffer(Sub)Data const std::string renderer = reinterpret_cast(glGetString(GL_RENDERER)); + + Log::Info(Event::General, "GPU Identifier: %s", renderer.c_str()); + + // Blacklist Adreno 2xx, 3xx as it crashes on glBuffer(Sub)Data + // Blacklist ARM Mali-T720 (in some MT8163 chipsets) as it crashes on glBindVertexArray return renderer.find("Adreno (TM) 2") != std::string::npos - || renderer.find("Adreno (TM) 3") != std::string::npos; + || renderer.find("Adreno (TM) 3") != std::string::npos + || renderer.find("Mali-T720") != std::string::npos + || renderer.find("Sapphire 650") != std::string::npos; + }(); return !blacklisted && From c84670e683f2e58aaa74fe3c236f6368950e2dab Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Mon, 19 Feb 2018 18:33:57 +0200 Subject: [PATCH 13/28] [android] custom layer example - fix fragment shader source for opengl es 2 phones --- platform/android/src/example_custom_layer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/android/src/example_custom_layer.cpp b/platform/android/src/example_custom_layer.cpp index 1ed68d083..4467cd5e2 100644 --- a/platform/android/src/example_custom_layer.cpp +++ b/platform/android/src/example_custom_layer.cpp @@ -6,7 +6,7 @@ #include static const GLchar * vertexShaderSource = "attribute vec2 a_pos; void main() { gl_Position = vec4(a_pos, 0, 1); }"; -static const GLchar * fragmentShaderSource = "uniform vec4 fill_color; void main() { gl_FragColor = fill_color; }"; +static const GLchar * fragmentShaderSource = "uniform highp vec4 fill_color; void main() { gl_FragColor = fill_color; }"; class ExampleCustomLayer { public: From 7fc676ed417ab509374f59a1e081605495cadcb3 Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Mon, 19 Feb 2018 18:34:32 +0200 Subject: [PATCH 14/28] [android] custom layer example - add error checking to debug issues more easily --- platform/android/src/example_custom_layer.cpp | 164 +++++++++++++++--- 1 file changed, 139 insertions(+), 25 deletions(-) diff --git a/platform/android/src/example_custom_layer.cpp b/platform/android/src/example_custom_layer.cpp index 4467cd5e2..4d1954f09 100644 --- a/platform/android/src/example_custom_layer.cpp +++ b/platform/android/src/example_custom_layer.cpp @@ -2,8 +2,111 @@ #include #include - +#include #include +#include + +// DEBUGGING + +const char* stringFromError(GLenum err) { + switch (err) { + case GL_INVALID_ENUM: + return "GL_INVALID_ENUM"; + + case GL_INVALID_VALUE: + return "GL_INVALID_VALUE"; + + case GL_INVALID_OPERATION: + return "GL_INVALID_OPERATION"; + + case GL_INVALID_FRAMEBUFFER_OPERATION: + return "GL_INVALID_FRAMEBUFFER_OPERATION"; + + case GL_OUT_OF_MEMORY: + return "GL_OUT_OF_MEMORY"; + +#ifdef GL_TABLE_TOO_LARGE + case GL_TABLE_TOO_LARGE: + return "GL_TABLE_TOO_LARGE"; +#endif + +#ifdef GL_STACK_OVERFLOW + case GL_STACK_OVERFLOW: + return "GL_STACK_OVERFLOW"; +#endif + +#ifdef GL_STACK_UNDERFLOW + case GL_STACK_UNDERFLOW: + return "GL_STACK_UNDERFLOW"; +#endif + +#ifdef GL_CONTEXT_LOST + case GL_CONTEXT_LOST: + return "GL_CONTEXT_LOST"; +#endif + + default: + return "GL_UNKNOWN"; + } +} + +struct Error : std::runtime_error { + using std::runtime_error::runtime_error; +}; + +void checkError(const char *cmd, const char *file, int line) { + + GLenum err = GL_NO_ERROR; + if ((err = glGetError()) != GL_NO_ERROR) { + std::string message = std::string(cmd) + ": Error " + stringFromError(err); + + // Check for further errors + while ((err = glGetError()) != GL_NO_ERROR) { + message += ", "; + message += stringFromError(err); + } + + mbgl::Log::Error(mbgl::Event::General, message + " at " + file + ":" + mbgl::util::toString(line)); + throw Error(message + " at " + file + ":" + mbgl::util::toString(line)); + } +} + +#ifndef NDEBUG +#define GL_CHECK_ERROR(cmd) ([&]() { struct __MBGL_C_E { ~__MBGL_C_E() noexcept(false) { checkError(#cmd, __FILE__, __LINE__); } } __MBGL_C_E; return cmd; }()) +#else +#define GL_CHECK_ERROR(cmd) (cmd) +#endif + +void checkLinkStatus(GLuint program) { + GLint isLinked = 0; + glGetProgramiv(program, GL_LINK_STATUS, &isLinked); + if (isLinked == GL_FALSE) { + GLint maxLength = 0; + glGetProgramiv(program, GL_INFO_LOG_LENGTH, &maxLength); + GLchar infoLog[maxLength]; + glGetProgramInfoLog(program, maxLength, &maxLength, &infoLog[0]); + mbgl::Log::Info(mbgl::Event::General, &infoLog[0]); + throw Error(infoLog); + } + +} + +void checkCompileStatus(GLuint shader) { + GLint isCompiled = 0; + glGetShaderiv(shader, GL_COMPILE_STATUS, &isCompiled); + if (isCompiled == GL_FALSE) { + GLint maxLength = 0; + glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &maxLength); + + // The maxLength includes the NULL character + GLchar errorLog[maxLength]; + glGetShaderInfoLog(shader, maxLength, &maxLength, &errorLog[0]); + mbgl::Log::Error(mbgl::Event::General, &errorLog[0]); + throw Error(errorLog); + } +} + +// /DEBUGGING static const GLchar * vertexShaderSource = "attribute vec2 a_pos; void main() { gl_Position = vec4(a_pos, 0, 1); }"; static const GLchar * fragmentShaderSource = "uniform highp vec4 fill_color; void main() { gl_FragColor = fill_color; }"; @@ -24,37 +127,48 @@ public: void initialize() { mbgl::Log::Info(mbgl::Event::General, "Initialize"); - program = glCreateProgram(); - vertexShader = glCreateShader(GL_VERTEX_SHADER); - fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); - glShaderSource(vertexShader, 1, &vertexShaderSource, nullptr); - glCompileShader(vertexShader); - glAttachShader(program, vertexShader); - glShaderSource(fragmentShader, 1, &fragmentShaderSource, nullptr); - glCompileShader(fragmentShader); - glAttachShader(program, fragmentShader); - glLinkProgram(program); - a_pos = glGetAttribLocation(program, "a_pos"); - fill_color = glGetUniformLocation(program, "fill_color"); + // Debug info + int maxAttrib; + GL_CHECK_ERROR(glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttrib)); + mbgl::Log::Info(mbgl::Event::General, "Max vertex attributes: %i", maxAttrib); - GLfloat background[] = { -1,-1, 1,-1, -1,1, 1,1 }; - glGenBuffers(1, &buffer); - glBindBuffer(GL_ARRAY_BUFFER, buffer); - glBufferData(GL_ARRAY_BUFFER, 8 * sizeof(GLfloat), background, GL_STATIC_DRAW); + program = GL_CHECK_ERROR(glCreateProgram()); + vertexShader = GL_CHECK_ERROR(glCreateShader(GL_VERTEX_SHADER)); + fragmentShader = GL_CHECK_ERROR(glCreateShader(GL_FRAGMENT_SHADER)); + + GL_CHECK_ERROR(glShaderSource(vertexShader, 1, &vertexShaderSource, nullptr)); + GL_CHECK_ERROR(glCompileShader(vertexShader)); + checkCompileStatus(vertexShader); + GL_CHECK_ERROR(glAttachShader(program, vertexShader)); + GL_CHECK_ERROR(glShaderSource(fragmentShader, 1, &fragmentShaderSource, nullptr)); + GL_CHECK_ERROR(glCompileShader(fragmentShader)); + checkCompileStatus(fragmentShader); + GL_CHECK_ERROR(glAttachShader(program, fragmentShader)); + GL_CHECK_ERROR(glLinkProgram(program)); + checkLinkStatus(program); + + a_pos = GL_CHECK_ERROR(glGetAttribLocation(program, "a_pos")); + fill_color = GL_CHECK_ERROR(glGetUniformLocation(program, "fill_color")); + + GLfloat background[] = { -1, -1, 1, -1, -1, 1, 1, 1 }; + GL_CHECK_ERROR(glGenBuffers(1, &buffer)); + GL_CHECK_ERROR(glBindBuffer(GL_ARRAY_BUFFER, buffer)); + GL_CHECK_ERROR(glBufferData(GL_ARRAY_BUFFER, 8 * sizeof(GLfloat), background, GL_STATIC_DRAW)); } void render() { mbgl::Log::Info(mbgl::Event::General, "Render"); - glUseProgram(program); - glBindBuffer(GL_ARRAY_BUFFER, buffer); - glEnableVertexAttribArray(a_pos); - glVertexAttribPointer(a_pos, 2, GL_FLOAT, GL_FALSE, 0, NULL); - glDisable(GL_STENCIL_TEST); - glDisable(GL_DEPTH_TEST); - glUniform4fv(fill_color, 1, color); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + GL_CHECK_ERROR(glUseProgram(program)); + GL_CHECK_ERROR(glBindBuffer(GL_ARRAY_BUFFER, buffer)); + GL_CHECK_ERROR(glEnableVertexAttribArray(a_pos)); + GL_CHECK_ERROR(glVertexAttribPointer(a_pos, 2, GL_FLOAT, GL_FALSE, 0, NULL)); + GL_CHECK_ERROR(glDisable(GL_STENCIL_TEST)); + GL_CHECK_ERROR(glDisable(GL_DEPTH_TEST)); + GL_CHECK_ERROR(glUniform4fv(fill_color, 1, color)); + GL_CHECK_ERROR(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4)); + } GLuint program = 0; From 4b32228cc2fbf7f6dc720edd32a17bc4c7f44071 Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Thu, 22 Feb 2018 16:00:14 +0200 Subject: [PATCH 15/28] [android] custom layer example - remove dependencies on mbgl logging and string headers --- platform/android/src/example_custom_layer.cpp | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/platform/android/src/example_custom_layer.cpp b/platform/android/src/example_custom_layer.cpp index 4d1954f09..46fcd96ff 100644 --- a/platform/android/src/example_custom_layer.cpp +++ b/platform/android/src/example_custom_layer.cpp @@ -1,13 +1,13 @@ #include #include - -#include -#include +#include +#include #include -#include // DEBUGGING +const char* LOG_TAG = "Custom Layer Example"; + const char* stringFromError(GLenum err) { switch (err) { case GL_INVALID_ENUM: @@ -58,16 +58,17 @@ void checkError(const char *cmd, const char *file, int line) { GLenum err = GL_NO_ERROR; if ((err = glGetError()) != GL_NO_ERROR) { - std::string message = std::string(cmd) + ": Error " + stringFromError(err); + std::ostringstream message; + message << cmd << ": Error " << stringFromError(err); // Check for further errors while ((err = glGetError()) != GL_NO_ERROR) { - message += ", "; - message += stringFromError(err); + message << ", " << stringFromError(err); } - mbgl::Log::Error(mbgl::Event::General, message + " at " + file + ":" + mbgl::util::toString(line)); - throw Error(message + " at " + file + ":" + mbgl::util::toString(line)); + message << " at " << file << ":" << line; + __android_log_write(ANDROID_LOG_ERROR, LOG_TAG, message.str().c_str()); + throw Error(message.str()); } } @@ -85,7 +86,7 @@ void checkLinkStatus(GLuint program) { glGetProgramiv(program, GL_INFO_LOG_LENGTH, &maxLength); GLchar infoLog[maxLength]; glGetProgramInfoLog(program, maxLength, &maxLength, &infoLog[0]); - mbgl::Log::Info(mbgl::Event::General, &infoLog[0]); + __android_log_write(ANDROID_LOG_ERROR, LOG_TAG, &infoLog[0]); throw Error(infoLog); } @@ -101,7 +102,7 @@ void checkCompileStatus(GLuint shader) { // The maxLength includes the NULL character GLchar errorLog[maxLength]; glGetShaderInfoLog(shader, maxLength, &maxLength, &errorLog[0]); - mbgl::Log::Error(mbgl::Event::General, &errorLog[0]); + __android_log_write(ANDROID_LOG_ERROR, LOG_TAG, &errorLog[0]); throw Error(errorLog); } } @@ -114,7 +115,7 @@ static const GLchar * fragmentShaderSource = "uniform highp vec4 fill_color; voi class ExampleCustomLayer { public: ~ExampleCustomLayer() { - mbgl::Log::Info(mbgl::Event::General, "~ExampleCustomLayer"); + __android_log_write(ANDROID_LOG_INFO, LOG_TAG, "~ExampleCustomLayer"); if (program) { glDeleteBuffers(1, &buffer); glDetachShader(program, vertexShader); @@ -126,12 +127,12 @@ public: } void initialize() { - mbgl::Log::Info(mbgl::Event::General, "Initialize"); + __android_log_write(ANDROID_LOG_INFO, LOG_TAG, "Initialize"); // Debug info int maxAttrib; GL_CHECK_ERROR(glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttrib)); - mbgl::Log::Info(mbgl::Event::General, "Max vertex attributes: %i", maxAttrib); + __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "Max vertex attributes: %i", maxAttrib); program = GL_CHECK_ERROR(glCreateProgram()); vertexShader = GL_CHECK_ERROR(glCreateShader(GL_VERTEX_SHADER)); @@ -158,7 +159,7 @@ public: } void render() { - mbgl::Log::Info(mbgl::Event::General, "Render"); + __android_log_write(ANDROID_LOG_INFO, LOG_TAG, "Render"); GL_CHECK_ERROR(glUseProgram(program)); GL_CHECK_ERROR(glBindBuffer(GL_ARRAY_BUFFER, buffer)); @@ -184,12 +185,12 @@ public: GLfloat ExampleCustomLayer::color[] = { 0.0f, 1.0f, 0.0f, 1.0f }; jlong JNICALL nativeCreateContext(JNIEnv*, jobject) { - mbgl::Log::Info(mbgl::Event::General, "nativeCreateContext"); + __android_log_write(ANDROID_LOG_INFO, LOG_TAG, "nativeCreateContext"); return reinterpret_cast(new ExampleCustomLayer()); } void JNICALL nativeSetColor(JNIEnv*, jobject, jfloat red, jfloat green, jfloat blue, jfloat alpha) { - mbgl::Log::Info(mbgl::Event::General, "nativeSetColor: %.2f, %.2f, %.2f, %.2f", red, green, blue, alpha); + __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "nativeSetColor: %.2f, %.2f, %.2f, %.2f", red, green, blue, alpha); ExampleCustomLayer::color[0] = red; ExampleCustomLayer::color[1] = green; ExampleCustomLayer::color[2] = blue; @@ -197,26 +198,28 @@ void JNICALL nativeSetColor(JNIEnv*, jobject, jfloat red, jfloat green, jfloat b } void nativeInitialize(void *context) { - mbgl::Log::Info(mbgl::Event::General, "nativeInitialize"); + __android_log_write(ANDROID_LOG_INFO, LOG_TAG, "nativeInitialize"); reinterpret_cast(context)->initialize(); } void nativeRender(void *context, const mbgl::style::CustomLayerRenderParameters& /*parameters*/) { - mbgl::Log::Info(mbgl::Event::General, "nativeRender"); + __android_log_write(ANDROID_LOG_INFO, LOG_TAG, "nativeRender"); reinterpret_cast(context)->render(); } void nativeContextLost(void */*context*/) { - mbgl::Log::Info(mbgl::Event::General, "nativeContextLost"); + __android_log_write(ANDROID_LOG_INFO, LOG_TAG, "nativeContextLost"); } -void nativeDenitialize(void *context) { - mbgl::Log::Info(mbgl::Event::General, "nativeDeinitialize"); + +void nativeDeinitialize(void *context) { + __android_log_write(ANDROID_LOG_INFO, LOG_TAG, "nativeDeinitialize"); delete reinterpret_cast(context); } extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { - mbgl::Log::Info(mbgl::Event::General, "OnLoad"); + __android_log_write(ANDROID_LOG_INFO, LOG_TAG, "OnLoad"); + JNIEnv *env = nullptr; vm->GetEnv(reinterpret_cast(&env), JNI_VERSION_1_6); From 90cce8d9ce09ccbd828341e924b94caaf8f30899 Mon Sep 17 00:00:00 2001 From: Osana Babayan <32496536+osana@users.noreply.github.com> Date: Mon, 19 Feb 2018 10:25:11 -0500 Subject: [PATCH 16/28] [android] incorrect latlngBounds in the VisibleRegion with map is rotated smallest bounding box for 4 points cannot (#11226) be created using LatLngBounds.fromLatLngs() as the order matters in that method and that does not work for rotated map --- .../java/com/mapbox/mapboxsdk/maps/Projection.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java index 16c73b1ca..ae559189a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java @@ -104,11 +104,12 @@ public class Projection { LatLng bottomLeft = fromScreenLocation(new PointF(left, bottom)); return new VisibleRegion(topLeft, topRight, bottomLeft, bottomRight, - LatLngBounds.from( - topRight.getLatitude(), - topRight.getLongitude(), - bottomLeft.getLatitude(), - bottomLeft.getLongitude()) + new LatLngBounds.Builder() + .include(topRight) + .include(bottomLeft) + .include(bottomRight) + .include(topLeft) + .build() ); } From a8b8c5defac6e6c08ef161b32f52496148573d01 Mon Sep 17 00:00:00 2001 From: Tobrun Date: Thu, 1 Mar 2018 10:06:48 +0100 Subject: [PATCH 17/28] [android] - update changelog for v5.5.0 --- platform/android/CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md index 7827bc129..d0d29eabf 100644 --- a/platform/android/CHANGELOG.md +++ b/platform/android/CHANGELOG.md @@ -2,6 +2,18 @@ Mapbox welcomes participation and contributions from everyone. If you'd like to do so please see the [`Contributing Guide`](https://github.com/mapbox/mapbox-gl-native/blob/master/CONTRIBUTING.md) first to get started. +## 5.5.0 - March 1, 2018 + - TileJSON Bounds allows values inclusive of world extents [#11178](https://github.com/mapbox/mapbox-gl-native/pull/11178) + - LatLngBounds returned by VisibleRegion when map is rotated [#11226](https://github.com/mapbox/mapbox-gl-native/pull/11226) + - Custom Layer fixes & black list VAO on mali t720 [#11239](https://github.com/mapbox/mapbox-gl-native/pull/11239) + - Check if Activity isn't finishing before showing dialog [#11244](https://github.com/mapbox/mapbox-gl-native/pull/11244) + - Decouple MapPadding from overlain views [#11258](https://github.com/mapbox/mapbox-gl-native/pull/11258) + - Don't disable zoom button controller zooming with gesture disabled zoom [#11259](https://github.com/mapbox/mapbox-gl-native/pull/11259) + - Expose ImageSource coordinates setter [#11262](https://github.com/mapbox/mapbox-gl-native/pull/11262) + - Add missing DeleteLocalRefs [#11272](https://github.com/mapbox/mapbox-gl-native/pull/11272) + - Continue loading style even if we mutate it [#11294](https://github.com/mapbox/mapbox-gl-native/pull/11294) + - Update telemetry version for OkHttp [#11338](https://github.com/mapbox/mapbox-gl-native/pull/11338) + ## 5.4.1 - February 9, 2018 - Don't recreate TextureView surface as part of view resizing, solves OOM crashes [#11148](https://github.com/mapbox/mapbox-gl-native/pull/11148) - Don't invoke OnLowMemory before map is ready, solves startup crash on low memory devices [#11109](https://github.com/mapbox/mapbox-gl-native/pull/11109) From 6e4846044531128b8984f351d367a7185325565d Mon Sep 17 00:00:00 2001 From: Tobrun Date: Thu, 1 Mar 2018 10:10:25 +0100 Subject: [PATCH 18/28] [android] - release android v5.5.0 --- circle.yml | 2 +- platform/android/MapboxGLAndroidSDK/gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index d76ab4a8a..bb9392f39 100644 --- a/circle.yml +++ b/circle.yml @@ -355,7 +355,7 @@ jobs: - deploy: name: Publish to Maven command: | - if [ "${CIRCLE_BRANCH}" == "release-agua" ]; then make run-android-upload-archives ; fi + if [ "${CIRCLE_BRANCH}" == "release-android-v5.5.0" ]; then make run-android-upload-archives ; fi # ------------------------------------------------------------------------------ diff --git a/platform/android/MapboxGLAndroidSDK/gradle.properties b/platform/android/MapboxGLAndroidSDK/gradle.properties index 8839f21d8..36252fc90 100644 --- a/platform/android/MapboxGLAndroidSDK/gradle.properties +++ b/platform/android/MapboxGLAndroidSDK/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.mapbox.mapboxsdk -VERSION_NAME=5.4.2-SNAPSHOT +VERSION_NAME=5.5.0 POM_DESCRIPTION=Mapbox GL Android SDK POM_URL=https://github.com/mapbox/mapbox-gl-native From 72393707d34fd7c4c0fa81b66b40805f29411aed Mon Sep 17 00:00:00 2001 From: Tobrun Date: Thu, 1 Mar 2018 10:44:29 +0100 Subject: [PATCH 19/28] [android] - fix custom layer example --- platform/android/src/example_custom_layer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/android/src/example_custom_layer.cpp b/platform/android/src/example_custom_layer.cpp index 46fcd96ff..be8e83041 100644 --- a/platform/android/src/example_custom_layer.cpp +++ b/platform/android/src/example_custom_layer.cpp @@ -249,7 +249,7 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { env->SetStaticLongField(customLayerClass, env->GetStaticFieldID(customLayerClass, "DeinitializeFunction", "J"), - reinterpret_cast(nativeDenitialize)); + reinterpret_cast(nativeDeinitialize)); return JNI_VERSION_1_6; } From 40039f6b430b4730aed8c52c28de3a855b8425ea Mon Sep 17 00:00:00 2001 From: Tobrun Date: Thu, 1 Mar 2018 11:25:18 +0100 Subject: [PATCH 20/28] [android] - reset release configuration --- circle.yml | 2 +- platform/android/MapboxGLAndroidSDK/gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index bb9392f39..d76ab4a8a 100644 --- a/circle.yml +++ b/circle.yml @@ -355,7 +355,7 @@ jobs: - deploy: name: Publish to Maven command: | - if [ "${CIRCLE_BRANCH}" == "release-android-v5.5.0" ]; then make run-android-upload-archives ; fi + if [ "${CIRCLE_BRANCH}" == "release-agua" ]; then make run-android-upload-archives ; fi # ------------------------------------------------------------------------------ diff --git a/platform/android/MapboxGLAndroidSDK/gradle.properties b/platform/android/MapboxGLAndroidSDK/gradle.properties index 36252fc90..f5dc431d4 100644 --- a/platform/android/MapboxGLAndroidSDK/gradle.properties +++ b/platform/android/MapboxGLAndroidSDK/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.mapbox.mapboxsdk -VERSION_NAME=5.5.0 +VERSION_NAME=5.5.1-SNAPSHOT POM_DESCRIPTION=Mapbox GL Android SDK POM_URL=https://github.com/mapbox/mapbox-gl-native From c54035afb159826740ebb4c6a69dfe0f1809604f Mon Sep 17 00:00:00 2001 From: Asheem Mamoowala Date: Fri, 16 Feb 2018 12:38:23 -0800 Subject: [PATCH 21/28] [core] Support a range of zooms in TileRange. Accounts for TilePyramid requesting parent tiles of ideal zoom tiles. --- src/mbgl/renderer/tile_pyramid.cpp | 7 +++- src/mbgl/util/tile_range.hpp | 60 ++++++++++++++++++++---------- test/util/tile_range.test.cpp | 13 ++++++- 3 files changed, 57 insertions(+), 23 deletions(-) diff --git a/src/mbgl/renderer/tile_pyramid.cpp b/src/mbgl/renderer/tile_pyramid.cpp index c9e3b0630..da4ca4abf 100644 --- a/src/mbgl/renderer/tile_pyramid.cpp +++ b/src/mbgl/renderer/tile_pyramid.cpp @@ -137,10 +137,13 @@ void TilePyramid::update(const std::vector>& layer auto it = tiles.find(tileID); return it == tiles.end() ? nullptr : it->second.get(); }; - + + // The min and max zoom for TileRange are based on the updateRenderables algorithm. + // Tiles are created at the ideal tile zoom or at lower zoom levels. Child + // tiles are used from the cache, but not created. optional tileRange = {}; if (bounds) { - tileRange = util::TileRange::fromLatLngBounds(*bounds, std::min(tileZoom, (int32_t)zoomRange.max)); + tileRange = util::TileRange::fromLatLngBounds(*bounds, zoomRange.min, std::min(tileZoom, (int32_t)zoomRange.max)); } auto createTileFn = [&](const OverscaledTileID& tileID) -> Tile* { if (tileRange && !tileRange->contains(tileID.canonical)) { diff --git a/src/mbgl/util/tile_range.hpp b/src/mbgl/util/tile_range.hpp index f630a4907..8554cfb65 100644 --- a/src/mbgl/util/tile_range.hpp +++ b/src/mbgl/util/tile_range.hpp @@ -6,41 +6,61 @@ #include namespace mbgl { - namespace util { class TileRange { public: - Range> range; - uint8_t z; + Range> range; + Range zoomRange; + + // Compute the range of tiles covered by the bounds at maxZoom. + static TileRange fromLatLngBounds(const LatLngBounds& bounds, uint8_t minZoom, uint8_t maxZoom) { + if (minZoom > maxZoom) { + std::swap(minZoom, maxZoom); + } + + auto swProj = Projection::project(bounds.southwest().wrapped(), maxZoom); + auto ne = bounds.northeast(); + auto neProj = Projection::project(ne.longitude() > util::LONGITUDE_MAX ? ne.wrapped() : ne , maxZoom); + + const auto maxTile = std::pow(2.0, maxZoom); + const auto minX = static_cast(std::floor(swProj.x)); + const auto maxX = static_cast(std::floor(neProj.x)); + const auto minY = static_cast(util::clamp(std::floor(neProj.y), 0.0 , maxTile)); + const auto maxY = static_cast(util::clamp(std::floor(swProj.y), 0.0, maxTile)); + + return TileRange({ {minX, minY}, {maxX, maxY} }, {minZoom, maxZoom}); + } // Compute the range of tiles covered by the bounds. static TileRange fromLatLngBounds(const LatLngBounds& bounds, uint8_t z) { - auto swProj = Projection::project(bounds.southwest().wrapped(), z); - auto ne = bounds.northeast(); - auto neProj = Projection::project(ne.longitude() > util::LONGITUDE_MAX ? ne.wrapped() : ne , z); - const auto minX = std::floor(swProj.x); - const auto maxX = std::ceil(neProj.x); - const auto minY = std::floor(neProj.y); - const auto maxY = std::ceil(swProj.y); - return TileRange({ {minX, minY}, {maxX, maxY} }, z); + return fromLatLngBounds(bounds, z, z); } bool contains(const CanonicalTileID& tileID) { - return z == tileID.z && - (range.min.x >= range.max.x ? //For wrapped bounds - tileID.x >= range.min.x || tileID.x < range.max.x : - tileID.x < range.max.x && tileID.x >= range.min.x) && - tileID.y < range.max.y && - tileID.y >= range.min.y; + if (tileID.z <= zoomRange.max && tileID.z >= zoomRange.min) { + if (tileID.z == 0) { + return true; + } + uint8_t dz = (zoomRange.max - tileID.z); + auto x0 = range.min.x >> dz; + auto x1 = range.max.x >> dz; + auto y0 = range.min.y >> dz; + auto y1 = range.max.y >> dz; + return (range.min.x > range.max.x ? //For wrapped bounds + tileID.x >= x0 || tileID.x <= x1 : + tileID.x <= x1 && tileID.x >= x0) && + tileID.y <= y1 && + tileID.y >= y0; + } + return false; } private: - TileRange(Range> range_, uint8_t z_) + TileRange(Range> range_, Range z_) : range(range_), - z(z_) { + zoomRange(z_) { } - }; } // namespace util diff --git a/test/util/tile_range.test.cpp b/test/util/tile_range.test.cpp index dc8ae2870..c4c37c74d 100644 --- a/test/util/tile_range.test.cpp +++ b/test/util/tile_range.test.cpp @@ -1,4 +1,3 @@ - #include #include #include @@ -25,6 +24,18 @@ TEST(TileRange, ContainsBoundsFromTile) { EXPECT_TRUE(range.contains(CanonicalTileID(10, 162, 395))); } } + +TEST(TileRange, ContainsMultiZoom) { + auto wrappedBounds = LatLngBounds::hull({ 37.6609, -122.5744 }, { 37.8271, -122.3204 }); + auto range = util::TileRange::fromLatLngBounds(wrappedBounds, 5, 13); + EXPECT_FALSE(range.contains(CanonicalTileID(0, 0, 0))); + EXPECT_FALSE(range.contains(CanonicalTileID(5, 3, 11))); + EXPECT_FALSE(range.contains(CanonicalTileID(6, 9, 22))); + EXPECT_TRUE(range.contains(CanonicalTileID(5, 5, 12))); + EXPECT_TRUE(range.contains(CanonicalTileID(6, 10, 24))); + EXPECT_TRUE(range.contains(CanonicalTileID(13, 1310, 3166))); +} + TEST(TileRange, ContainsIntersectingTiles) { auto bounds = LatLngBounds::hull({ 37.6609, -122.5744 }, { 37.8271, -122.3204 }); auto range = util::TileRange::fromLatLngBounds(bounds, 13); From 7df451def6c37bd842b13954b91fe8f303ecec9f Mon Sep 17 00:00:00 2001 From: Asheem Mamoowala Date: Thu, 8 Mar 2018 12:18:59 -0800 Subject: [PATCH 22/28] [core] TileJSON conversion clamps bounds longitude to [-180,180], per spec --- include/mbgl/style/conversion/tileset.hpp | 2 ++ test/style/conversion/tileset.test.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/mbgl/style/conversion/tileset.hpp b/include/mbgl/style/conversion/tileset.hpp index 6ec46aa7b..16322b58e 100644 --- a/include/mbgl/style/conversion/tileset.hpp +++ b/include/mbgl/style/conversion/tileset.hpp @@ -100,6 +100,8 @@ public: 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 9487277cc..f10aa0e31 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 converted = convertJSON(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(R"JSON({ From c815c1e2d661ae43584db0e6eed2a2aaf5fe7e14 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Thu, 8 Mar 2018 14:31:58 -0500 Subject: [PATCH 23/28] [ios] Fix pinch drift ignoring delegate camera change response --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLMapView.mm | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index e2052abb8..49b2add72 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -4,6 +4,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ## 3.7.6 +* 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 diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 02f529d09..0fae5e039 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1459,10 +1459,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)); @@ -1695,7 +1697,9 @@ public: { [weakSelf unrotateIfNeededForGesture]; }]; - } else { + } + else + { [self unrotateIfNeededForGesture]; } } From e690e7cf1e91ba33017575ed9d068f2f38acab03 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Thu, 8 Mar 2018 14:52:43 -0500 Subject: [PATCH 24/28] [ios] Add camera limit debug option to iosapp Adapted from https://github.com/mapbox/ios-sdk-examples/blob/cdff47276d261d58c7eb2d0ba75d9cce6c308417/Examples/ObjectiveC/BlockingGesturesDelegateExample.m --- platform/ios/app/MBXViewController.m | 43 +++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 1046644f8..63b06af58 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) { @@ -85,6 +90,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { MBXSettingsMiscellaneousToggleTwoMaps, MBXSettingsMiscellaneousCountryLabels, MBXSettingsMiscellaneousShowSnapshots, + MBXSettingsMiscellaneousShouldLimitCameraChanges, MBXSettingsMiscellaneousPrintLogFile, MBXSettingsMiscellaneousDeleteLogFile, }; @@ -122,6 +128,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { @property (nonatomic) BOOL usingLocaleBasedCountryLabels; @property (nonatomic) BOOL reuseQueueStatsEnabled; @property (nonatomic) BOOL showZoomLevelEnabled; +@property (nonatomic) BOOL shouldLimitCameraChanges; @end @@ -363,7 +370,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) @@ -652,6 +660,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; @@ -1880,6 +1896,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]; From ec91b83ea4543c7a0cf0056d48f2d7f52179e1e1 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Wed, 10 Jan 2018 18:12:00 -0500 Subject: [PATCH 25/28] [build] Update to Xcode 9.2 on CircleCI (#10893) When CircleCI says 9.2.0, they mean it... --- circle.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/circle.yml b/circle.yml index d76ab4a8a..fac2d2158 100644 --- a/circle.yml +++ b/circle.yml @@ -654,7 +654,7 @@ jobs: # ------------------------------------------------------------------------------ ios-debug: macos: - xcode: "9.0" + xcode: "9.2.0" environment: BUILDTYPE: Debug HOMEBREW_NO_AUTO_UPDATE: 1 @@ -672,7 +672,7 @@ jobs: # ------------------------------------------------------------------------------ ios-sanitize-address: macos: - xcode: "9.0" + xcode: "9.2.0" environment: BUILDTYPE: Debug HOMEBREW_NO_AUTO_UPDATE: 1 @@ -691,7 +691,7 @@ jobs: # ------------------------------------------------------------------------------ ios-sanitize-thread: macos: - xcode: "9.0" + xcode: "9.2.0" environment: BUILDTYPE: Debug HOMEBREW_NO_AUTO_UPDATE: 1 @@ -710,7 +710,7 @@ jobs: # ------------------------------------------------------------------------------ macos-debug: macos: - xcode: "9.0" + xcode: "9.2.0" environment: BUILDTYPE: Debug HOMEBREW_NO_AUTO_UPDATE: 1 @@ -731,7 +731,7 @@ jobs: # ------------------------------------------------------------------------------ macos-debug-qt5: macos: - xcode: "9.0" + xcode: "9.2.0" environment: BUILDTYPE: Debug HOMEBREW_NO_AUTO_UPDATE: 1 @@ -756,7 +756,7 @@ jobs: # ------------------------------------------------------------------------------ macos-release-node4: macos: - xcode: "9.0" + xcode: "9.2.0" environment: BUILDTYPE: RelWithDebInfo HOMEBREW_NO_AUTO_UPDATE: 1 @@ -777,7 +777,7 @@ jobs: # ------------------------------------------------------------------------------ macos-release-node6: macos: - xcode: "9.0" + xcode: "9.2.0" environment: BUILDTYPE: RelWithDebInfo HOMEBREW_NO_AUTO_UPDATE: 1 From 1b3d8f990f0ac524ad7142e31433717b1f8be81c Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 12 Mar 2018 13:57:22 -0400 Subject: [PATCH 26/28] [ios, build] Move iOS release builds to CircleCI --- circle.yml | 34 +++++++++++ platform/ios/bitrise.yml | 98 -------------------------------- platform/ios/scripts/document.sh | 2 +- 3 files changed, 35 insertions(+), 99 deletions(-) delete mode 100644 platform/ios/bitrise.yml diff --git a/circle.yml b/circle.yml index fac2d2158..f2e82d2a7 100644 --- a/circle.yml +++ b/circle.yml @@ -33,6 +33,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: @@ -707,6 +713,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: diff --git a/platform/ios/bitrise.yml b/platform/ios/bitrise.yml deleted file mode 100644 index 24bd054db..000000000 --- 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 - completed successfully.' - - message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}> - for - 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 - completed successfully.' - - message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}> - for - 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 57b596a4b..43cbe3067 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 From 40e5af700b387d4ff5dcec4b9f056bc4a7e8e383 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 12 Mar 2018 17:17:36 -0400 Subject: [PATCH 27/28] [ios] Prepare changelog for ios-v3.7.6 --- platform/ios/CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 49b2add72..e7277a2e1 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,8 +2,11 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. -## 3.7.6 +## 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)) From 4544b7aae9ab96ff89f3e46a1ee38ce0af95054f Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 12 Mar 2018 17:19:34 -0400 Subject: [PATCH 28/28] [ios] Bump podspecs for ios-v3.7.6 --- platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec | 2 +- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec index bf2f854b5..268b7b9da 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 e0c787e5d..a1b2441d2 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 ea7ce47a8..7e696a23c 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