mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 01:15:12 +03:00
Continue simplifying the LTN basemap:
- map border intersections - parking lots - traffic signals
This commit is contained in:
parent
89184a3306
commit
40e36023c5
@ -66,6 +66,7 @@ fn run(mut settings: Settings) {
|
||||
opts.show_stop_signs = false;
|
||||
opts.show_crosswalks = false;
|
||||
opts.show_traffic_signal_icon = true;
|
||||
opts.simplify_basemap = true;
|
||||
|
||||
let args = Args::from_iter(abstutil::cli_args());
|
||||
args.app_args.override_options(&mut opts);
|
||||
|
@ -2,7 +2,7 @@
|
||||
<defs/>
|
||||
<path id="rect32" fill="#000000" stroke="none" d="M 0 -0 L 9.9921875 -0 L 9.9921875 18 L 0 18 Z"/>
|
||||
<path id="path2" fill="none" stroke="none" visibility="hidden" d="M -7 -3 L 17 -3 L 17 21 L -7 21 Z"/>
|
||||
<path id="path14" fill="#ff0000" stroke="none" d="M 4.532531 5.9254498 C 3.916537 5.7763328 3.356733 5.2722672 3.13676 4.6686522 C 3.028041 4.3703225 3.003785 3.7724064 3.088498 3.4789584 C 3.184868 3.1451339 3.357583 2.8556656 3.614474 2.5974344 C 4.219799 1.9889524 5.154898 1.850116 5.929548 2.2537098 C 6.228998 2.4097239 6.617676 2.8087687 6.767194 3.1136983 C 7.056218 3.7031386 7.056749 4.2634631 6.768894 4.8632151 C 6.368587 5.6971393 5.430371 6.1427844 4.532574 5.9254498 Z"/>
|
||||
<path id="path20" fill="#ffff00" stroke="none" d="M 4.665561 10.964186 C 3.607238 10.786831 2.8681283 9.766823 3.03079 8.70812 C 3.06489 8.486208 3.1089 8.345599 3.209304 8.137808 C 3.485438 7.56635 4.004879 7.165081 4.628504 7.041473 C 4.818239 7.003863 5.187645 7.003963 5.367174 7.041661 C 5.786025 7.129621 6.10537 7.301261 6.399908 7.596735 C 6.645595 7.843204 6.783897 8.065672 6.891683 8.387787 C 7.274678 9.532351 6.519603 10.770834 5.320299 10.965189 C 5.139881 10.994429 4.843307 10.993969 4.665561 10.964189 Z"/>
|
||||
<path id="path22" fill="#00ff00" stroke="none" d="M 4.665561 15.964186 C 3.607238 15.786831 2.8681283 14.766823 3.03079 13.70812 C 3.06489 13.486208 3.1089 13.345599 3.209304 13.137808 C 3.485438 12.56635 4.004879 12.165081 4.628504 12.041473 C 4.818239 12.003863 5.187645 12.003963 5.367174 12.041661 C 5.786025 12.129621 6.10537 12.301261 6.399908 12.596735 C 6.645595 12.843204 6.783897 13.065672 6.891683 13.387787 C 7.274678 14.532351 6.519603 15.770834 5.320299 15.965189 C 5.139881 15.994429 4.843307 15.993969 4.665561 15.964189 Z"/>
|
||||
<path id="path14" fill="#727272" stroke="none" d="M 4.532531 5.9254498 C 3.916537 5.7763328 3.356733 5.2722672 3.13676 4.6686522 C 3.028041 4.3703225 3.003785 3.7724064 3.088498 3.4789584 C 3.184868 3.1451339 3.357583 2.8556656 3.614474 2.5974344 C 4.219799 1.9889524 5.154898 1.850116 5.929548 2.2537098 C 6.228998 2.4097239 6.617676 2.8087687 6.767194 3.1136983 C 7.056218 3.7031386 7.056749 4.2634631 6.768894 4.8632151 C 6.368587 5.6971393 5.430371 6.1427844 4.532574 5.9254498 Z"/>
|
||||
<path id="path20" fill="#BDBDBD" stroke="none" d="M 4.665561 10.964186 C 3.607238 10.786831 2.8681283 9.766823 3.03079 8.70812 C 3.06489 8.486208 3.1089 8.345599 3.209304 8.137808 C 3.485438 7.56635 4.004879 7.165081 4.628504 7.041473 C 4.818239 7.003863 5.187645 7.003963 5.367174 7.041661 C 5.786025 7.129621 6.10537 7.301261 6.399908 7.596735 C 6.645595 7.843204 6.783897 8.065672 6.891683 8.387787 C 7.274678 9.532351 6.519603 10.770834 5.320299 10.965189 C 5.139881 10.994429 4.843307 10.993969 4.665561 10.964189 Z"/>
|
||||
<path id="path22" fill="#979797" stroke="none" d="M 4.665561 15.964186 C 3.607238 15.786831 2.8681283 14.766823 3.03079 13.70812 C 3.06489 13.486208 3.1089 13.345599 3.209304 13.137808 C 3.485438 12.56635 4.004879 12.165081 4.628504 12.041473 C 4.818239 12.003863 5.187645 12.003963 5.367174 12.041661 C 5.786025 12.129621 6.10537 12.301261 6.399908 12.596735 C 6.645595 12.843204 6.783897 13.065672 6.891683 13.387787 C 7.274678 14.532351 6.519603 15.770834 5.320299 15.965189 C 5.139881 15.994429 4.843307 15.993969 4.665561 15.964189 Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@ -370,6 +370,7 @@ impl ColorScheme {
|
||||
cs.map_background = hex("#F6F6F4").into();
|
||||
cs.residential_building = hex("#E9E9E7");
|
||||
cs.commercial_building = hex("#D1D1CC");
|
||||
cs.parking_lot = cs.commercial_building;
|
||||
cs.water = hex("#CAD2D3").into();
|
||||
cs.grass = hex("#ECEEED").into();
|
||||
cs.unzoomed_highway = Color::WHITE;
|
||||
|
@ -41,6 +41,8 @@ pub struct Options {
|
||||
/// If true, draw an icon for traffic signals both when zoomed and unzoomed. If false, color
|
||||
/// the intersection when unzoomed and render the signal's current state when zoomed.
|
||||
pub show_traffic_signal_icon: bool,
|
||||
/// If true, modify several basemap features to de-emphasize them: border intersections
|
||||
pub simplify_basemap: bool,
|
||||
|
||||
/// When making a screen recording, enable this option to hide some UI elements
|
||||
pub minimal_controls: bool,
|
||||
@ -89,6 +91,7 @@ impl Options {
|
||||
show_stop_signs: true,
|
||||
show_crosswalks: true,
|
||||
show_traffic_signal_icon: false,
|
||||
simplify_basemap: false,
|
||||
|
||||
time_increment: Duration::minutes(10),
|
||||
dont_draw_time_warp: false,
|
||||
|
@ -101,6 +101,7 @@ impl DrawMap {
|
||||
ctx,
|
||||
pl,
|
||||
cs,
|
||||
opts,
|
||||
&mut all_unzoomed_parking_lots,
|
||||
));
|
||||
}
|
||||
@ -247,21 +248,23 @@ impl DrawMap {
|
||||
|
||||
for i in map.all_intersections() {
|
||||
let zorder = 10 * i.get_zorder(map);
|
||||
let intersection_color =
|
||||
if i.is_stop_sign() || (i.is_traffic_signal() && opts.show_traffic_signal_icon) {
|
||||
// Use the color of the road, so the intersection doesn't stand out
|
||||
if i.is_light_rail(map) {
|
||||
cs.light_rail_track
|
||||
} else if i.is_cycleway(map) {
|
||||
cs.unzoomed_trail
|
||||
} else if i.is_private(map) && cs.private_road.is_some() {
|
||||
cs.private_road.unwrap()
|
||||
} else {
|
||||
cs.unzoomed_road_surface(i.get_rank(map))
|
||||
}
|
||||
let intersection_color = if opts.simplify_basemap
|
||||
|| i.is_stop_sign()
|
||||
|| (i.is_traffic_signal() && opts.show_traffic_signal_icon)
|
||||
{
|
||||
// Use the color of the road, so the intersection doesn't stand out
|
||||
if i.is_light_rail(map) {
|
||||
cs.light_rail_track
|
||||
} else if i.is_cycleway(map) {
|
||||
cs.unzoomed_trail
|
||||
} else if i.is_private(map) && cs.private_road.is_some() {
|
||||
cs.private_road.unwrap()
|
||||
} else {
|
||||
cs.unzoomed_interesting_intersection
|
||||
};
|
||||
cs.unzoomed_road_surface(i.get_rank(map))
|
||||
}
|
||||
} else {
|
||||
cs.unzoomed_interesting_intersection
|
||||
};
|
||||
unzoomed_pieces.push((zorder, intersection_color.into(), i.polygon.clone()));
|
||||
|
||||
if cs.road_outlines {
|
||||
@ -461,7 +464,9 @@ impl DrawMap {
|
||||
}
|
||||
|
||||
for pl in map.all_parking_lots() {
|
||||
batch.append(DrawParkingLot::new(ctx, pl, cs, &mut GeomBatch::new()).render(app));
|
||||
batch.append(
|
||||
DrawParkingLot::new(ctx, pl, cs, app.opts(), &mut GeomBatch::new()).render(app),
|
||||
);
|
||||
}
|
||||
|
||||
for r in map.all_roads() {
|
||||
|
@ -4,9 +4,10 @@ use geom::{Distance, PolyLine, Polygon, Pt2D};
|
||||
use map_model::{
|
||||
osm, LaneType, Map, ParkingLot, ParkingLotID, NORMAL_LANE_THICKNESS, PARKING_LOT_SPOT_LENGTH,
|
||||
};
|
||||
use widgetry::{Drawable, EventCtx, GeomBatch, GfxCtx};
|
||||
use widgetry::{Color, Drawable, EventCtx, GeomBatch, GfxCtx, RewriteColor};
|
||||
|
||||
use crate::colors::ColorScheme;
|
||||
use crate::options::Options;
|
||||
use crate::render::{DrawOptions, Renderable, OUTLINE_THICKNESS};
|
||||
use crate::{AppLike, ID};
|
||||
|
||||
@ -20,6 +21,7 @@ impl DrawParkingLot {
|
||||
ctx: &EventCtx,
|
||||
lot: &ParkingLot,
|
||||
cs: &ColorScheme,
|
||||
opts: &Options,
|
||||
unzoomed_batch: &mut GeomBatch,
|
||||
) -> DrawParkingLot {
|
||||
unzoomed_batch.push(cs.parking_lot, lot.polygon.clone());
|
||||
@ -33,7 +35,12 @@ impl DrawParkingLot {
|
||||
unzoomed_batch.append(
|
||||
GeomBatch::load_svg(ctx, "system/assets/map/parking.svg")
|
||||
.scale(0.05)
|
||||
.centered_on(lot.polygon.polylabel()),
|
||||
.centered_on(lot.polygon.polylabel())
|
||||
.color(if opts.simplify_basemap {
|
||||
RewriteColor::Change(Color::hex("#204A87"), cs.parking_lot)
|
||||
} else {
|
||||
RewriteColor::NoOp
|
||||
}),
|
||||
);
|
||||
|
||||
DrawParkingLot {
|
||||
|
Loading…
Reference in New Issue
Block a user