diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-29 15:21:32 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-10 15:40:20 -0800 |
commit | 7d6c6c00cac53a3864f0dfd399e64fd862d017e1 (patch) | |
tree | 0cbd724297db689cf07c79123b9a19e17c856e62 /src/mbgl/util/tile_coordinate.hpp | |
parent | f52b6105db22aeafab0737ba2202d79ca60896f7 (diff) | |
download | qtlocation-mapboxgl-7d6c6c00cac53a3864f0dfd399e64fd862d017e1.tar.gz |
[core] Refactor tileCover
Diffstat (limited to 'src/mbgl/util/tile_coordinate.hpp')
-rw-r--r-- | src/mbgl/util/tile_coordinate.hpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/mbgl/util/tile_coordinate.hpp b/src/mbgl/util/tile_coordinate.hpp index 4710e08d0a..a989bef0c9 100644 --- a/src/mbgl/util/tile_coordinate.hpp +++ b/src/mbgl/util/tile_coordinate.hpp @@ -5,23 +5,11 @@ namespace mbgl { -struct TileCoordinate { +class TileCoordinate { +public: double column; double row; double zoom; - - TileCoordinate(double column_, double row_, double zoom_) : - column(column_), row(row_), zoom(zoom_) {} - - TileCoordinate zoomTo(double targetZoom) { - double scale = std::pow(2, targetZoom - zoom); - return { column * scale, row * scale, targetZoom }; - } - - TileCoordinate operator-(TileCoordinate c) { - c = c.zoomTo(zoom); - return { column - c.column, row - c.row, zoom }; - }; }; } // namespace mbgl |