summaryrefslogtreecommitdiff
path: root/src/mbgl/style
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style')
-rw-r--r--src/mbgl/style/style.cpp16
-rw-r--r--src/mbgl/style/style_impl.cpp25
-rw-r--r--src/mbgl/style/style_impl.hpp12
3 files changed, 13 insertions, 40 deletions
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index 5fe1ab4a06..bd8631fc52 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -34,20 +34,8 @@ std::string Style::getName() const {
return impl->getName();
}
-LatLng Style::getDefaultLatLng() const {
- return impl->getDefaultLatLng();
-}
-
-double Style::getDefaultZoom() const {
- return impl->getDefaultZoom();
-}
-
-double Style::getDefaultBearing() const {
- return impl->getDefaultBearing();
-}
-
-double Style::getDefaultPitch() const {
- return impl->getDefaultPitch();
+CameraOptions Style::getDefaultCamera() const {
+ return impl->getDefaultCamera();
}
TransitionOptions Style::getTransitionOptions() const {
diff --git a/src/mbgl/style/style_impl.cpp b/src/mbgl/style/style_impl.cpp
index 604af4be20..0fb49d1d22 100644
--- a/src/mbgl/style/style_impl.cpp
+++ b/src/mbgl/style/style_impl.cpp
@@ -107,10 +107,11 @@ void Style::Impl::parse(const std::string& json_) {
}
name = parser.name;
- defaultLatLng = parser.latLng;
- defaultZoom = parser.zoom;
- defaultBearing = parser.bearing;
- defaultPitch = parser.pitch;
+ defaultCamera.center = parser.latLng;
+ defaultCamera.zoom = parser.zoom;
+ defaultCamera.angle = parser.bearing;
+ defaultCamera.pitch = parser.pitch;
+
setLight(std::make_unique<Light>(parser.light));
spriteLoaded = false;
@@ -232,20 +233,8 @@ std::string Style::Impl::getName() const {
return name;
}
-LatLng Style::Impl::getDefaultLatLng() const {
- return defaultLatLng;
-}
-
-double Style::Impl::getDefaultZoom() const {
- return defaultZoom;
-}
-
-double Style::Impl::getDefaultBearing() const {
- return defaultBearing;
-}
-
-double Style::Impl::getDefaultPitch() const {
- return defaultPitch;
+CameraOptions Style::Impl::getDefaultCamera() const {
+ return defaultCamera;
}
std::vector<Source*> Style::Impl::getSources() {
diff --git a/src/mbgl/style/style_impl.hpp b/src/mbgl/style/style_impl.hpp
index 76f244d5a4..3dc222bfad 100644
--- a/src/mbgl/style/style_impl.hpp
+++ b/src/mbgl/style/style_impl.hpp
@@ -12,6 +12,8 @@
#include <mbgl/style/layer.hpp>
#include <mbgl/style/collection.hpp>
+#include <mbgl/map/camera.hpp>
+
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/optional.hpp>
#include <mbgl/util/geo.hpp>
@@ -69,10 +71,7 @@ public:
std::unique_ptr<Layer> removeLayer(const std::string& layerID);
std::string getName() const;
- LatLng getDefaultLatLng() const;
- double getDefaultZoom() const;
- double getDefaultBearing() const;
- double getDefaultPitch() const;
+ CameraOptions getDefaultCamera() const;
TransitionOptions getTransitionOptions() const;
void setTransitionOptions(const TransitionOptions&);
@@ -117,10 +116,7 @@ private:
// Defaults
std::string name;
- LatLng defaultLatLng;
- double defaultZoom = 0;
- double defaultBearing = 0;
- double defaultPitch = 0;
+ CameraOptions defaultCamera;
// SpriteLoaderObserver implementation.
void onSpriteLoaded(std::vector<std::unique_ptr<Image>>&&) override;