|
|
@@ -1,14 +1,15 @@
|
|
1
|
1
|
use context::Context;
|
|
2
|
2
|
use coord::{MapCoord, ScreenCoord};
|
|
3
|
|
-use ortho_tile_layer::OrthoTileLayer;
|
|
4
|
3
|
use map_view::MapView;
|
|
5
|
4
|
use marker_layer::MarkerLayer;
|
|
|
5
|
+use mercator_tile_layer::MercatorTileLayer;
|
|
6
|
6
|
use mercator_view::MercatorView;
|
|
|
7
|
+use ortho_tile_layer::OrthoTileLayer;
|
|
|
8
|
+use projection::Projection;
|
|
7
|
9
|
use session::Session;
|
|
8
|
10
|
use texture::{Texture, TextureFormat};
|
|
9
|
11
|
use tile_atlas::TileAtlas;
|
|
10
|
12
|
use tile_cache::TileCache;
|
|
11
|
|
-use mercator_tile_layer::MercatorTileLayer;
|
|
12
|
13
|
use tile_source::TileSource;
|
|
13
|
14
|
|
|
14
|
15
|
|
|
|
@@ -30,14 +31,6 @@ pub struct MapViewGl {
|
|
30
|
31
|
last_draw_type: DrawType,
|
|
31
|
32
|
}
|
|
32
|
33
|
|
|
33
|
|
-#[derive(Debug, Eq, PartialEq)]
|
|
34
|
|
-enum Projection {
|
|
35
|
|
- // EPSG:3857: WGS 84 / Pseudo-Mercator
|
|
36
|
|
- Mercator,
|
|
37
|
|
- // Orthographic projection, WGS 84 coordinates mapped to the sphere
|
|
38
|
|
- Orthografic,
|
|
39
|
|
-}
|
|
40
|
|
-
|
|
41
|
34
|
#[derive(Debug, Eq, PartialEq)]
|
|
42
|
35
|
enum DrawType {
|
|
43
|
36
|
Null,
|
|
|
@@ -262,6 +255,7 @@ impl MapViewGl {
|
|
262
|
255
|
self.map_view.center = session.view_center;
|
|
263
|
256
|
self.map_view.center.normalize_xy();
|
|
264
|
257
|
self.map_view.zoom = MIN_ZOOM_LEVEL.max(MAX_ZOOM_LEVEL.min(session.zoom));
|
|
|
258
|
+ self.projection = session.projection;
|
|
265
|
259
|
}
|
|
266
|
260
|
|
|
267
|
261
|
pub fn to_session(&self) -> Session {
|
|
|
@@ -269,6 +263,7 @@ impl MapViewGl {
|
|
269
|
263
|
view_center: self.map_view.center,
|
|
270
|
264
|
zoom: self.map_view.zoom,
|
|
271
|
265
|
tile_source: None,
|
|
|
266
|
+ projection: self.projection,
|
|
272
|
267
|
}
|
|
273
|
268
|
}
|
|
274
|
269
|
}
|