run viewer.geocoder.viewModel hidden


When I run this code:

var geocoder = viewer.geocoder.viewModel;
geocoder.searchText = 'Spain';
geocoder.flightDuration = 0.5;;

The search window is open with text "Spain"... there's an option to hidde this text window to user?

I use keepExpanded=false but box text still open...


Generally the main purpose of the view models is to programmatically control the user interface. If you just want to do a background geocode without affecting the user interface, you could simply use the underlying GeocoderService directly by calling geocode, then take the first result and call flyTo.

Hello Scott Hunter

Do you have an example, please?


var viewer = new Cesium.Viewer(‘cesiumContainer’);

var geocoderService = new Cesium.IonGeocoderService({

scene: viewer.scene



if (Cesium.defined(result) && Cesium.defined(result[0])) {


        destination : result[0].destination