|
|
@@ -28,6 +28,7 @@ pub struct MapViewGl {
|
|
28
|
28
|
ortho_tile_layer: OrthoTileLayer,
|
|
29
|
29
|
atmos_layer: AtmosLayer,
|
|
30
|
30
|
projection: Projection,
|
|
|
31
|
+ show_marker: bool,
|
|
31
|
32
|
show_atmos: bool,
|
|
32
|
33
|
last_draw_type: DrawType,
|
|
33
|
34
|
}
|
|
|
@@ -94,6 +95,7 @@ impl MapViewGl {
|
|
94
|
95
|
ortho_tile_layer,
|
|
95
|
96
|
atmos_layer,
|
|
96
|
97
|
projection: Projection::Mercator,
|
|
|
98
|
+ show_marker: true,
|
|
97
|
99
|
show_atmos: false,
|
|
98
|
100
|
last_draw_type: DrawType::Null,
|
|
99
|
101
|
}
|
|
|
@@ -131,6 +133,10 @@ impl MapViewGl {
|
|
131
|
133
|
};
|
|
132
|
134
|
}
|
|
133
|
135
|
|
|
|
136
|
+ pub fn toggle_marker(&mut self) {
|
|
|
137
|
+ self.show_marker = !self.show_marker;
|
|
|
138
|
+ }
|
|
|
139
|
+
|
|
134
|
140
|
pub fn toggle_atmosphere(&mut self) {
|
|
135
|
141
|
self.show_atmos = !self.show_atmos;
|
|
136
|
142
|
}
|
|
|
@@ -217,14 +223,14 @@ impl MapViewGl {
|
|
217
|
223
|
match self.projection {
|
|
218
|
224
|
Projection::Mercator => {
|
|
219
|
225
|
let ret = self.draw_mercator_tiles(cx, source, snap_to_pixel);
|
|
220
|
|
- if !self.marker_layer.is_empty() {
|
|
|
226
|
+ if self.show_marker && !self.marker_layer.is_empty() {
|
|
221
|
227
|
self.draw_mercator_marker(cx, snap_to_pixel);
|
|
222
|
228
|
}
|
|
223
|
229
|
ret
|
|
224
|
230
|
},
|
|
225
|
231
|
Projection::Orthografic => {
|
|
226
|
232
|
let ret = self.draw_ortho_tiles(cx, source);
|
|
227
|
|
- if !self.marker_layer.is_empty() {
|
|
|
233
|
+ if self.show_marker && !self.marker_layer.is_empty() {
|
|
228
|
234
|
self.draw_ortho_marker(cx);
|
|
229
|
235
|
}
|
|
230
|
236
|
if self.show_atmos {
|