Skip to content
Open
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ docker run -p 9966:9966 osrm/osrm-frontend
Per default routing requests are made against the backend at `http://localhost:5000`.
You can change the backend by using `-e OSRM_BACKEND='http://localhost:5001'` in the `docker run` command.

Per default address requests are made against the Nominatim demo at `https://nominatim.openstreetmap.org`.
You can change the Nominmatim instance by using `-e NOMINATIM_URL='http://localhost:8080'` in the `docker run` command.
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

Typo in documentation: “Nominmatim” should be “Nominatim” (environment variable description).

Suggested change
You can change the Nominmatim instance by using `-e NOMINATIM_URL='http://localhost:8080'` in the `docker run` command.
You can change the Nominatim instance by using `-e NOMINATIM_URL='http://localhost:8080'` in the `docker run` command.

Copilot uses AI. Check for mistakes.

In case Docker complains about not being able to connect to the Docker daemon make sure you are in the `docker` group.

```
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ENV OSRM_CENTER='38.8995,-77.0269'
ENV OSRM_ZOOM='13'
ENV OSRM_LANGUAGE='en'
ENV OSRM_LABEL='Car (fastest)'
ENV NOMINATIM_URL='https://nominatim.openstreetmap.org'

# Copy package.json
RUN mkdir -p /src
Expand Down
2 changes: 2 additions & 0 deletions scripts/replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ for (const filepath of [leafletOptions, debug]) {
const CENTER = process.env.OSRM_CENTER || '38.8995, -77.0269'
const BACKEND = process.env.OSRM_BACKEND || 'https://router.project-osrm.org'
const LANGUAGE = process.env.OSRM_LANGUAGE || 'en'
const NOMINATIM = process.env.NOMINATIM_URL || 'https://nominatim.openstreetmap.org'
const DEFAULT_LAYER = process.env.OSRM_DEFAULT_LAYER || 'streets'

// Edit Leaflet Options
if (NOMINATIM) options = options.replace(/\/\/nominatim\.openstreetmap\.org/, NOMINATIM)
Comment on lines +22 to +26
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

NOMINATIM_URL values that already include a trailing slash will produce a double-slash in leaflet_options.js (because the template keeps its existing /). Consider normalizing NOMINATIM (trim trailing slashes) or adjusting the regex to replace the full default URL including the optional trailing / and then append exactly one /.

Copilot uses AI. Check for mistakes.
if (BACKEND) options = options.replace(/http[s]?:\/\/router\.project-osrm\.org/, BACKEND)
if (LABEL) options = options.replace('Car (fastest)', LABEL)
if (ZOOM) options = options.replace('zoom: 13', `zoom: ${ZOOM}`)
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function makeIcon(i, n) {
}

var plan = new ReversablePlan([], {
geocoder: Geocoder.nominatim(),
geocoder: Geocoder.nominatim({serviceUrl:leafletOptions.nominatim.url}),
routeWhileDragging: true,
Comment on lines 96 to 98
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

index.html loads the committed bundle.js, but bundle.js in the repo still uses the old r.nominatim() call and doesn’t include leafletOptions.nominatim. This change won’t take effect for the static build unless npm run build is run and the regenerated bundle.js is committed (or the build/publish pipeline is updated to generate it).

Copilot uses AI. Check for mistakes.
createMarker: function(i, wp, n) {
var options = {
Expand Down
3 changes: 3 additions & 0 deletions src/leaflet_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ module.exports = {
overlay: {
'Small Components': small_components
},
nominatim:{
url:'//nominatim.openstreetmap.org/'
},
baselayer: {
one: streets,
two: outdoors,
Expand Down