Description
Class added v1.4.dojo.require("esri.virtualearth.VEGeocoder"); Bing Maps geocoder. See
Locator for geocoding with ArcGIS Server locators. If you are working with the 1.x version of the ArcGIS JavaScript API, you will need to use tokens, view the information
here on setting up a Virtual Earth token page.
Samples
Search for
samples that use this class.
Class hierarchy
esri.virtualearth.VEGeocoder
Constructor
Properties
Methods
Events
Constructor Detail
esri.virtualearth.VEGeocoder(options)
Creates a new VEGeocoder object.
Parameters:
|
<Object>
options |
Required |
See options list for parameters.
|
Options:
Code snippets:
veGeocoder = new esri.virtualearth.VEGeocoder({
bingMapsKey:'Al0VE_jsmagxk4LFghXGlK5JSHfC0tk-eHRubZv_eMYm6wzgQaStYks8g-wWcgk3'
});
Properties Detail
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.
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. |
Code snippets:
var query = "380 New York St, Redlands, CA, 92373";
veGeocoder.addressToLocations(query);
Sets the culture in which to return results.
Return value: none
Input Parameters:
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.
|
Code snippets:
dojo.connect(veGeocoder, "onAddressToLocationsComplete", function(geocodeResults) {
var pointMeters = esri.geometry.geographicToWebMercator(geocodeResults[0].location);
var pointSymbol = new esri.symbol.SimpleMarkerSymbol().setSize(15).setColor(new dojo.Color("blue"));
var locationGraphic = new esri.Graphic(pointMeters,pointSymbol);
map.graphics.add(locationGraphic);
});
Fires when an error occurs when executing the task.
Arguments: