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 deprecatedAFCore.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
- Android (Kotlin)
- iOS (Swift)
lifecycleScope.launch {
val page = AFCore.locations().getLocationsByRadius(
centerLatitude = here.latitude,
centerLongitude = here.longitude,
radiusMiles = 5.0
)
showPins(page.items)
}
let everything = AdvancedLocationFilter(
categoryCodes: [], categoryIds: [], includeChildCategories: true,
typeCodes: [], typeIds: [], amenities: [], amenitiesMode: "any", status: [],
favoritesOnly: false, excludeMuted: false, query: nil, limit: 200
)
let page = try await AFCore.shared.locations().getLocationsByRadius(
centerLatitude: here.coordinate.latitude,
centerLongitude: here.coordinate.longitude,
radiusMiles: 5,
filter: everything
)
showPins(page.items)
Learn more
- Locations for map search, favorites and visit detection.
- API Reference for
locations()and the deprecatedmap()calls. - Complete integration guides, including a full map screen, are in AIDE Docs.