getNearestLocations method

List<Landmark> getNearestLocations(
  1. Coordinates coords
)

Retrieve the set of landmarks on the specified coordinates.

This is a quick synchronous reverse geocoding method.

Parameters

Returns

A Landmark list containing the nearest locations to the specified coordinates. If no landmarks are found, the list will be empty.

Throws

  • An exception if it fails.

Implementation

List<Landmark> getNearestLocations(final Coordinates coords) {
  final OperationResult resultString = objectMethod(
    _pointerId,
    'MapView',
    'getNearestLocations',
    args: coords,
  );

  return LandmarkList.init(resultString['result'], mapId).toList();
}