Skip to main content

Map

A map of places around the member is built on AFCore.locations(): search by radius when the map opens, search the visible region as the member pans or zooms, and save a pin as a favorite so visits there can be credited automatically.

map() is deprecated

AFCore.map() is deprecated but still works, and returns clubs only. Use locations().getLocationsByRadius() in place of getNearbyFacilities() and locations().getLocationsByViewPort() in place of getFacilitiesByViewPort(): they return every kind of place, with its hours, amenities and the member's favorite state. See Locations for the full mapping.

What you can do​

  • Load the places around the member when the map opens.
  • Reload as the member pans or zooms, for the visible region.
  • Filter by category (gyms, stores), type, amenities or name.
  • Save a pin as a favorite with addFavorite().

Example​

lifecycleScope.launch {
val page = AFCore.locations().getLocationsByRadius(
centerLatitude = here.latitude,
centerLongitude = here.longitude,
radiusMiles = 5.0
)
showPins(page.items)
}

Learn more​

  • Locations for map search, favorites and visit detection.
  • API Reference for locations() and the deprecated map() calls.
  • Complete integration guides, including a full map screen, are in AIDE Docs.