Skip to content

Commit e9e8955

Browse files
committed
Set directions profile to 'foot'.
1 parent 8e9bfba commit e9e8955

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ WhereRoulette uses several external libraries and resources:
3030

3131
- **[Nominatim](https://nominatim.openstreetmap.org/ui/about.html)** for geocoding
3232
- **[Overpass API](https://wiki.openstreetmap.org/wiki/Overpass_API)** for serving OpenStreetMap data
33-
- **[maplibregl](https://maplibre.org/)** for rendering interactive maps
33+
- **[Maplibre-gl](https://maplibre.org/)** for rendering interactive maps
34+
- **[Maplibre-gl-directions](https://maplibre.org/maplibre-gl-directions)** for directions
3435
- **[osmtogeojson](https://github.com/tyrasd/osmtogeojson)** for converting OpenStreetMap data to GeoJSON
3536
- **[FontAwesome](https://fontawesome.com/)** for icons
3637
- **[Webpack](https://webpack.js.org/)** for bundling assets

TODO.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,6 @@
5757
- [] Add mapillary images for the choosen POI.
5858
- [] Add [lib.reviews](https://lib.reviews/faq)
5959
- [] Add way to mute the sound.
60-
- [] Update GeoControl to track user location on mobile devices.
60+
- [] Update GeoControl to track user location on mobile devices.
61+
- [] Add CI for deploy previews on PRs.
62+
- [] Add UI for setting directions profile.

app/src/main.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,17 @@ export function showDirections() {
706706
if (selectedFeature && selectedFeature.geometry.type === 'Point') {
707707
const destination = selectedFeature.geometry;
708708
navigator.geolocation.getCurrentPosition((position) => {
709-
directions.setWaypoints([destination.coordinates as [number, number], [position.coords.longitude, position.coords.latitude]]);
710-
});
709+
// TODO: provide a UI for setting different profiles.
710+
const profiles: string[] = [
711+
"foot",
712+
// "bike",
713+
// "car"
714+
];
715+
directions.setWaypoints(
716+
[destination.coordinates as [number, number], [position.coords.longitude, position.coords.latitude]],
717+
profiles
718+
);
719+
});
711720
} else {
712721
// Handle other geometry types or log an error/warning
713722
console.error("Selected feature does not have a 'Point' geometry type.");

0 commit comments

Comments
 (0)