From 21a9a67df011e3a556a6510df27580065dd37308 Mon Sep 17 00:00:00 2001 From: tobrun Date: Wed, 30 May 2018 13:28:49 +0200 Subject: [core] [android] - add style json setter/getter to map snapshotter --- platform/default/mbgl/map/map_snapshotter.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'platform/default/mbgl/map/map_snapshotter.cpp') 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); } -- cgit v1.2.1