ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping.Geocoding Namespace / LocatorManager Class / GeocodeAsync Method / GeocodeAsync(String,Boolean,Boolean) Method
The address/location to geocode.
Should the candidate results be displayed on the active map?
Should the map zoom to the first candidate result?

In This Topic
    GeocodeAsync(String,Boolean,Boolean) Method
    In This Topic
    Perform a geocode operation. Geocode results are returned according to the active locator providers.
    Syntax

    Parameters

    location
    The address/location to geocode.
    showResultsOnMap
    Should the candidate results be displayed on the active map?
    zoomToFirstResult
    Should the map zoom to the first candidate result?

    Return Value

    Task of List of GeocodeResult objects. If no locators can be found then null is returned.
    Remarks
    As the method is asynchronous, if multiple Geocodes are executed - one after the other, then a successive Geocode may be initiated before the prior Geocode has completed. In this case, a message box will be shown that must be acknowledged by the user to either cancel or continue the current geocode. Refer to GeocodeAsync(String,Boolean,Boolean,Boolean) to hide the message box/cancel prompt.
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also