From b00b788d83deae5575e61a7b331d732020bda71e Mon Sep 17 00:00:00 2001 From: tobrun Date: Thu, 14 Feb 2019 16:08:25 +0200 Subject: test --- .../main/java/com/mapbox/mapboxsdk/maps/MapFragment.java | 2 +- .../android/src/style/sources/custom_geometry_source.cpp | 8 ++++---- platform/android/src/style/sources/geojson_source.cpp | 14 +++++++------- platform/android/src/style/sources/image_source.cpp | 8 ++++---- platform/android/src/style/sources/raster_dem_source.cpp | 2 +- platform/android/src/style/sources/raster_source.cpp | 2 +- platform/android/src/style/sources/source.cpp | 12 ++++++------ platform/android/src/style/sources/source.hpp | 2 +- platform/android/src/style/sources/vector_source.cpp | 4 ++-- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java index 1f8c7ac55f..00576aa52a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java @@ -23,7 +23,7 @@ import java.util.List; * Being a fragment, this component can be added to an activity's layout or can dynamically be added * using a FragmentManager. *

- *

+ *

f * To get a reference to the MapView, use {@link #getMapAsync(OnMapReadyCallback)}} *

* diff --git a/platform/android/src/style/sources/custom_geometry_source.cpp b/platform/android/src/style/sources/custom_geometry_source.cpp index 057f5c99ba..b835e05134 100644 --- a/platform/android/src/style/sources/custom_geometry_source.cpp +++ b/platform/android/src/style/sources/custom_geometry_source.cpp @@ -133,17 +133,17 @@ namespace android { // Update the core source if not cancelled if (!isCancelled(z, x ,y)) { - source.as()->CustomGeometrySource::setTileData(CanonicalTileID(z, x, y), GeoJSON(geometry)); + source->as()->CustomGeometrySource::setTileData(CanonicalTileID(z, x, y), GeoJSON(geometry)); } } void CustomGeometrySource::invalidateTile(jni::JNIEnv&, jni::jint z, jni::jint x, jni::jint y) { - source.as()->CustomGeometrySource::invalidateTile(CanonicalTileID(z, x, y)); + source->as()->CustomGeometrySource::invalidateTile(CanonicalTileID(z, x, y)); } void CustomGeometrySource::invalidateBounds(jni::JNIEnv& env, const jni::Object& jBounds) { auto bounds = LatLngBounds::getLatLngBounds(env, jBounds); - source.as()->CustomGeometrySource::invalidateRegion(bounds); + source->as()->CustomGeometrySource::invalidateRegion(bounds); } jni::Local>> CustomGeometrySource::querySourceFeatures(jni::JNIEnv& env, @@ -153,7 +153,7 @@ namespace android { std::vector features; if (rendererFrontend) { - features = rendererFrontend->querySourceFeatures(source.getID(), { {}, toFilter(env, jfilter) }); + features = rendererFrontend->querySourceFeatures(source->getID(), { {}, toFilter(env, jfilter) }); } return Feature::convert(env, features); } diff --git a/platform/android/src/style/sources/geojson_source.cpp b/platform/android/src/style/sources/geojson_source.cpp index a9307afe67..106da3bd42 100644 --- a/platform/android/src/style/sources/geojson_source.cpp +++ b/platform/android/src/style/sources/geojson_source.cpp @@ -87,11 +87,11 @@ namespace android { void GeoJSONSource::setURL(jni::JNIEnv& env, const jni::String& url) { // Update the core source - source.as()->GeoJSONSource::setURL(jni::Make(env, url)); + source->as()->GeoJSONSource::setURL(jni::Make(env, url)); } jni::Local GeoJSONSource::getURL(jni::JNIEnv& env) { - optional url = source.as()->GeoJSONSource::getURL(); + optional url = source->as()->GeoJSONSource::getURL(); return url ? jni::Make(env, *url) : jni::Local(); } @@ -102,7 +102,7 @@ namespace android { std::vector features; if (rendererFrontend) { - features = rendererFrontend->querySourceFeatures(source.getID(), + features = rendererFrontend->querySourceFeatures(source->getID(), { {}, toFilter(env, jfilter) }); } return Feature::convert(env, features); @@ -115,7 +115,7 @@ namespace android { if (rendererFrontend) { mbgl::Feature _feature = Feature::convert(env, feature); _feature.properties["cluster_id"] = static_cast(_feature.properties["cluster_id"].get()); - const auto featureExtension = rendererFrontend->queryFeatureExtensions(source.getID(), _feature, "supercluster", "children", {}); + const auto featureExtension = rendererFrontend->queryFeatureExtensions(source->getID(), _feature, "supercluster", "children", {}); if (featureExtension.is()) { return Feature::convert(env, featureExtension.get()); } @@ -132,7 +132,7 @@ namespace android { _feature.properties["cluster_id"] = static_cast(_feature.properties["cluster_id"].get()); const std::map options = { {"limit", static_cast(limit)}, {"offset", static_cast(offset)} }; - auto featureExtension = rendererFrontend->queryFeatureExtensions(source.getID(), _feature, "supercluster", "leaves", options); + auto featureExtension = rendererFrontend->queryFeatureExtensions(source->getID(), _feature, "supercluster", "leaves", options); if (featureExtension.is()) { return Feature::convert(env, featureExtension.get()); } @@ -147,7 +147,7 @@ namespace android { if (rendererFrontend) { mbgl::Feature _feature = Feature::convert(env, feature); _feature.properties["cluster_id"] = static_cast(_feature.properties["cluster_id"].get()); - auto featureExtension = rendererFrontend->queryFeatureExtensions(source.getID(), _feature, "supercluster", "expansion-zoom", {}); + auto featureExtension = rendererFrontend->queryFeatureExtensions(source->getID(), _feature, "supercluster", "expansion-zoom", {}); if (featureExtension.is()) { auto value = featureExtension.get(); if (value.is()) { @@ -186,7 +186,7 @@ namespace android { android::UniqueEnv _env = android::AttachEnv(); // Update the core source - source.as()->GeoJSONSource::setGeoJSON(geoJSON); + source->as()->GeoJSONSource::setGeoJSON(geoJSON); // if there is an awaiting update, execute it, otherwise, release resources if (awaitingUpdate) { diff --git a/platform/android/src/style/sources/image_source.cpp b/platform/android/src/style/sources/image_source.cpp index b42e0e5a51..8550100791 100644 --- a/platform/android/src/style/sources/image_source.cpp +++ b/platform/android/src/style/sources/image_source.cpp @@ -33,20 +33,20 @@ namespace android { void ImageSource::setURL(jni::JNIEnv& env, const jni::String& url) { // Update the core source - source.as()->ImageSource::setURL(jni::Make(env, url)); + source->as()->ImageSource::setURL(jni::Make(env, url)); } jni::Local ImageSource::getURL(jni::JNIEnv& env) { - optional url = source.as()->ImageSource::getURL(); + optional url = source->as()->ImageSource::getURL(); return url ? jni::Make(env, *url) : jni::Local(); } void ImageSource::setImage(jni::JNIEnv& env, const jni::Object& bitmap) { - source.as()->setImage(Bitmap::GetImage(env, bitmap)); + source->as()->setImage(Bitmap::GetImage(env, bitmap)); } void ImageSource::setCoordinates(jni::JNIEnv& env, const jni::Object& coordinatesObject) { - source.as()->setCoordinates( + source->as()->setCoordinates( LatLngQuad::getLatLngArray(env, coordinatesObject)); } diff --git a/platform/android/src/style/sources/raster_dem_source.cpp b/platform/android/src/style/sources/raster_dem_source.cpp index f60526a9b7..e3acaa5c86 100644 --- a/platform/android/src/style/sources/raster_dem_source.cpp +++ b/platform/android/src/style/sources/raster_dem_source.cpp @@ -32,7 +32,7 @@ namespace android { RasterDEMSource::~RasterDEMSource() = default; jni::Local RasterDEMSource::getURL(jni::JNIEnv& env) { - optional url = source.as()->RasterDEMSource::getURL(); + optional url = source->as()->RasterDEMSource::getURL(); return url ? jni::Make(env, *url) : jni::Local(); } diff --git a/platform/android/src/style/sources/raster_source.cpp b/platform/android/src/style/sources/raster_source.cpp index 535f899c99..cd03452189 100644 --- a/platform/android/src/style/sources/raster_source.cpp +++ b/platform/android/src/style/sources/raster_source.cpp @@ -31,7 +31,7 @@ namespace android { RasterSource::~RasterSource() = default; jni::Local RasterSource::getURL(jni::JNIEnv& env) { - optional url = source.as()->RasterSource::getURL(); + optional url = source->as()->RasterSource::getURL(); return url ? jni::Make(env, *url) : jni::Local(); } diff --git a/platform/android/src/style/sources/source.cpp b/platform/android/src/style/sources/source.cpp index e13f55aff1..b1b4f4f76f 100644 --- a/platform/android/src/style/sources/source.cpp +++ b/platform/android/src/style/sources/source.cpp @@ -56,14 +56,14 @@ namespace android { } Source::Source(jni::JNIEnv& env, mbgl::style::Source& coreSource, const jni::Object& obj, AndroidRendererFrontend& frontend) - : source(coreSource) + : source(&coreSource) , javaPeer(jni::NewGlobal(env, obj)) , rendererFrontend(&frontend) { } Source::Source(jni::JNIEnv&, std::unique_ptr coreSource) : ownedSource(std::move(coreSource)) - , source(*ownedSource) { + , source(coreSource.release()) { } Source::~Source() { @@ -85,11 +85,11 @@ namespace android { } jni::Local Source::getId(jni::JNIEnv& env) { - return jni::Make(env, source.getID()); + return jni::Make(env, source->getID()); } jni::Local Source::getAttribution(jni::JNIEnv& env) { - auto attribution = source.getAttribution(); + auto attribution = source->getAttribution(); return attribution ? jni::Make(env, attribution.value()) : jni::Make(env,""); } @@ -103,7 +103,7 @@ namespace android { map.getStyle().addSource(std::move(ownedSource)); // Add peer to core source - source.peer = std::unique_ptr(this); + (*source).peer = std::unique_ptr(this); // Add strong reference to java source javaPeer = jni::NewGlobal(env, obj); @@ -118,7 +118,7 @@ namespace android { } // Remove the source from the map and take ownership - ownedSource = map.getStyle().removeSource(source.getID()); + ownedSource = map.getStyle().removeSource(source->getID()); // The source may not be removed if any layers still reference it return ownedSource != nullptr; diff --git a/platform/android/src/style/sources/source.hpp b/platform/android/src/style/sources/source.hpp index 93b706425a..a010aa8f55 100644 --- a/platform/android/src/style/sources/source.hpp +++ b/platform/android/src/style/sources/source.hpp @@ -48,7 +48,7 @@ protected: std::unique_ptr ownedSource; // Raw pointer that is valid at all times. - mbgl::style::Source& source; + mbgl::style::Source* source; // Set when the source is added to a map. jni::Global> javaPeer; diff --git a/platform/android/src/style/sources/vector_source.cpp b/platform/android/src/style/sources/vector_source.cpp index e46fc1a94e..3b66d171f2 100644 --- a/platform/android/src/style/sources/vector_source.cpp +++ b/platform/android/src/style/sources/vector_source.cpp @@ -39,7 +39,7 @@ namespace android { VectorSource::~VectorSource() = default; jni::Local VectorSource::getURL(jni::JNIEnv& env) { - optional url = source.as()->VectorSource::getURL(); + optional url = source->as()->VectorSource::getURL(); return url ? jni::Make(env, *url) : jni::Local(); } @@ -51,7 +51,7 @@ namespace android { std::vector features; if (rendererFrontend) { - features = rendererFrontend->querySourceFeatures(source.getID(), + features = rendererFrontend->querySourceFeatures(source->getID(), { toVector(env, jSourceLayerIds), toFilter(env, jfilter) }); } return Feature::convert(env, features); -- cgit v1.2.1