diff options
author | Igor Tarasov <igor.tarasov@mapbox.com> | 2019-09-16 11:52:06 +0300 |
---|---|---|
committer | Igor Tarasov <igor.tarasov@mapbox.com> | 2019-09-16 11:52:06 +0300 |
commit | 2eed5486ffd4986331b8cd78d6181eb6478fb552 (patch) | |
tree | ee18a6883c2eac10b3ac75dc93ea05b941a2c974 | |
parent | 99492ff5e733733cf4bf2bdd210cccf3ab4fc5ab (diff) | |
download | qtlocation-mapboxgl-2eed5486ffd4986331b8cd78d6181eb6478fb552.tar.gz |
[android] Style sources - raw pointer instead of reference for core sources.
First step on the way to use weak pointers.
17 files changed, 57 insertions, 57 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index 7b87693cf5..6f947df050 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -965,7 +965,7 @@ jni::Local<jni::Array<jni::Object<Source>>> NativeMapView::getSources(JNIEnv& en auto jSources = jni::Array<jni::Object<Source>>::New(env, sources.size()); int index = 0; for (auto source : sources) { - jSources.Set(env, index, Source::peerForCoreSource(env, *source, *rendererFrontend)); + jSources.Set(env, index, Source::peerForCoreSource(env, source, *rendererFrontend)); index++; } @@ -981,7 +981,7 @@ jni::Local<jni::Object<Source>> NativeMapView::getSource(JNIEnv& env, const jni: } // Create and return the source's native peer - return jni::NewLocal(env, Source::peerForCoreSource(env, *coreSource, *rendererFrontend)); + return jni::NewLocal(env, Source::peerForCoreSource(env, coreSource, *rendererFrontend)); } void NativeMapView::addSource(JNIEnv& env, const jni::Object<Source>& obj, jlong sourcePtr) { diff --git a/platform/android/src/style/sources/custom_geometry_source.cpp b/platform/android/src/style/sources/custom_geometry_source.cpp index dccca4cf46..8a6d409158 100644 --- a/platform/android/src/style/sources/custom_geometry_source.cpp +++ b/platform/android/src/style/sources/custom_geometry_source.cpp @@ -50,7 +50,7 @@ namespace android { } CustomGeometrySource::CustomGeometrySource(jni::JNIEnv& env, - mbgl::style::Source& coreSource, + mbgl::style::Source* coreSource, AndroidRendererFrontend& frontend) : Source(env, coreSource, createJavaPeer(env), frontend) { } @@ -143,17 +143,17 @@ namespace android { // Update the core source if not cancelled if (!isCancelled(z, x ,y)) { - source.as<mbgl::style::CustomGeometrySource>()->CustomGeometrySource::setTileData(CanonicalTileID(z, x, y), GeoJSON(geometry)); + source->as<mbgl::style::CustomGeometrySource>()->CustomGeometrySource::setTileData(CanonicalTileID(z, x, y), GeoJSON(geometry)); } } void CustomGeometrySource::invalidateTile(jni::JNIEnv&, jni::jint z, jni::jint x, jni::jint y) { - source.as<mbgl::style::CustomGeometrySource>()->CustomGeometrySource::invalidateTile(CanonicalTileID(z, x, y)); + source->as<mbgl::style::CustomGeometrySource>()->CustomGeometrySource::invalidateTile(CanonicalTileID(z, x, y)); } void CustomGeometrySource::invalidateBounds(jni::JNIEnv& env, const jni::Object<LatLngBounds>& jBounds) { auto bounds = LatLngBounds::getLatLngBounds(env, jBounds); - source.as<mbgl::style::CustomGeometrySource>()->CustomGeometrySource::invalidateRegion(bounds); + source->as<mbgl::style::CustomGeometrySource>()->CustomGeometrySource::invalidateRegion(bounds); } jni::Local<jni::Array<jni::Object<geojson::Feature>>> CustomGeometrySource::querySourceFeatures(jni::JNIEnv& env, @@ -163,7 +163,7 @@ namespace android { std::vector<mbgl::Feature> 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/custom_geometry_source.hpp b/platform/android/src/style/sources/custom_geometry_source.hpp index 52e4027dd8..a96601a471 100644 --- a/platform/android/src/style/sources/custom_geometry_source.hpp +++ b/platform/android/src/style/sources/custom_geometry_source.hpp @@ -21,7 +21,7 @@ public: static void registerNative(jni::JNIEnv&); CustomGeometrySource(jni::JNIEnv&, const jni::String&, const jni::Object<>&); - CustomGeometrySource(jni::JNIEnv&, mbgl::style::Source&, AndroidRendererFrontend&); + CustomGeometrySource(jni::JNIEnv&, mbgl::style::Source*, AndroidRendererFrontend&); ~CustomGeometrySource(); bool removeFromMap(JNIEnv&, const jni::Object<Source>&, mbgl::Map&) override; diff --git a/platform/android/src/style/sources/geojson_source.cpp b/platform/android/src/style/sources/geojson_source.cpp index 5ff4864275..40e94efd97 100644 --- a/platform/android/src/style/sources/geojson_source.cpp +++ b/platform/android/src/style/sources/geojson_source.cpp @@ -51,7 +51,7 @@ namespace android { } GeoJSONSource::GeoJSONSource(jni::JNIEnv& env, - mbgl::style::Source& coreSource, + mbgl::style::Source* coreSource, AndroidRendererFrontend& frontend) : Source(env, coreSource, createJavaPeer(env), frontend) , converter(std::make_unique<Actor<FeatureConverter>>(Scheduler::GetBackground())) { @@ -84,11 +84,11 @@ namespace android { void GeoJSONSource::setURL(jni::JNIEnv& env, const jni::String& url) { // Update the core source - source.as<mbgl::style::GeoJSONSource>()->GeoJSONSource::setURL(jni::Make<std::string>(env, url)); + source->as<mbgl::style::GeoJSONSource>()->GeoJSONSource::setURL(jni::Make<std::string>(env, url)); } jni::Local<jni::String> GeoJSONSource::getURL(jni::JNIEnv& env) { - optional<std::string> url = source.as<mbgl::style::GeoJSONSource>()->GeoJSONSource::getURL(); + optional<std::string> url = source->as<mbgl::style::GeoJSONSource>()->GeoJSONSource::getURL(); return url ? jni::Make<jni::String>(env, *url) : jni::Local<jni::String>(); } @@ -99,7 +99,7 @@ namespace android { std::vector<mbgl::Feature> features; if (rendererFrontend) { - features = rendererFrontend->querySourceFeatures(source.getID(), + features = rendererFrontend->querySourceFeatures(source->getID(), { {}, toFilter(env, jfilter) }); } return Feature::convert(env, features); @@ -112,7 +112,7 @@ namespace android { if (rendererFrontend) { mbgl::Feature _feature = Feature::convert(env, feature); _feature.properties["cluster_id"] = static_cast<uint64_t>(_feature.properties["cluster_id"].get<double>()); - const auto featureExtension = rendererFrontend->queryFeatureExtensions(source.getID(), _feature, "supercluster", "children", {}); + const auto featureExtension = rendererFrontend->queryFeatureExtensions(source->getID(), _feature, "supercluster", "children", {}); if (featureExtension.is<mbgl::FeatureCollection>()) { return Feature::convert(env, featureExtension.get<mbgl::FeatureCollection>()); } @@ -129,7 +129,7 @@ namespace android { _feature.properties["cluster_id"] = static_cast<uint64_t>(_feature.properties["cluster_id"].get<double>()); const std::map<std::string, mbgl::Value> options = { {"limit", static_cast<uint64_t>(limit)}, {"offset", static_cast<uint64_t>(offset)} }; - auto featureExtension = rendererFrontend->queryFeatureExtensions(source.getID(), _feature, "supercluster", "leaves", options); + auto featureExtension = rendererFrontend->queryFeatureExtensions(source->getID(), _feature, "supercluster", "leaves", options); if (featureExtension.is<mbgl::FeatureCollection>()) { return Feature::convert(env, featureExtension.get<mbgl::FeatureCollection>()); } @@ -144,7 +144,7 @@ namespace android { if (rendererFrontend) { mbgl::Feature _feature = Feature::convert(env, feature); _feature.properties["cluster_id"] = static_cast<uint64_t>(_feature.properties["cluster_id"].get<double>()); - auto featureExtension = rendererFrontend->queryFeatureExtensions(source.getID(), _feature, "supercluster", "expansion-zoom", {}); + auto featureExtension = rendererFrontend->queryFeatureExtensions(source->getID(), _feature, "supercluster", "expansion-zoom", {}); if (featureExtension.is<mbgl::Value>()) { auto value = featureExtension.get<mbgl::Value>(); if (value.is<uint64_t>()) { @@ -183,7 +183,7 @@ namespace android { android::UniqueEnv _env = android::AttachEnv(); // Update the core source - source.as<mbgl::style::GeoJSONSource>()->GeoJSONSource::setGeoJSON(geoJSON); + source->as<mbgl::style::GeoJSONSource>()->GeoJSONSource::setGeoJSON(geoJSON); // if there is an awaiting update, execute it, otherwise, release resources if (awaitingUpdate) { diff --git a/platform/android/src/style/sources/geojson_source.hpp b/platform/android/src/style/sources/geojson_source.hpp index e737e41924..1e6b6dcb5b 100644 --- a/platform/android/src/style/sources/geojson_source.hpp +++ b/platform/android/src/style/sources/geojson_source.hpp @@ -37,7 +37,7 @@ public: static void registerNative(jni::JNIEnv&); GeoJSONSource(jni::JNIEnv&, const jni::String&, const jni::Object<>&); - GeoJSONSource(jni::JNIEnv&, mbgl::style::Source&, AndroidRendererFrontend&); + GeoJSONSource(jni::JNIEnv&, mbgl::style::Source*, AndroidRendererFrontend&); ~GeoJSONSource(); private: diff --git a/platform/android/src/style/sources/image_source.cpp b/platform/android/src/style/sources/image_source.cpp index b42e0e5a51..0986f74b35 100644 --- a/platform/android/src/style/sources/image_source.cpp +++ b/platform/android/src/style/sources/image_source.cpp @@ -24,7 +24,7 @@ namespace android { } ImageSource::ImageSource(jni::JNIEnv& env, - mbgl::style::Source& coreSource, + mbgl::style::Source* coreSource, AndroidRendererFrontend& frontend) : Source(env, coreSource, createJavaPeer(env), frontend) { } @@ -33,20 +33,20 @@ namespace android { void ImageSource::setURL(jni::JNIEnv& env, const jni::String& url) { // Update the core source - source.as<mbgl::style::ImageSource>()->ImageSource::setURL(jni::Make<std::string>(env, url)); + source->as<mbgl::style::ImageSource>()->ImageSource::setURL(jni::Make<std::string>(env, url)); } jni::Local<jni::String> ImageSource::getURL(jni::JNIEnv& env) { - optional<std::string> url = source.as<mbgl::style::ImageSource>()->ImageSource::getURL(); + optional<std::string> url = source->as<mbgl::style::ImageSource>()->ImageSource::getURL(); return url ? jni::Make<jni::String>(env, *url) : jni::Local<jni::String>(); } void ImageSource::setImage(jni::JNIEnv& env, const jni::Object<Bitmap>& bitmap) { - source.as<mbgl::style::ImageSource>()->setImage(Bitmap::GetImage(env, bitmap)); + source->as<mbgl::style::ImageSource>()->setImage(Bitmap::GetImage(env, bitmap)); } void ImageSource::setCoordinates(jni::JNIEnv& env, const jni::Object<LatLngQuad>& coordinatesObject) { - source.as<mbgl::style::ImageSource>()->setCoordinates( + source->as<mbgl::style::ImageSource>()->setCoordinates( LatLngQuad::getLatLngArray(env, coordinatesObject)); } diff --git a/platform/android/src/style/sources/image_source.hpp b/platform/android/src/style/sources/image_source.hpp index 6c359bf0ee..4cea98e5f8 100644 --- a/platform/android/src/style/sources/image_source.hpp +++ b/platform/android/src/style/sources/image_source.hpp @@ -19,7 +19,7 @@ public: ImageSource(jni::JNIEnv&, const jni::String&, const jni::Object<LatLngQuad>&); - ImageSource(jni::JNIEnv&, mbgl::style::Source&, AndroidRendererFrontend&); + ImageSource(jni::JNIEnv&, mbgl::style::Source*, AndroidRendererFrontend&); ~ImageSource(); diff --git a/platform/android/src/style/sources/raster_dem_source.cpp b/platform/android/src/style/sources/raster_dem_source.cpp index f60526a9b7..dd98925d22 100644 --- a/platform/android/src/style/sources/raster_dem_source.cpp +++ b/platform/android/src/style/sources/raster_dem_source.cpp @@ -24,7 +24,7 @@ namespace android { } RasterDEMSource::RasterDEMSource(jni::JNIEnv& env, - mbgl::style::Source& coreSource, + mbgl::style::Source* coreSource, AndroidRendererFrontend& frontend) : Source(env, coreSource, createJavaPeer(env), frontend) { } @@ -32,7 +32,7 @@ namespace android { RasterDEMSource::~RasterDEMSource() = default; jni::Local<jni::String> RasterDEMSource::getURL(jni::JNIEnv& env) { - optional<std::string> url = source.as<mbgl::style::RasterDEMSource>()->RasterDEMSource::getURL(); + optional<std::string> url = source->as<mbgl::style::RasterDEMSource>()->RasterDEMSource::getURL(); return url ? jni::Make<jni::String>(env, *url) : jni::Local<jni::String>(); } diff --git a/platform/android/src/style/sources/raster_dem_source.hpp b/platform/android/src/style/sources/raster_dem_source.hpp index 0b31c4ecd3..73904687c6 100644 --- a/platform/android/src/style/sources/raster_dem_source.hpp +++ b/platform/android/src/style/sources/raster_dem_source.hpp @@ -15,7 +15,7 @@ public: static void registerNative(jni::JNIEnv&); RasterDEMSource(jni::JNIEnv&, const jni::String&, const jni::Object<>&, jni::jint); - RasterDEMSource(jni::JNIEnv&, mbgl::style::Source&, AndroidRendererFrontend&); + RasterDEMSource(jni::JNIEnv&, mbgl::style::Source*, AndroidRendererFrontend&); ~RasterDEMSource(); jni::Local<jni::String> getURL(jni::JNIEnv&); diff --git a/platform/android/src/style/sources/raster_source.cpp b/platform/android/src/style/sources/raster_source.cpp index 535f899c99..d643b8ac71 100644 --- a/platform/android/src/style/sources/raster_source.cpp +++ b/platform/android/src/style/sources/raster_source.cpp @@ -23,7 +23,7 @@ namespace android { } RasterSource::RasterSource(jni::JNIEnv& env, - mbgl::style::Source& coreSource, + mbgl::style::Source* coreSource, AndroidRendererFrontend& frontend) : Source(env, coreSource, createJavaPeer(env), frontend) { } @@ -31,7 +31,7 @@ namespace android { RasterSource::~RasterSource() = default; jni::Local<jni::String> RasterSource::getURL(jni::JNIEnv& env) { - optional<std::string> url = source.as<mbgl::style::RasterSource>()->RasterSource::getURL(); + optional<std::string> url = source->as<mbgl::style::RasterSource>()->RasterSource::getURL(); return url ? jni::Make<jni::String>(env, *url) : jni::Local<jni::String>(); } diff --git a/platform/android/src/style/sources/raster_source.hpp b/platform/android/src/style/sources/raster_source.hpp index 08648f79aa..7d807b3f07 100644 --- a/platform/android/src/style/sources/raster_source.hpp +++ b/platform/android/src/style/sources/raster_source.hpp @@ -15,7 +15,7 @@ public: static void registerNative(jni::JNIEnv&); RasterSource(jni::JNIEnv&, const jni::String&, const jni::Object<>&, jni::jint); - RasterSource(jni::JNIEnv&, mbgl::style::Source&, AndroidRendererFrontend&); + RasterSource(jni::JNIEnv&, mbgl::style::Source*, AndroidRendererFrontend&); ~RasterSource(); jni::Local<jni::String> getURL(jni::JNIEnv&); diff --git a/platform/android/src/style/sources/source.cpp b/platform/android/src/style/sources/source.cpp index 786e5cb586..6af30f2922 100644 --- a/platform/android/src/style/sources/source.cpp +++ b/platform/android/src/style/sources/source.cpp @@ -34,28 +34,28 @@ namespace mbgl { namespace android { - static std::unique_ptr<Source> createSourcePeer(jni::JNIEnv& env, mbgl::style::Source& coreSource, AndroidRendererFrontend& frontend) { - if (coreSource.is<mbgl::style::VectorSource>()) { - return std::make_unique<VectorSource>(env, *coreSource.as<mbgl::style::VectorSource>(), frontend); - } else if (coreSource.is<mbgl::style::RasterSource>()) { - return std::make_unique<RasterSource>(env, *coreSource.as<mbgl::style::RasterSource>(), frontend); - } else if (coreSource.is<mbgl::style::GeoJSONSource>()) { - return std::make_unique<GeoJSONSource>(env, *coreSource.as<mbgl::style::GeoJSONSource>(), frontend); - } else if (coreSource.is<mbgl::style::ImageSource>()) { - return std::make_unique<ImageSource>(env, *coreSource.as<mbgl::style::ImageSource>(), frontend); + static std::unique_ptr<Source> createSourcePeer(jni::JNIEnv& env, mbgl::style::Source* coreSource, AndroidRendererFrontend& frontend) { + if (coreSource->is<mbgl::style::VectorSource>()) { + return std::make_unique<VectorSource>(env, coreSource->as<mbgl::style::VectorSource>(), frontend); + } else if (coreSource->is<mbgl::style::RasterSource>()) { + return std::make_unique<RasterSource>(env, coreSource->as<mbgl::style::RasterSource>(), frontend); + } else if (coreSource->is<mbgl::style::GeoJSONSource>()) { + return std::make_unique<GeoJSONSource>(env, coreSource->as<mbgl::style::GeoJSONSource>(), frontend); + } else if (coreSource->is<mbgl::style::ImageSource>()) { + return std::make_unique<ImageSource>(env, coreSource->as<mbgl::style::ImageSource>(), frontend); } else { return std::make_unique<UnknownSource>(env, coreSource, frontend); } } - const jni::Object<Source>& Source::peerForCoreSource(jni::JNIEnv& env, mbgl::style::Source& coreSource, AndroidRendererFrontend& frontend) { - if (!coreSource.peer.has_value()) { - coreSource.peer = createSourcePeer(env, coreSource, frontend); + const jni::Object<Source>& Source::peerForCoreSource(jni::JNIEnv& env, mbgl::style::Source* coreSource, AndroidRendererFrontend& frontend) { + if (!coreSource->peer.has_value()) { + coreSource->peer = createSourcePeer(env, coreSource, frontend); } - return coreSource.peer.get<std::unique_ptr<Source>>()->javaPeer; + return coreSource->peer.get<std::unique_ptr<Source>>()->javaPeer; } - Source::Source(jni::JNIEnv& env, mbgl::style::Source& coreSource, const jni::Object<Source>& obj, AndroidRendererFrontend& frontend) + Source::Source(jni::JNIEnv& env, mbgl::style::Source* coreSource, const jni::Object<Source>& obj, AndroidRendererFrontend& frontend) : source(coreSource) , javaPeer(jni::NewGlobal(env, obj)) , rendererFrontend(&frontend) { @@ -63,7 +63,7 @@ namespace android { Source::Source(jni::JNIEnv&, std::unique_ptr<mbgl::style::Source> coreSource) : ownedSource(std::move(coreSource)) - , source(*ownedSource) { + , source(ownedSource.get()) { } Source::~Source() { @@ -85,11 +85,11 @@ namespace android { } jni::Local<jni::String> Source::getId(jni::JNIEnv& env) { - return jni::Make<jni::String>(env, source.getID()); + return jni::Make<jni::String>(env, source->getID()); } jni::Local<jni::String> Source::getAttribution(jni::JNIEnv& env) { - auto attribution = source.getAttribution(); + auto attribution = source->getAttribution(); return attribution ? jni::Make<jni::String>(env, attribution.value()) : jni::Make<jni::String>(env,""); } @@ -103,7 +103,7 @@ namespace android { map.getStyle().addSource(std::move(ownedSource)); // Add peer to core source - source.peer = std::unique_ptr<Source>(this); + source->peer = std::unique_ptr<Source>(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..127de0bb9d 100644 --- a/platform/android/src/style/sources/source.hpp +++ b/platform/android/src/style/sources/source.hpp @@ -19,12 +19,12 @@ public: static void registerNative(jni::JNIEnv&); - static const jni::Object<Source>& peerForCoreSource(jni::JNIEnv&, mbgl::style::Source&, AndroidRendererFrontend&); + static const jni::Object<Source>& peerForCoreSource(jni::JNIEnv&, mbgl::style::Source*, AndroidRendererFrontend&); /* * Called when a Java object is created for a core source that belongs to a map. */ - Source(jni::JNIEnv&, mbgl::style::Source&, const jni::Object<Source>&, AndroidRendererFrontend&); + Source(jni::JNIEnv&, mbgl::style::Source*, const jni::Object<Source>&, AndroidRendererFrontend&); /* * Called when a Java object is created for a new core source that does not belong to a map. @@ -48,7 +48,7 @@ protected: std::unique_ptr<mbgl::style::Source> 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<jni::Object<Source>> javaPeer; diff --git a/platform/android/src/style/sources/unknown_source.cpp b/platform/android/src/style/sources/unknown_source.cpp index b5285a5f9f..76718acaf4 100644 --- a/platform/android/src/style/sources/unknown_source.cpp +++ b/platform/android/src/style/sources/unknown_source.cpp @@ -13,7 +13,7 @@ namespace mbgl { namespace android { UnknownSource::UnknownSource(jni::JNIEnv& env, - mbgl::style::Source& coreSource, + mbgl::style::Source* coreSource, AndroidRendererFrontend& frontend) : Source(env, coreSource, createJavaPeer(env), frontend) { } diff --git a/platform/android/src/style/sources/unknown_source.hpp b/platform/android/src/style/sources/unknown_source.hpp index f042e2042c..81870f9410 100644 --- a/platform/android/src/style/sources/unknown_source.hpp +++ b/platform/android/src/style/sources/unknown_source.hpp @@ -14,7 +14,7 @@ public: static void registerNative(jni::JNIEnv&); - UnknownSource(jni::JNIEnv&, mbgl::style::Source&, AndroidRendererFrontend&); + UnknownSource(jni::JNIEnv&, mbgl::style::Source*, AndroidRendererFrontend&); ~UnknownSource() = default; diff --git a/platform/android/src/style/sources/vector_source.cpp b/platform/android/src/style/sources/vector_source.cpp index e46fc1a94e..04952c456e 100644 --- a/platform/android/src/style/sources/vector_source.cpp +++ b/platform/android/src/style/sources/vector_source.cpp @@ -31,7 +31,7 @@ namespace android { } VectorSource::VectorSource(jni::JNIEnv& env, - mbgl::style::Source& coreSource, + mbgl::style::Source* coreSource, AndroidRendererFrontend& frontend) : Source(env, coreSource, createJavaPeer(env), frontend) { } @@ -39,7 +39,7 @@ namespace android { VectorSource::~VectorSource() = default; jni::Local<jni::String> VectorSource::getURL(jni::JNIEnv& env) { - optional<std::string> url = source.as<mbgl::style::VectorSource>()->VectorSource::getURL(); + optional<std::string> url = source->as<mbgl::style::VectorSource>()->VectorSource::getURL(); return url ? jni::Make<jni::String>(env, *url) : jni::Local<jni::String>(); } @@ -51,7 +51,7 @@ namespace android { std::vector<mbgl::Feature> features; if (rendererFrontend) { - features = rendererFrontend->querySourceFeatures(source.getID(), + features = rendererFrontend->querySourceFeatures(source->getID(), { toVector(env, jSourceLayerIds), toFilter(env, jfilter) }); } return Feature::convert(env, features); diff --git a/platform/android/src/style/sources/vector_source.hpp b/platform/android/src/style/sources/vector_source.hpp index 4cb46c6c62..f71e888fb4 100644 --- a/platform/android/src/style/sources/vector_source.hpp +++ b/platform/android/src/style/sources/vector_source.hpp @@ -16,7 +16,7 @@ public: static void registerNative(jni::JNIEnv&); VectorSource(jni::JNIEnv&, const jni::String&, const jni::Object<>&); - VectorSource(jni::JNIEnv&, mbgl::style::Source&, AndroidRendererFrontend&); + VectorSource(jni::JNIEnv&, mbgl::style::Source*, AndroidRendererFrontend&); ~VectorSource(); private: |