-
Notifications
You must be signed in to change notification settings - Fork 268
Make nominatim endpoint modifiable #385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: gh-pages
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ function applyReplacements(content, env) { | |
| const BACKEND = env.OSRM_BACKEND || 'https://router.project-osrm.org' | ||
| const LANGUAGE = env.OSRM_LANGUAGE || 'en' | ||
| const DEFAULT_LAYER = env.OSRM_DEFAULT_LAYER || 'streets' | ||
| const NOMINATIM_ENDPOINT = env.NOMINATIM_ENDPOINT || 'https://nominatim.openstreetmap.org/' | ||
|
|
||
| let options = content | ||
|
|
||
|
|
@@ -34,6 +35,7 @@ function applyReplacements(content, env) { | |
| // Leaflet uses LatLng | ||
| else options = options.replace('38.8995,-77.0269', latlng) | ||
| } | ||
| if (NOMINATIM_ENDPOINT) options = options.replace('https://nominatim.openstreetmap.org/', NOMINATIM_ENDPOINT) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| return options | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,8 +41,8 @@ function parseCoords(query) { | |
| // For non-coordinate input, falls through to Nominatim forward-geocode as normal. | ||
| // Also bridges leaflet-control-geocoder's Promise API to the callback-based API | ||
| // that leaflet-routing-machine's autocomplete expects. | ||
| geocoder.coordPreserving = function() { | ||
| var nominatim = L.Control.Geocoder.nominatim(); | ||
| geocoder.coordPreserving = function(nominatimUrl) { | ||
| var nominatim = L.Control.Geocoder.nominatim({serviceUrl: nominatimUrl}); | ||
|
Comment on lines
+44
to
+45
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| function withCallback(promise, cb, context) { | ||
| return promise.then(function(results) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,5 +65,8 @@ module.exports = { | |
| three: satellite, | ||
| four: osm, | ||
| five: osm_de | ||
| }, | ||
| nominatim: { | ||
| path: 'https://nominatim.openstreetmap.org/' | ||
| } | ||
|
Comment on lines
+68
to
71
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test/leaflet_options.test.js looks like not having this kind of test for other parameters |
||
| }; | ||
Uh oh!
There was an error while loading. Please reload this page.