# Geocoder

#### new Cesium.Geocoder(options)
widgets/Source/Geocoder/Geocoder.js 31

A widget for finding addresses and landmarks, and flying the camera to them. Geocoding is performed using Cesium ion.

Name | Type | Description
--- | --- | ---
`options` | object | Object with the following properties:
Name | Type | Default | Description
--- | --- | --- | ---
`container` | Element | string |  | The DOM element or ID that will contain the widget.
`scene` | Scene |  | The Scene instance to use.
`geocoderServices` | Array.<GeocoderService> |  | optional The geocoder services to be used
`autoComplete` | boolean | `true` | optional True if the geocoder should query as the user types to autocomplete
`flightDuration` | number | `1.5` | optional The duration of the camera flight to an entered location, in seconds.
`destinationFound` | Geocoder.DestinationFoundFunction | `GeocoderViewModel.flyToDestination` | optional A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination.

### Members

#### container : Element
widgets/Source/Geocoder/Geocoder.js 164

Gets the parent container.

#### searchSuggestionsContainer : Element
widgets/Source/Geocoder/Geocoder.js 176

Gets the parent container.

#### viewModel : GeocoderViewModel
widgets/Source/Geocoder/Geocoder.js 188

Gets the view model.

### Methods

#### destroy()
widgets/Source/Geocoder/Geocoder.js 206

Destroys the widget. Should be called if permanently removing the widget from layout.

#### isDestroyed() → boolean
widgets/Source/Geocoder/Geocoder.js 198

##### Returns:

true if the object has been destroyed, false otherwise.

### Type Definitions

#### Cesium.Geocoder.DestinationFoundFunction(viewModel, destination)
widgets/Source/Geocoder/Geocoder.js 227

A function that handles the result of a successful geocode.

Name | Type | Description
--- | --- | ---
`viewModel` | GeocoderViewModel | The view model.
`destination` | Cartesian3 | Rectangle | The destination result of the geocode.

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.