|
|
@@ -8,7 +8,7 @@ pub struct MapView {
|
|
8
|
8
|
pub tile_size: u32,
|
|
9
|
9
|
pub center: MapCoord,
|
|
10
|
10
|
pub zoom2: f64,
|
|
11
|
|
- pub render_zoom_level_offset: f64,
|
|
|
11
|
+ pub tile_zoom_offset: f64,
|
|
12
|
12
|
}
|
|
13
|
13
|
|
|
14
|
14
|
#[derive(Clone, Debug)]
|
|
|
@@ -25,7 +25,7 @@ impl MapView {
|
|
25
|
25
|
tile_size: tile_size,
|
|
26
|
26
|
center: MapCoord::new(0.5, 0.5),
|
|
27
|
27
|
zoom2: 0.0,
|
|
28
|
|
- render_zoom_level_offset: 0.0,
|
|
|
28
|
+ tile_zoom_offset: 0.0,
|
|
29
|
29
|
}
|
|
30
|
30
|
}
|
|
31
|
31
|
|
|
|
@@ -55,7 +55,7 @@ impl MapView {
|
|
55
|
55
|
}
|
|
56
|
56
|
|
|
57
|
57
|
pub fn visible_tiles(&self, snap_to_pixel: bool) -> Vec<VisibleTile> {
|
|
58
|
|
- let uzoom = self.render_zoom_level();
|
|
|
58
|
+ let uzoom = self.tile_zoom();
|
|
59
|
59
|
let top_left_tile = self.top_left_coord().on_tile_at_zoom(uzoom);
|
|
60
|
60
|
let mut top_left_tile_screen_coord = self.tile_screen_position(&top_left_tile);
|
|
61
|
61
|
let tile_screen_size = f64::powf(2.0, self.zoom2 - f64::from(uzoom)) * f64::from(self.tile_size);
|
|
|
@@ -93,16 +93,16 @@ impl MapView {
|
|
93
|
93
|
visible_tiles
|
|
94
|
94
|
}
|
|
95
|
95
|
|
|
96
|
|
- pub fn render_zoom_level(&self) -> u32 {
|
|
97
|
|
- (self.zoom2 + self.render_zoom_level_offset).floor().max(0.0) as u32
|
|
|
96
|
+ pub fn tile_zoom(&self) -> u32 {
|
|
|
97
|
+ (self.zoom2 + self.tile_zoom_offset).floor().max(0.0) as u32
|
|
98
|
98
|
}
|
|
99
|
99
|
|
|
100
|
|
- pub fn render_zoom_level_offset(&self) -> f64 {
|
|
101
|
|
- self.render_zoom_level_offset
|
|
|
100
|
+ pub fn tile_zoom_offset(&self) -> f64 {
|
|
|
101
|
+ self.tile_zoom_offset
|
|
102
|
102
|
}
|
|
103
|
103
|
|
|
104
|
|
- pub fn set_render_zoom_level_offset(&mut self, offset: f64) {
|
|
105
|
|
- self.render_zoom_level_offset = offset;
|
|
|
104
|
+ pub fn set_tile_zoom_offset(&mut self, offset: f64) {
|
|
|
105
|
+ self.tile_zoom_offset = offset;
|
|
106
|
106
|
}
|
|
107
|
107
|
|
|
108
|
108
|
pub fn set_size(&mut self, width: f64, height: f64) {
|