summaryrefslogtreecommitdiff
path: root/platform/default/mbgl/map/map_snapshotter.cpp
diff options
context:
space:
mode:
authortobrun <tobrun.van.nuland@gmail.com>2018-05-30 13:28:49 +0200
committertobrun <tobrun.van.nuland@gmail.com>2018-05-30 13:28:49 +0200
commit21a9a67df011e3a556a6510df27580065dd37308 (patch)
tree4a2f33ef81425d76ed71f83c65c1579752259d1b /platform/default/mbgl/map/map_snapshotter.cpp
parent83ebd5f6ff56fddd4a2923f6c082977476cddd99 (diff)
downloadqtlocation-mapboxgl-21a9a67df011e3a556a6510df27580065dd37308.tar.gz
[core] [android] - add style json setter/getter to map snapshotterupstream/tvn-style-json-setter
Diffstat (limited to 'platform/default/mbgl/map/map_snapshotter.cpp')
-rw-r--r--platform/default/mbgl/map/map_snapshotter.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/default/mbgl/map/map_snapshotter.cpp b/platform/default/mbgl/map/map_snapshotter.cpp
index da3a250e0f..39f96d7210 100644
--- a/platform/default/mbgl/map/map_snapshotter.cpp
+++ b/platform/default/mbgl/map/map_snapshotter.cpp
@@ -25,6 +25,9 @@ public:
void setStyleURL(std::string styleURL);
std::string getStyleURL() const;
+ void setStyleJSON(std::string styleJSON);
+ std::string getStyleJSON() const;
+
void setSize(Size);
Size getSize() const;
@@ -107,6 +110,14 @@ std::string MapSnapshotter::Impl::getStyleURL() const {
return map.getStyle().getURL();
}
+void MapSnapshotter::Impl::setStyleJSON(std::string styleJSON) {
+ map.getStyle().loadJSON(styleJSON);
+}
+
+std::string MapSnapshotter::Impl::getStyleJSON() const {
+ return map.getStyle().getJSON();
+}
+
void MapSnapshotter::Impl::setSize(Size size) {
map.setSize(size);
frontend.setSize(size);
@@ -160,6 +171,14 @@ std::string MapSnapshotter::getStyleURL() const {
return impl->actor().ask(&Impl::getStyleURL).get();
}
+void MapSnapshotter::setStyleJSON(const std::string& styleJSON) {
+ impl->actor().invoke(&Impl::setStyleJSON, styleJSON);
+}
+
+std::string MapSnapshotter::getStyleJSON() const {
+ return impl->actor().ask(&Impl::getStyleJSON).get();
+}
+
void MapSnapshotter::setSize(const Size& size) {
impl->actor().invoke(&Impl::setSize, size);
}