Custom Geocoder and input

1. A concise explanation of the problem you’re experiencing.

I am trying to run the Custom Geocoder that is in Sandcastle…

However, it never works.

This is because the minute I enter anything into the search box, the Geocoder starts running, while the query term is still incomplete.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

For example, if I try to enter “San Francisco”, I need to type extra fast, but still I only get “San F” before the following code runs:

OpenStreetMapNominatimGeocoder.prototype.geocode = function (input) {

var endpoint = 'https://nominatim.openstreetmap.org/search?’;

var query = ‘format=json&q=’ + input;

var requestString = enpoint + query;

So the result says “not found” because there is no city named San F.

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I need to implement a custom geocoder, using the Cesium input box.

Ideally I would like to adapt to Google API Geocoder.

4. The Cesium version you’re using, your operating system and browser.

I am using Cesium 1.38, with Google Chrome 61 on mac (64 bit)

Thanks for any help!!

Ha, after not getting any replies, I searched and searched the forum, and finally found the answer, which is the “https” vs. “http” problem in the Sandcastle example.
So consider this closed.

I am hoping to hook up a Google geocoder. We’ll see if I can make it work :slight_smile:

Martine

Hi Martine,

Sorry for not responding fast! The https issue has been addressed and will be fixed in the next Cesium release.

Good luck with the Google API geocoder!

Thanks,

Gabby