getLocationsByRadius

abstract suspend fun getLocationsByRadius(centerLatitude: Double, centerLongitude: Double, radiusMiles: Double = 5.0, filter: AdvancedLocationFilter = AdvancedLocationFilter()): LocationsPage

Retrieves advanced location markers within a radius of a center point - the full place record, filterable by category, type, amenity and status.

Use it for a "near me" list or a map's first load around the member - it replaces map().getNearbyFacilities(...). Each marker's position.distanceMiles carries its distance from the center.

Android (Kotlin)

lifecycleScope.launch {
try {
val page = AFCore.locations().getLocationsByRadius(
centerLatitude = here.latitude,
centerLongitude = here.longitude,
radiusMiles = 10.0
)
showNearby(page.items)
} catch (t: Throwable) {
showRetry(t)
}
}

iOS (Swift)

Task {
do {
// mapFilter: an AdvancedLocationFilter built once, every argument spelled out
let page = try await AFCore.shared.locations().getLocationsByRadius(
centerLatitude: here.latitude, centerLongitude: here.longitude,
radiusMiles: 10, filter: mapFilter
)
showNearby(page.items)
} catch {
showRetry(error)
}
}

Return

The requested LocationsPage.

Parameters

centerLatitude

Latitude of the search center.

centerLongitude

Longitude of the search center.

radiusMiles

Search radius in miles. The server takes whole miles, so a fractional value is rounded up (2.5 searches 3 miles); the minimum is 1.

filter

What to include; see AdvancedLocationFilter. Its defaults return every unfiltered marker, muted ones included.

Throws

if the markers cannot be retrieved - an upstream failure answers as an error, never as a map with no pins.