Skip to content

Make nominatim endpoint modifiable#385

Open
nhirokinet wants to merge 1 commit intoProject-OSRM:gh-pagesfrom
nhirokinet:gh-pages
Open

Make nominatim endpoint modifiable#385
nhirokinet wants to merge 1 commit intoProject-OSRM:gh-pagesfrom
nhirokinet:gh-pages

Conversation

@nhirokinet
Copy link
Copy Markdown

Hi, thank you for nice product.

How about make nominatim endpoint modifiable?

I tried to make my code fit to current code, but if there is comment please feel free to comment about modification.

(The following is the commit message)

Most of API endpoints can be modified via leaflet_options.js, which is mentioned in README as a target of manual modify.

But nominatim endpoint cannot be modified by this way. As nominatim can be self-hosted, I think it should be modifiable in configuration.

@DennisOSRM DennisOSRM enabled auto-merge (squash) March 28, 2026 12:29
@nhirokinet
Copy link
Copy Markdown
Author

Hi, thank you for review! You've set auto merge and approved, so once the conflicts are resolved, I think the PR will be automatically merged.
How should I do? Shall I resolve conflict which will automatically merge the PR? Or shall I just wait as this PR allows edits by maintainers?

@DennisOSRM
Copy link
Copy Markdown
Contributor

Please resolve the merge conflict

Most of API endpoints can be modified via leaflet_options.js, which is
mentioned in README as a target of manual modify.

But nominatim endpoint cannot be modified by this way. As nominatim can
be self-hosted, I think it should be modifiable in configuration.
auto-merge was automatically disabled April 3, 2026 11:17

Head branch was pushed to by a user without write access

@nhirokinet
Copy link
Copy Markdown
Author

I resolved the merge conflict and tested again.
Looks like auto-merge is cancelled by new commit. Could you take a look again?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the Nominatim (forward/reverse geocoding) endpoint configurable, aligning it with other backend endpoints that can be customized via src/leaflet_options.js and the build-time replacement script.

Changes:

  • Add a nominatim.path configuration entry to src/leaflet_options.js.
  • Wire the configured Nominatim URL through src/index.js into the geocoder factory.
  • Allow build-time substitution of the Nominatim endpoint via scripts/replace.js.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/leaflet_options.js Introduces a configurable Nominatim base URL in the exported options.
src/index.js Passes the configured Nominatim URL into the geocoder initialization.
src/geocoder.js Updates coordPreserving to build a Nominatim geocoder using a configurable serviceUrl.
scripts/replace.js Adds env-driven replacement for the Nominatim endpoint in generated config files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +44 to +45
geocoder.coordPreserving = function(nominatimUrl) {
var nominatim = L.Control.Geocoder.nominatim({serviceUrl: nominatimUrl});
}
var plan = new ReversablePlan([], {
geocoder: createGeocoder.coordPreserving(),
geocoder: createGeocoder.coordPreserving(leafletOptions.nominatim.path),
// Leaflet uses LatLng
else options = options.replace('38.8995,-77.0269', latlng)
}
if (NOMINATIM_ENDPOINT) options = options.replace('https://nominatim.openstreetmap.org/', NOMINATIM_ENDPOINT)
Comment on lines +68 to 71
},
nominatim: {
path: 'https://nominatim.openstreetmap.org/'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants