geocode method

Future<List<GeocodeResult>> geocode({
  1. required String searchText,
  2. GeocodeParameters? parameters,
})

Geocodes address with parameters and returns candidates.

Executes a geocoding operation to find location candidates for a given address.

Parameters:

  • searchText — Address inputs.
  • parameters — Geocode method parameters.

Return Value: A Future returning a List of GeocodeResult

Implementation

Future<List<GeocodeResult>> geocode({
  required String searchText,
  GeocodeParameters? parameters,
}) {
  final coreSearchText = _CString(searchText);
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_LocatorTask_geocodeWithParameters(
      _handle,
      coreSearchText.bytes,
      parameters?._handle ?? ffi.nullptr,
      errorHandler,
    );
  });
  return taskHandle.toFuture(
    (element) => element.getValueAsList()!,
  );
}