Skip to content

Commit 729f360

Browse files
committed
refactor: Remove crs from tile schema
1 parent 8894c4f commit 729f360

3 files changed

Lines changed: 0 additions & 16 deletions

File tree

galileo/examples/vector_tiles.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use galileo::tile_schema::{TileIndex, TileSchema, VerticalDirection};
1414
use galileo::{Map, MapBuilder};
1515
use galileo_egui::{EguiMap, EguiMapState};
1616
use galileo_types::cartesian::{Point2, Rect};
17-
use galileo_types::geo::Crs;
1817
use parking_lot::RwLock;
1918

2019
#[cfg(not(target_arch = "wasm32"))]
@@ -177,6 +176,5 @@ fn tile_schema() -> TileSchema {
177176
tile_width: 1024,
178177
tile_height: 1024,
179178
y_direction: VerticalDirection::TopToBottom,
180-
crs: Crs::EPSG3857,
181179
}
182180
}

galileo/examples/vector_tiles_labels.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use galileo::render::text::{FontWeight, RustybuzzRasterizer, TextStyle};
1010
use galileo::tile_schema::{TileIndex, TileSchema, VerticalDirection};
1111
use galileo::{Color, MapBuilder};
1212
use galileo_types::cartesian::{Point2, Rect};
13-
use galileo_types::geo::Crs;
1413

1514
#[cfg(not(target_arch = "wasm32"))]
1615
fn main() {
@@ -118,6 +117,5 @@ fn tile_schema() -> TileSchema {
118117
tile_width: 1024,
119118
tile_height: 1024,
120119
y_direction: VerticalDirection::TopToBottom,
121-
crs: Crs::EPSG3857,
122120
}
123121
}

galileo/src/tile_schema.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
//! [`TileSchema`] is used by tile layers to calculate [tile indices](TileIndex) needed for a given ['MapView'].
22
33
use galileo_types::cartesian::{CartesianPoint2d, Point2, Rect};
4-
use galileo_types::geo::Crs;
5-
#[cfg(target_arch = "wasm32")]
6-
use js_sys::wasm_bindgen::prelude::wasm_bindgen;
74
use serde::{Deserialize, Serialize};
85

96
use crate::lod::Lod;
@@ -23,7 +20,6 @@ pub enum VerticalDirection {
2320
/// Tile index with additional virtual `display_x` index that can be used to wrap tiles
2421
/// over 180 longitude line.
2522
#[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, Serialize, Deserialize)]
26-
#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
2723
pub struct WrappingTileIndex {
2824
/// Z index.
2925
pub z: u32,
@@ -100,8 +96,6 @@ pub struct TileSchema {
10096
pub tile_height: u32,
10197
/// Direction of the Y-axis.
10298
pub y_direction: VerticalDirection,
103-
/// Crs of the scheme.
104-
pub crs: Crs,
10599
}
106100

107101
impl TileSchema {
@@ -151,10 +145,6 @@ impl TileSchema {
151145

152146
/// Iterate over tile indices that should be displayed for the given map view.
153147
pub fn iter_tiles(&self, view: &MapView) -> Option<impl Iterator<Item = WrappingTileIndex>> {
154-
if *view.crs() != self.crs {
155-
return None;
156-
}
157-
158148
let resolution = view.resolution();
159149
let bounding_box = view.get_bbox()?;
160150
self.iter_tiles_over_bbox(resolution, bounding_box)
@@ -244,7 +234,6 @@ impl TileSchema {
244234
tile_width: 256,
245235
tile_height: 256,
246236
y_direction: VerticalDirection::TopToBottom,
247-
crs: Crs::EPSG3857,
248237
}
249238
}
250239

@@ -349,7 +338,6 @@ mod tests {
349338
tile_width: 256,
350339
tile_height: 256,
351340
y_direction: VerticalDirection::BottomToTop,
352-
crs: Crs::EPSG3857,
353341
}
354342
}
355343

0 commit comments

Comments
 (0)