Skip to content

Commit

Permalink
Let inferred kerb be configurable in the web UI
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Mar 17, 2024
1 parent 2d60c74 commit 4aba5df
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions osm2lanes-js/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
// You can generally leave the rest of these alone
bikes_can_use_bus_lanes: true,
inferred_sidewalks: false,
inferred_kerbs: true,
street_parking_spot_length: 8.0,
turn_on_red: true,
include_railroads: true,
Expand Down
2 changes: 2 additions & 0 deletions osm2streets-js/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub struct ImportOptions {
dual_carriageway_experiment: bool,
sidepath_zipping_experiment: bool,
inferred_sidewalks: bool,
inferred_kerbs: bool,
}

#[wasm_bindgen]
Expand Down Expand Up @@ -57,6 +58,7 @@ impl JsStreetNetwork {

let mut cfg = MapConfig::default();
cfg.inferred_sidewalks = input.inferred_sidewalks;
cfg.inferred_kerbs = input.inferred_kerbs;

let mut timer = Timer::throwaway();
let (mut street_network, doc) =
Expand Down
1 change: 1 addition & 0 deletions web/src/common/import/ImportControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
dual_carriageway_experiment: boolean;
sidepath_zipping_experiment: boolean;
inferred_sidewalks: boolean;
inferred_kerbs: boolean;
}
type Imported =
Expand Down
5 changes: 5 additions & 0 deletions web/src/common/import/Osm2streetsSettings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
dual_carriageway_experiment: false,
sidepath_zipping_experiment: false,
inferred_sidewalks: false,
inferred_kerbs: true,
};
</script>

Expand Down Expand Up @@ -46,6 +47,10 @@
infer on roads
</label>
</div>
<label>
<input type="checkbox" bind:checked={settings.inferred_kerbs} />
Infer kerbs
</label>
</details>

<style>
Expand Down

0 comments on commit 4aba5df

Please sign in to comment.