diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2015-02-16 09:52:36 -0800 |
---|---|---|
committer | Justin R. Miller <incanus@codesorcery.net> | 2015-02-16 09:52:36 -0800 |
commit | 6e41664cb033ee5edf6ae5ac66ed518d9f0d1f89 (patch) | |
tree | a70192b174ea6dc69b1fa0b13f9a33358a9110e5 /src/mbgl/map/map.cpp | |
parent | ea31ad99a56f1e0afbcc7862ddc62dffd16bc5bb (diff) | |
download | qtlocation-mapboxgl-6e41664cb033ee5edf6ae5ac66ed518d9f0d1f89.tar.gz |
fixes #476 & #853: pixel/meter/latlng conversion routines in core & iOS
Diffstat (limited to 'src/mbgl/map/map.cpp')
-rw-r--r-- | src/mbgl/map/map.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 5aff7a2b78..ed20ec24a6 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -407,15 +407,11 @@ void Map::moveBy(double dx, double dy, std::chrono::steady_clock::duration durat update(); } -void Map::setLonLat(double lon, double lat, std::chrono::steady_clock::duration duration) { - transform.setLonLat(lon, lat, duration); +void Map::setLatLng(LatLng latLng, std::chrono::steady_clock::duration duration) { + transform.setLatLng(latLng, duration); update(); } -void Map::getLonLat(double& lon, double& lat) const { - transform.getLonLat(lon, lat); -} - void Map::startPanning() { transform.startPanning(); update(); @@ -428,7 +424,7 @@ void Map::stopPanning() { void Map::resetPosition() { transform.setAngle(0); - transform.setLonLat(0, 0); + transform.setLatLng(LatLng(0, 0)); transform.setZoom(0); update(); } @@ -459,15 +455,11 @@ double Map::getZoom() const { return transform.getZoom(); } -void Map::setLonLatZoom(double lon, double lat, double zoom, std::chrono::steady_clock::duration duration) { - transform.setLonLatZoom(lon, lat, zoom, duration); +void Map::setLatLngZoom(LatLng latLng, double zoom, std::chrono::steady_clock::duration duration) { + transform.setLatLngZoom(latLng, zoom, duration); update(); } -void Map::getLonLatZoom(double& lon, double& lat, double& zoom) const { - transform.getLonLatZoom(lon, lat, zoom); -} - void Map::resetZoom() { setZoom(0); } @@ -697,7 +689,7 @@ void Map::prepare() { void Map::render() { assert(painter); painter->render(*style, activeSources, - state, animationTime); + state, animationTime); // Schedule another rerender when we definitely need a next frame. if (transform.needsTransition() || style->hasTransitions()) { update(); |