Class: VEGeocoderE-mail This Topic Printable Version Give Us Feedback

Description

Class added v1.4.

Bing Maps geocoder. See Locator for geocoding with ArcGIS Server locators.

Class hierarchy

esri.virtualearth.VEGeocoder

Constructor

Constructor Description
esri.virtualearth.VEGeocoder(options) Creates a new VEGeocoder object. The parameters can be included in any order. Either tokenURL or serverToken is required in the constructor. All other parameters are optional.

Properties

Property Type Description
culture String Specifies the culture in which to return results. The default value is "en-US". For a list of supported cultures, see http://msdn.microsoft.com/en-us/library/cc981048.aspx.
environment String Whether to use the Bing Maps staging or production environment. Trial Bing Maps accounts must always use staging. Subscription accounts can use either staging or production.
serverToken String The Bing Maps services token used by the ArcGIS VEAdapter to make Bing Maps geocode service requests.
tokenDuration String Duration of the Bing Maps token in minutes. The minimum is 15, and the maximum is 480 (8 hours).
tokenUrl String The root URL of the "Get Virtual Earth Token" page. For more information, see Getting started with Bing Maps in the ArcGIS JavaScript API.

Methods

Method Return Value Description
addressToLocations(query, callback?, errback?) dojo.Deferred Sends a geocode request to Bing Maps to find candidates for a single address specified in the query argument. On completion, the onAddressToLocationsComplete event is fired and the optional callback function is invoked.
setCulture(culture) none Sets the culture in which to return results.
setServerToken(token) none Updates server token.

Events

Event Description
onAddressToLocationsComplete(geocodeResults) Fires when VEGeocode.addressToLocation() has completed. The result is an array of VEGeocodeResult. This is the same signature returned if the optional callback is specified.
onError(error) Fires when an error occurs when executing the task.
Constructor Detail

esri.virtualearth.VEGeocoder(options)

Creates a new VEGeocoder object. The parameters can be included in any order. Either tokenURL or serverToken is required in the constructor. All other parameters are optional.
Parameters:
<Object> options Required See options list for parameters.
Options:
<String> culture Specifies the culture in which to return results. The default value is "en-US". For a list of supported cultures, see http://msdn.microsoft.com/en-us/library/cc981048.aspx.
<String> environment Whether to use the Bing Maps staging or production environment. Trial Bing Maps accounts must always use staging. Subscription accounts can use either staging or production.
<String> serverToken Note: Either tokenURL or serverToken is required in the constructor.

The Bing Maps Web services token used by the ArcGIS VEAdapter to make Bing Maps geocode service requests.
<String> tokenDuration The duration of the token in minutes. The minimum value is 15 and the maximum value is 480 (8 hours).
<String> tokenUrl Note: Either tokenURL or serverToken is required in the constructor.

The root URL of the "Get Virtual Earth Token" page. For more information, see Getting started with Bing Maps in the ArcGIS JavaScript API.
Properties Detail

<String> culture

Specifies the culture in which to return results. The default value is "en-US". For a list of supported cultures, see http://msdn.microsoft.com/en-us/library/cc981048.aspx.
Default value: en-US
See also:
setCulture  

<String> environment

Whether to use the Bing Maps staging or production environment. Trial Bing Maps accounts must always use staging. Subscription accounts can use either staging or production.
Known values: staging | production
Default value: staging

<String> serverToken

The Bing Maps services token used by the ArcGIS VEAdapter to make Bing Maps geocode service requests.
See also:
setServerToken  

<String> tokenDuration

Duration of the Bing Maps token in minutes. The minimum is 15, and the maximum is 480 (8 hours).
Default value: 480

<String> tokenUrl

The root URL of the "Get Virtual Earth Token" page. For more information, see Getting started with Bing Maps in the ArcGIS JavaScript API.
Methods Detail

addressToLocations(query, callback?, errback?)

Sends a geocode request to Bing Maps to find candidates for a single address specified in the query argument. On completion, the onAddressToLocationsComplete event is fired and the optional callback function is invoked.
Return value: dojo.Deferred
Input Parameters:
<String> query Required The address to locate.
<Function> callback Optional The function to call when the method has completed. The arguments in the function are the same as the onAddressToLocationsComplete event.
<Function> errback Optional An error object is returned if an error occurs during task execution.

setCulture(culture)

Sets the culture in which to return results.
Return value: none
Input Parameters:
<String> culture Required The culture value. The default value is "en-US". For a list of supported cultures, see http://msdn.microsoft.com/en-us/library/cc981048.aspx.
See also:
culture  

setServerToken(token)

Updates server token.
Return value: none
Input Parameters:
<String> token Required The new token to update with.
See also:
serverToken  

Events Detail

onAddressToLocationsComplete(geocodeResults)

Fires when VEGeocode.addressToLocation() has completed. The result is an array of VEGeocodeResult. This is the same signature returned if the optional callback is specified.
Arguments:
<VEGeocodeResult[]> geocodeResults Contains an array of candidates that match the given address as well as their scores.
See also:
addressToLocations  

onError(error)

Fires when an error occurs when executing the task.
Arguments:
<Error> error Error message returned in a JavaScript error object.