Esri / angular-esri-map

A collection of directives to help you use Esri maps and services in your Angular applications
https://esri.github.io/angular-esri-map/
Apache License 2.0
213 stars 107 forks source link

Locator example for v2? #326

Closed snobrdinrtiste closed 7 years ago

snobrdinrtiste commented 7 years ago

Is there an example that uses esri.tasks.Locator in v2? I have tried to implement the Locator to geocode an address using the addressToLocations method and my locator keeps returning an error saying I need to specify a street value .. (which i already did)

var address = { Street: '300 N Grand Ave', ZIP: '90012' }; var locator = new Locator(); locator.url = '//myserver:6080/arcgis/rest/services/Locator/Locator_13/GeocodeServer'; locator.addressToLocations(address) .then(showAddressCandidates) .otherwise(rejectedPromise);

tomwayson commented 7 years ago

try locator.addressToLocations({address: address })

snobrdinrtiste commented 7 years ago

tried it every which way possible before i posted... let me try your suggestion and i'll post my results edit: thank you tom! that worked! the ESRI 4.2 locator API docs did not specify that at all... was pulling my hair out on that one! thanks again!