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@mapbox.com>2018-05-30 20:23:57 +0200
commit7193a43729b0826f43275842a1e060e907830520 (patch)
tree737ea88f66a756a8b9240021ef4c8329e98baca2 /platform/default/mbgl/map/map_snapshotter.cpp
parente67f0be81301abce9454c678f677d37d61a03631 (diff)
downloadqtlocation-mapboxgl-7193a43729b0826f43275842a1e060e907830520.tar.gz
[core] [android] - add style json setter/getter to map snapshotter
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);
}