getNearestLocations method
- Coordinates coords, {
- List<
int> lmkStoreTypesIds = const <int>[], - int radius = 0,
Retrieves nearby landmarks at specified geographic coordinates.
Performs fast synchronous reverse geocoding to find landmarks near the specified coordinates. This is useful for identifying addresses, points of interest, cities, or roads at or near a given location without performing a full asynchronous search.
Supported landmark store types include LandmarkStoreType.mapAddress, LandmarkStoreType.mapPoi, LandmarkStoreType.mapCity, and LandmarkStoreType.mapRoads.
Parameters
coords: The reference Coordinates for the search center pointlmkStoreTypesIds: List of landmark store type IDs to search (see LandmarkStoreType). If empty, searches all supported landmark stores. Defaults to empty listradius: Search radius in meters around the coordinates. If0, uses an optimal default radius. Defaults to0
Returns
- List of Landmark objects representing the nearest locations to the coordinates, sorted by proximity, or an empty list if none found
See also:
- LandmarkStoreType - Available landmark store types
- cursorSelectionLandmarks - Get landmarks at cursor position
- SearchService - Perform asynchronous landmark searches
Implementation
List<Landmark> getNearestLocations(
Coordinates coords, {
List<int> lmkStoreTypesIds = const <int>[],
int radius = 0,
}) {
final OperationResult resultString = objectMethod(
_pointerId,
'MapView',
'getNearestLocations',
args: <String, Object>{
'coords': coords,
'intList': lmkStoreTypesIds.isNotEmpty
? lmkStoreTypesIds
: <dynamic, dynamic>{},
'radius': radius,
},
);
return LandmarkList.init(resultString['result']).toList();
}