Hello,
I have a custom in-house Locator that accepts:
Address Fields:
everything works fine in version 3.19
However, I keep getting an error in 4.2
err.details:
[Missing value for a required locator field 'Street or Intersection'.]
err.stack:
Error: Unable to complete operation.
at Anonymous function
(https://js.arcgis.com/4.2/:431:265)
at f (https://js.arcgis.com/4.2/:117:491)
at l (https://js.arcgis.com/4.2/:117:423)
at resolve
(https://js.arcgis.com/4.2/:120:86)
at a (https://js.arcgis.com/4.2/:118:412)
at f (https://js.arcgis.com/4.2/:118:169)
at l (https://js.arcgis.com/4.2/:117:423)
at resolve
(https://js.arcgis.com/4.2/:120:86)
at a (https://js.arcgis.com/4.2/:118:412)
at f (https://js.arcgis.com/4.2/:118:136)
here's the code that i'm using... following the 4.2 API
var address = { Street: '200 N Spring St', Zone: '90012' };
var locator = new Locator();
locator.url = '//myserver:6080/arcgis/rest/services/Locator/2011_Locator/GeocodeServer';
locator.addressToLocations(address)
.then(showAddressCandidates)
.otherwise(rejectedPromise);
any help or insight into why this is happening would be greatly appreciated... its driving me nuts!
so my issue was the javascript address object...
instead of this:
locator.addressToLocations(address)
It should be this:
locator.addressToLocations({ address: address})