I've made modifications to the Geocoder widget so that it can make requests from a Nominatim source. It works fine, but only displays the top result. Is there a way to make the geocoder text box do an autocomplete like action so the user can select from multiple geocoder responses?
And example would be typing in "KBOS". There's a TX radio station with those call letters, and the airport in Boston has that as its ICAO code. Both are returned from the search, so it would be nice to have a selection drop down from the text box. Google Maps has this kind of functionality in their search box.
Im interested in this as well. I would like to be able to search all ICAO's from my database. Example: "BIRK" sends you to Birk, Germany; "BIRK Airport" sends you to BIRK Airport in Iceland
Just an FYI that we’d be happy to take a pull request if anyone wants to work on these things. It sounds like this could be split into 2 separate pieces.
Add autocomplete and drop down suggestions to the widget (the bing API supports this, we just need to hook it in).
Make the actual geocoding mechanism plugginable so that users can supply their own geocoder (or multiple geocoders for domain specific searching).
Replace the this._url with the url to the mapbox geocoder, get the access token from MapboxApi.getAccessToken, and change the geocode function to make the correct call to the mapbox api and handle it’s return value.
If you get something working, we’d be happy to take a pull request. Now that we support mapbox imagery, I bet there are other people who would like to use their geocoder as well. Let me know if you have any questions!
While the original thread may be old, there is now a solution to the original problem. With updates to the Cesium geocoder, it is possible to write a GeocoderService that uses Nominatim as the back end instead of the Bing maps search service.
The following code, NominatimGeocoderService.js will do the trick. Simply edit the 'url' variable to the base of your Nominatim service
Appreciate the pointer. Wish I’d looked in the Sandcastle apps after recent download of Cesium, would have saved some time.
I notice the Sandcastle example uses “loadJson()”, instead of “loadJsonp()”. Given the strong likelyhood that the geocoder would be located in a different domain, wouldn’t jsonp be better to help avoid same-origin issues?
Sandcastle nominatim search does not work on my system: Chrome 64bits: Version 61.0.3163.100 (Official Build) (64-bit)
The sandcastle example is throwing an error because the endpoint is requesting an url via http:// while sandcastle is being served on https://, so there’s a security error. If you set the endpoint to use https://, it should work. I’ve opened an issue on GitHub to fix.
Also in my ‘normal’ 1.38 Cesium the Geocoder does not work…