Migrating from 10.2 to 100.2: LocatorTask.GetInfoAsync()

77
1
Jump to solution
08-29-2019 12:22 PM
Highlighted
New Contributor II

I'm in the process of migrating our code from using 10.2.6 to using 100.2.1.

The 10.2 code I'm having trouble migrating gets the locator info and queries the LocatorServiceInfo.SingleLineAddressField and LocatorServiceInfo.AddressFields to formulate the input parameters to be passed to GeocodeAsync.

// In a loop here...

LocatorServiceInfo info = await service.Locator.GetInfoAsync();

...

if (info.SingleLineAddressField == null)
   continue;
inputParameters.Add(info.SingleLineAddressField.FieldName, singleLineAddress);

...

if (info.AddressFields.Any(f => f.FieldName == fieldName))
{...}

In 100.2, it appears I would access the LocatorInfo property.

LocatorInfo info = service.Locator.LocatorInfo;

However, LocatorInfo doesn't have SingleLineAddressField or AddressFields properties.  I'm guessing SearchAttributes would hold this information, but I'm not sure what the key would be for SingleLineAddressField.

Am I on the right track?  If so, how do I access the equivalent value for SingleLineAddressField?  If not, what is the correct approach?

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
MVP Regular Contributor

For single line address just use the overload that accepts a string

LocatorTask.GeocodeAsync Method (String) 

View solution in original post

Reply
0 Kudos
1 Reply
Highlighted
MVP Regular Contributor

For single line address just use the overload that accepts a string

LocatorTask.GeocodeAsync Method (String) 

View solution in original post

Reply
0 Kudos