summaryrefslogtreecommitdiff
path: root/src/mbgl/map/map.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-04-11 13:30:03 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-04-13 10:28:44 -0700
commitf1c06f8d837b57c1b10677fb5317f0bf20987cf6 (patch)
treefe64a8ca383b76318f0ee10c778460f5a879b3ad /src/mbgl/map/map.cpp
parenta2670336d4387782bb607092f3a06814bdf4eb8d (diff)
downloadqtlocation-mapboxgl-f1c06f8d837b57c1b10677fb5317f0bf20987cf6.tar.gz
[all] Remove redundant scale-related camera methods
We don't need to have two different measurement systems for map zoom.
Diffstat (limited to 'src/mbgl/map/map.cpp')
-rw-r--r--src/mbgl/map/map.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 45b2f26568..19b1222f0e 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -532,23 +532,7 @@ void Map::resetPosition(const EdgeInsets& padding) {
}
-#pragma mark - Scale
-
-void Map::scaleBy(double ds, optional<ScreenCoordinate> anchor, const AnimationOptions& animation) {
- impl->cameraMutated = true;
- impl->transform.scaleBy(ds, anchor, animation);
- impl->onUpdate(Update::RecalculateStyle);
-}
-
-void Map::setScale(double scale, optional<ScreenCoordinate> anchor, const AnimationOptions& animation) {
- impl->cameraMutated = true;
- impl->transform.setScale(scale, anchor, animation);
- impl->onUpdate(Update::RecalculateStyle);
-}
-
-double Map::getScale() const {
- return impl->transform.getScale();
-}
+#pragma mark - Zoom
void Map::setZoom(double zoom, const AnimationOptions& animation) {
impl->cameraMutated = true;
@@ -620,7 +604,7 @@ CameraOptions Map::cameraForLatLngs(const std::vector<LatLng>& latLngs, const Ed
scaleY -= (padding.top + padding.bottom) / height;
minScale = util::min(scaleX, scaleY);
}
- double zoom = util::log2(getScale() * minScale);
+ double zoom = getZoom() + util::log2(minScale);
zoom = util::clamp(zoom, getMinZoom(), getMaxZoom());
// Calculate the center point of a virtual bounds that is extended in all directions by padding.