Skip to content

Commit

Permalink
osm field is not removed
Browse files Browse the repository at this point in the history
  • Loading branch information
podusowski committed Jul 5, 2023
1 parent 4c2e24f commit 4aa33a4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ All notable changes to this project will be documented in this file.

### Breaking

* `Map::new`'s `tiles` parameter is now `Option`.
* `Tiles::new()` has now two parameters. First, called `source`, being a function transforming
`TileId` into an URL of a tile provider. This means that it's now possible to specify other
servers. `openstreeetmap` is a builtin function returning OSM's URL.
* `MapMemory` no longer has `osm` member. Instead, `Map::new`'s `tiles` parameter is now `Option`.

### Fixed

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ struct Osm {

impl Osm {
fn new(egui_ctx: Context) -> Self {
let mut map_memory = MapMemory::default();
map_memory.osm = true; // It's false by default.
Self {
tiles: Tiles::new(egui_ctx),
map_memory,
map_memory: MapMemory::default(),
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions examples/osm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ struct Osm {

impl Osm {
fn new(egui_ctx: Context) -> Self {
let mut map_memory = MapMemory::default();
map_memory.osm = true;
Self {
tiles: Tiles::new(walkers::openstreetmap, egui_ctx),
map_memory,
map_memory: MapMemory::default(),
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ impl MapCenterMode {
/// State of the map widget which must persist between frames.
pub struct MapMemory {
pub center_mode: MapCenterMode,
pub osm: bool,
pub zoom: Zoom,
}

impl Default for MapMemory {
fn default() -> Self {
Self {
center_mode: MapCenterMode::MyPosition,
osm: false,
zoom: Default::default(),
}
}
Expand Down

0 comments on commit 4aa33a4

Please sign in to comment.