diff --git a/data/hints.json b/data/hints.json index 2dca948f40..38dd3ed56d 100644 --- a/data/hints.json +++ b/data/hints.json @@ -315,6 +315,22 @@ "latitude": 47.6252204 } } + }, + { + "MergeDegenerateIntersection": { + "point": { + "longitude": -122.3020493, + "latitude": 47.6442086 + } + } + }, + { + "MergeDegenerateIntersection": { + "point": { + "longitude": -122.3020349, + "latitude": 47.6447682 + } + } } ] } \ No newline at end of file diff --git a/editor/src/splash_screen.rs b/editor/src/splash_screen.rs index 032ebffe38..2b0032c8d8 100644 --- a/editor/src/splash_screen.rs +++ b/editor/src/splash_screen.rs @@ -67,6 +67,7 @@ impl State for SplashScreen { fn on_suspend(&mut self, _: &mut UI) { self.wizard.reset(); + self.maybe_screensaver = None; } } diff --git a/map_model/src/make/half_map.rs b/map_model/src/make/half_map.rs index eab1b65c53..92ec522be0 100644 --- a/map_model/src/make/half_map.rs +++ b/map_model/src/make/half_map.rs @@ -74,7 +74,7 @@ pub fn make_half_map( let mut road = Road { id: road_id, - osm_tags: raw_r.osm_tags.clone(), + osm_tags: r.osm_tags.clone(), osm_way_id: raw_r.osm_way_id, stable_id: r.id, children_forwards: Vec::new(), diff --git a/map_model/src/make/initial/mod.rs b/map_model/src/make/initial/mod.rs index 000779c43a..cc64c57f34 100644 --- a/map_model/src/make/initial/mod.rs +++ b/map_model/src/make/initial/mod.rs @@ -27,6 +27,8 @@ pub struct Road { pub fwd_width: Distance, pub back_width: Distance, pub lane_specs: Vec, + // Copied here from the raw layer, because merge_degenerate_intersection needs to modify them. + pub osm_tags: BTreeMap, } impl Road { @@ -130,6 +132,7 @@ impl InitialMap { fwd_width, back_width, lane_specs, + osm_tags: r.osm_tags.clone(), }, ); } @@ -224,7 +227,7 @@ impl InitialMap { r.trimmed_center_pts = r.original_center_pts.clone(); } - // And finally the intersection geometry + // Redo the intersection geometry. { let i = self.intersections.get_mut(&new_i1).unwrap(); i.polygon = geometry::intersection_polygon(i, &mut self.roads, timer); @@ -233,6 +236,16 @@ impl InitialMap { let i = self.intersections.get_mut(&new_i2).unwrap(); i.polygon = geometry::intersection_polygon(i, &mut self.roads, timer); } + + // Preserve some OSM tags. + { + let r = self.roads.get_mut(&r2).unwrap(); + for (k, v) in deleted_road.osm_tags { + if !r.osm_tags.contains_key(&k) { + r.osm_tags.insert(k, v); + } + } + } } pub fn apply_hints(&mut self, hints: &Hints, raw: &raw_data::Map, timer: &mut Timer) {