OfflineMapAreas
constOfflineMapAreas:ForwardRefExoticComponent<ViewProps&object&RefAttributes<OfflineMapAreasHandle>>
Defined in: packages/expo-arcgis-toolkit/src/OfflineMapAreas.tsx:60
The ArcGIS Toolkit’s offline map areas: the preplanned map areas of the nearest <Map>’s web map,
and areas the user draws on demand. It downloads them, keeps them on the device, and opens one as
an offline map, which the app shows in a <MapView map>. A panel: lay it out anywhere inside the
<Map>, in a sheet or below the map. The <Map> must be a web map (portalItem) that is enabled
for offline use.
On iOS it needs the expo-arcgis-toolkit config plugin, which permits its background downloads in Info.plist. Without it, it shows nothing. On Android, downloads notify the user: request the notification permission (Android 13+) for that.
const [offlineMap, setOfflineMap] = useState<MapRef | null>(null);
<Map portalItem={{ itemId: '<offline-enabled web map>' }}> <MapView map={offlineMap} style={{ flex: 1 }} /> <OfflineMapAreas onSelectionChange={setOfflineMap} style={{ height: 320 }} /></Map>