summaryrefslogtreecommitdiff
path: root/platform/android/src/style/layers/circle_layer.cpp
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-02-28 02:45:13 +0200
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-02-28 09:33:04 -0800
commit609cdb0fd7b569dade2c3148f21024f280636154 (patch)
tree3e18523f629ed299ed9f6f84e8c4129e6d99fdd2 /platform/android/src/style/layers/circle_layer.cpp
parentf0de56cffae4922db80c74f751f14ac3ed572b31 (diff)
downloadqtlocation-mapboxgl-609cdb0fd7b569dade2c3148f21024f280636154.tar.gz
[android] fix ownership of style layer after delete
Diffstat (limited to 'platform/android/src/style/layers/circle_layer.cpp')
-rw-r--r--platform/android/src/style/layers/circle_layer.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/platform/android/src/style/layers/circle_layer.cpp b/platform/android/src/style/layers/circle_layer.cpp
index 2b33a2dd47..948c397829 100644
--- a/platform/android/src/style/layers/circle_layer.cpp
+++ b/platform/android/src/style/layers/circle_layer.cpp
@@ -9,14 +9,27 @@
namespace mbgl {
namespace android {
+ /**
+ * Creates an owning peer object (for layers not attached to the map) from the JVM side
+ */
CircleLayer::CircleLayer(jni::JNIEnv& env, jni::String layerId, jni::String sourceId)
: Layer(env, std::make_unique<mbgl::style::CircleLayer>(jni::Make<std::string>(env, layerId), jni::Make<std::string>(env, sourceId))) {
}
+ /**
+ * Creates a non-owning peer object (for layers currently attached to the map)
+ */
CircleLayer::CircleLayer(mbgl::Map& map, mbgl::style::CircleLayer& coreLayer)
: Layer(map, coreLayer) {
}
+ /**
+ * Creates an owning peer object (for layers not attached to the map)
+ */
+ CircleLayer::CircleLayer(mbgl::Map& map, std::unique_ptr<mbgl::style::CircleLayer> coreLayer)
+ : Layer(map, std::move(coreLayer)) {
+ }
+
CircleLayer::~CircleLayer() = default;
// Property getters