Is there a way to do reverse geocoding in Cesium, as long as we have lat and long?

1. A concise explanation of the problem you're experiencing.
I enter the latitude and longitude in the Search widget, and press the button. It seems to work, but the location (if I choose California for example) ends up in the middle of the ocean.

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
Just using the built-in Bing Maps geocoder.

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I need to implement reverse geocoding, in the simplest way possible. Again, it looks possible, but is inaccurate :frowning:

4. The Cesium version you're using, your operating system and browser.
Cesium 1.38, Windows 10, Chrome.

1. A concise explanation of the problem you're experiencing.
How could I create an instance of the SearchManager (Bing API) in my cesium application?
Or is there an

4. The Cesium version you're using, your operating system and browser.
1.38 Windows 10, Chrome.

Hi Martine,

The third party Geocoder service is what takes your query and returns a location, so unless you implement a custom geocoder, I don’t think it’s possible to change this behavior. Maybe latitude/longitude are in the opposite order? Do you have an example we could test?

Thanks,

Gabby

I mix up the order too often! :laughing:

The GeocoderViewModel is what controls the UI elements. You should be able to intercept the search command and implement custom logic before it’s sent to the geocoder. Or you could set the searchText directly. I don’t think we have sample code, but viewer.geocoder.viewModel will get you the GeocoderViewModel object.

I can indeed change the searchText, thank you so much…
However, if I want a complete reverse geocoding (to the nearest actual address) it looks like I will need to implement a custom geocoder, or add reverse geocoding to Cesium…

Thanks for the help :slight_smile:

Martine

Hi,
We can use ‘destinationFound’ property of GeocoderViewModel for this. It takes your query and returns a location. With this destination we can plot the lat and long in the globe.
It is possible with default geocoder searchbox. No need of implementing a custom geocoder.