ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping.Geocoding Namespace / LocatorManager Class / GeocodeAsync Method / GeocodeAsync(String,Boolean,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?
Set to true to show a cancelable message box
Version

GeocodeAsync(String,Boolean,Boolean,Boolean) Method
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?
showCancelPrompt
Set to true to show a cancelable message box

Return Value

Task of List of GeocodeResult objects. If no locators can be found then null is returned.
Remarks
If showCancelPrompt is set to true then, if GeocodeAsync is called when a previous geocode has not completed, a message box prompt asking the user if they wish to cancel the current (i.e. "previous") geocode will be shown that must be acknowledged. If showCancelPrompt is set to false no message box is shown.
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3.2 or higher.
See Also