Skip to content

fix(geocoder): update implementation and adjust replace script#444

Merged
DennisOSRM merged 2 commits intogh-pagesfrom
feature/branch-from-cli
May 3, 2026
Merged

fix(geocoder): update implementation and adjust replace script#444
DennisOSRM merged 2 commits intogh-pagesfrom
feature/branch-from-cli

Conversation

@DennisOSRM
Copy link
Copy Markdown
Contributor

This PR updates the geocoder implementation, adjusts scripts/replace.js, and fixes geocoder tests.

This PR updates the geocoder implementation, adjusts scripts/replace.js, and fixes geocoder tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 3, 2026 18:02
Copy link
Copy Markdown
Contributor

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 updates the geocoder integration to preserve Leaflet-Control-Geocoder defaults when no Nominatim URL is configured, and adjusts the build-time replacement script accordingly, along with test updates.

Changes:

  • Update geocoder.coordPreserving() to call L.Control.Geocoder.nominatim() with no args when nominatimUrl is omitted/blank.
  • Expand scripts/replace.js to replace Nominatim endpoints more flexibly (http/https, optional trailing slash).
  • Add a Jest test to validate the no-args Nominatim factory call path.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
test/geocoder.test.js Adds coverage for the “no nominatimUrl provided” factory invocation behavior.
src/geocoder.js Makes coordPreserving() select between {serviceUrl} vs default nominatim factory call.
scripts/replace.js Updates endpoint replacement to match more URL variants via regex.

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

Comment thread scripts/replace.js
Comment on lines 37 to 39
}
if (NOMINATIM_ENDPOINT) options = options.replace('https://nominatim.openstreetmap.org/', NOMINATIM_ENDPOINT)
if (NOMINATIM_ENDPOINT) options = options.replace(/https?:\/\/nominatim\.openstreetmap\.org\/?/g, function() { return NOMINATIM_ENDPOINT; })

Comment thread src/geocoder.js Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@DennisOSRM DennisOSRM merged commit c2101ba into gh-pages May 3, 2026
5 checks passed
@DennisOSRM DennisOSRM deleted the feature/branch-from-cli branch May 3, 2026 18:11
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.

2 participants