# Custom Geocoder and input

**URL:** <https://community.cesium.com/t/custom-geocoder-and-input/6172>\
**Category:** CesiumJS\
**Created:** [October 20, 2017, 9:59pm UTC](https://community.cesium.com/t/custom-geocoder-and-input/6172 "2017-10-20T21:59:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martine\_Habib](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Martine\_Habib](https://community.cesium.com/u/Martine_Habib)\
**Post date:** [October 20, 2017, 9:59pm UTC](https://community.cesium.com/t/custom-geocoder-and-input/6172/1 "2017-10-20T21:59:01Z")

</div>

**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?’;](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!!

---

<div class="post-metadata">

**Author:** ![Martine\_Habib](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Martine\_Habib](https://community.cesium.com/u/Martine_Habib)\
**Post date:** [October 24, 2017, 1:50am UTC](https://community.cesium.com/t/custom-geocoder-and-input/6172/2 "2017-10-24T01:50:32Z")

</div>

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 🙂

Martine

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [October 24, 2017, 9:07pm UTC](https://community.cesium.com/t/custom-geocoder-and-input/6172/3 "2017-10-24T21:07:09Z")

</div>

Hi Martine,

Sorry for not responding fast! The [https issue has been addressed](https://github.com/AnalyticalGraphicsInc/cesium/pull/5909) and will be fixed in the next Cesium release.

Good luck with the Google API geocoder!

Thanks,

Gabby
