Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<img width="2253" height="1303" alt="image" src="https://github.com/user-attachments/assets/00f43ea8-51df-4319-ad31-4feadf0024c1" />


This is the ReactJS demo web app running on https://valhalla.openstreetmap.de. It provides routing and isochrones with a magnitude of options and makes requests to [Valhalla](https://github.com/valhalla/valhalla), an open source routing engine and accompanying libraries for use with OpenStreetMap data.

## Commands
Expand All @@ -27,6 +26,12 @@ This project includes end-to-end tests using [Playwright](https://playwright.dev

### Running Tests

First install the `playwright` browsers:

```bash
npx playwright install
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--with-deps was causing some error. arch linux doesn't seem to be natively supported for playwright, it's installing the fallback ubuntu browsers. for some reason it only worked without that argument

```

```bash
# Run all e2e tests in headless mode
npm run test:e2e
Expand Down
2 changes: 1 addition & 1 deletion src/components/tiles/valhalla-layers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('valhalla-layers', () => {
it('should have properly encoded JSON structure', () => {
const url = getValhallaTileUrl();
const expectedEncoded =
'%7B%22tile%22%3A%7B%22z%22%3A{z}%2C%22x%22%3A{x}%2C%22y%22%3A{y}%7D%7D';
'%7B%22verbose%22%3A%20true%2C%20%22tile%22%3A%7B%22z%22%3A{z}%2C%22x%22%3A{x}%2C%22y%22%3A{y}%7D%7D';

expect(url).toContain(expectedEncoded);
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/tiles/valhalla-layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const VALHALLA_NODES_LAYER_ID = 'valhalla-nodes';
// Pre-encoded JSON: {"tile":{"z":{z},"x":{x},"y":{y}}}
// Placeholders {z}, {x}, {y} remain unencoded for MapLibre to replace
const TILE_JSON_ENCODED =
'%7B%22tile%22%3A%7B%22z%22%3A{z}%2C%22x%22%3A{x}%2C%22y%22%3A{y}%7D%7D';
'%7B%22verbose%22%3A%20true%2C%20%22tile%22%3A%7B%22z%22%3A{z}%2C%22x%22%3A{x}%2C%22y%22%3A{y}%7D%7D';

export function getValhallaTileUrl(): string {
const baseUrl = normalizeBaseUrl(getBaseUrl());
Expand Down