This is the abridged developer documentation for expo-arcgis
# Getting started
> Install expo-arcgis and render your first map.
`expo-arcgis` is a native [Expo module](https://docs.expo.dev/modules/overview/) wrapping the ArcGIS Maps SDK for **Kotlin** (Android) and **Swift** (iOS). It is **not** available in Expo Go — use a development build. ## Requirements | | Supported | | ------- | --------------------------------------------------------------------------------------------------------------------------------------- | | Expo | SDK **56**, **57** and **58** (New Architecture) | | iOS | **18.0+**, built with **Xcode 26** or **27** | | Android | **API 28+** (Android 9), compileSdk **37** — Esri deprecated API 28 in ArcGIS 300.1; the next SDK release requires API 29 | | Auth | An [ArcGIS API key](https://developers.arcgis.com/documentation/security-and-authentication/api-key-authentication/) (or token / OAuth) | Every change is built in a fresh app on each supported Expo SDK — Android, iOS, and a typecheck + bundle — so the table is what CI checks, not a guess: | Expo SDK | React Native | | -------- | ---------------------------------------- | | 58 | 0.88 (verified on the beta, 0.88.0-rc.3) | | 57 | 0.86 | | 56 | 0.85 | The iOS and Android minimums come from ArcGIS Maps SDK 300.1; the config plugin raises your app to them. On **Xcode 27**, Expo SDK 56 builds only from **56.0.23** on (`npx expo install --fix`) — earlier `expo-modules-jsi` releases don’t compile with its Swift. ## Install
```sh
npx expo install expo-arcgis
```
Add the config plugin to your app config. It wires the Esri Maven repository (Android), raises `minSdk` / `compileSdk` and the iOS deployment target, and (optionally) injects your API key. app.config.js
```js
module.exports = {
expo: {
plugins: [['expo-arcgis', { apiKey: process.env.ARCGIS_API_KEY }]],
},
};
```
Then regenerate the native projects:
```sh
npx expo prebuild --clean
```
## Your first map The API is declarative and mirrors the ArcGIS SDK object model — a `` model inside a `` host, wrapped in ``:
```tsx
import { MapSettings, Map, MapView } from 'expo-arcgis';
export function Screen() {
return (
console.log('loaded')} />
);
}
```
3D works the same way with `` + ``. See the **Samples** for each capability. ## Next: the Toolkit The ArcGIS Toolkit’s components (a compass, a scalebar, search, popups, feature forms, offline map areas, sign-in, augmented reality and more) are in `expo-arcgis-toolkit`:
```sh
npx expo install expo-arcgis-toolkit
```
Add its config plugin after expo-arcgis’s (`plugins: [['expo-arcgis', { … }], 'expo-arcgis-toolkit']`), prebuild again, and put components in your view:
```tsx
import { Map, MapView } from 'expo-arcgis';
import { Compass, Scalebar } from 'expo-arcgis-toolkit';
```
The [Toolkit guide](/guides/toolkit/) lists every component. A few exist on one platform only: see [Platform differences](/guides/platform-differences/). ## With an AI agent Install the packages’ skills, so that Claude Code, Codex, Cursor and other coding agents write expo-arcgis code, not ArcGIS JavaScript code. [AI agents](/guides/ai-agents/) shows how for each agent.
# Concepts
> How the declarative, SDK-faithful API is organized.
`expo-arcgis` mirrors the ArcGIS Maps SDK object model as React components — one component per SDK class. If you know the ArcGIS SDK, the component names and props will feel familiar; if you know React, the composition will. ## Models and views The map is split into a **model** and a **view host**, exactly like the SDK: * `` / `` — the model (basemap, layers, initial viewpoint / camera). * `` / `` — the host that renders the model. This is the only real native view.
```tsx
```
## Global settings `` applies global configuration — most importantly the API key — to everything inside it. Place it once near the root (or set the key imperatively with `ExpoArcgis.setApiKey()`).
```tsx
{/* maps and scenes */}
```
## Layers and graphics are children Operational layers belong to the model: declare them as children of `` / ``. Overlays and editors belong to the view, as in the SDK: ``, ``, `` (which holds the 3D analyses), `` and `` go between `` and ` ` (or `` and ` `). Add or remove any of them by rendering them conditionally.
```tsx
```
Composition is wired through React Context — a child finds its parent `` / `` and attaches itself. You don’t pass handles around manually. A `` is itself a layer **and** a layer host: any layers you nest inside it join the group as a single unit instead of attaching to the map directly.
```tsx
```
Layers and graphics carry the full symbology model: simple, picture, text, 3D scene and **composite** symbols; simple, unique-value and class-breaks **renderers** with optional **visual variables** (data-driven size / colour / rotation / opacity) and **dictionary renderers** for military / utility symbology; plus client-side and scale-dependent display filters, and per-layer `minScale` / `maxScale` visibility. 3D point clouds have their own renderer and filter model. A `` takes an `rgb`, `class-breaks`, `stretch` or `unique-value` `renderer` — each reading one attribute, with optional `sizeAlgorithm`, `pointsPerInch` and attribute-driven `colorModulation` — plus `filters` that hide points by value, LiDAR return, or bitfield.
```tsx
```
## Refs for imperative operations Some operations act on a specific object at runtime — querying a layer, editing features, identifying on a view, tracing a utility network. Reach those through a `ref`:
```tsx
const layer = useRef(null);
// ...
;
// ...
const count = await layer.current?.queryFeatureCount({ whereClause: 'POP > 5000000' });
```
A handle exposes the object’s full runtime surface. On a `` that includes batch editing — make several edits with `apply: false`, then push them at once with `applyEdits()` (or discard with `undoLocalEdits()`) — `queryRelatedFeatures(objectId)`, and attachment CRUD (`queryAttachments` / `addAttachment` / `fetchAttachment` / `deleteAttachment`). A `` / `` handle adds `identifyPopups(screenPoint)`, which returns each tapped feature’s evaluated popup title and fields. A `` handle adds `queryObservations(id)` for an entity’s recent track. A `` handle adds `getAttributes()`, which loads the layer and reports the attributes available to renderers and filters. A `` handle adds `validateNetworkTopology(extent)`, `getState()` and `getTerminalConfigurations()`. ## Namespaces (no view needed) Service operations that don’t belong to a view live on namespaces you can call from anywhere: `geometryEngine`, `coordinateFormatter`, `geocoder` (including `suggest` → `geocodeSuggestion` for a precise suggestion round-trip), `router`, `geoprocessor`, `offline`, and `auth` (API key, token / per-service / OAuth credentials, and sign-out).
```ts
const buffered = geometryEngine.geodesicBuffer(point, 500, 'meters');
const [match] = await geocoder.geocode('Los Angeles, CA');
```
## Long-running jobs Offline downloads and geoprocessing return a **`JobRef`** — observe its progress, await its result, or cancel it.
```ts
const job = await offline.generateOfflineMap(itemId, area, 'offline1');
const subscription = job.addListener('onProgress', ({ progress }) => console.log(`${progress}%`));
const { path } = await job.result();
subscription.remove();
```
See the [Samples](/samples/display-map/) for a runnable screen behind each capability, and the [API Reference](/api/readme/) for every component and type.
# Toolkit
> The ArcGIS Maps SDK Toolkits' components for expo-arcgis — compass, search, popups, forms, offline areas, sign-in, augmented reality and more.
`expo-arcgis-toolkit` brings the components of the ArcGIS Maps SDK Toolkits ([Swift](https://github.com/Esri/arcgis-maps-sdk-swift-toolkit), [Kotlin](https://github.com/Esri/arcgis-maps-sdk-kotlin-toolkit)) to expo-arcgis. Each component is the Toolkit’s own native view, driven by your `` / `` and `` / ``. The look and the behavior are Esri’s, and the props are the Toolkit’s settings, with its names and defaults. ## Install
```sh
npx expo install expo-arcgis expo-arcgis-toolkit
```
It builds on expo-arcgis: set that up first ([Getting started](/guides/getting-started/)). Then add this package’s config plugin after expo-arcgis’s, and regenerate the native projects: app.config.js
```js
module.exports = {
expo: {
plugins: [
['expo-arcgis', { apiKey: process.env.ARCGIS_API_KEY }],
'expo-arcgis-toolkit',
],
},
};
```
```sh
npx expo prebuild --clean
```
### Config plugin options By default, the plugin adds: * the iOS camera and microphone descriptions, for the feature form’s attachments and barcodes; * for `OfflineMapAreas`, the iOS background task identifiers and background fetch, and the Android download permissions. On Android 13+, request the notification permission at runtime to see the download progress. | Option | What it does | | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `cameraUsageDescription`, `microphoneUsageDescription` | Your own wording for the descriptions; `false` leaves one out. | | `offlineMapAreas: false` | Leaves out what `OfflineMapAreas` needs. | | `jobManager: true` | Permits the background task of the job manager (`jobManager`, iOS). | | `oAuthRedirectUris: ['my-app://auth']` | Declares the Kotlin Toolkit’s `AuthenticationActivity` for these redirect URIs. `Authenticator`’s OAuth and IAP sign-ins need it on Android. Give them a scheme of their own, not the app’s `scheme`. | | `ar: true` | What the augmented reality views need. On iOS, that is the camera and location descriptions. On Android, it is the camera and location permissions, plus ARCore’s entry. | | `ar: { arcore: 'required' }` | Makes ARCore required, so Google Play shows the app on ARCore devices only. It is optional by default. | | `ar: { arcoreApiKey }` | The Google Cloud API key for the world-scale view’s `geospatial` tracking. | ## Components | Component | Kind | iOS | Android | Sample | | --------------------- | ----------------------------------------------------------- | --- | ------- | -------------------------------------------------------------------------------------------------------------------- | | `Compass` | over a map or scene view | ✓ | ✓ | [Compass and scalebar](/samples/toolkit-compass-scalebar/), [Scene accessories](/samples/toolkit-scene-accessories/) | | `Scalebar` | over a map view | ✓ | ✓ | [Compass and scalebar](/samples/toolkit-compass-scalebar/) | | `OverviewMap` | over a map or scene view | ✓ | — | [Overview map](/samples/toolkit-overview-map/) | | `LocationButton` | over a map view | ✓ | — | [Location button](/samples/toolkit-location-button/) | | `FloorFilter` | over a map or scene view (floor-aware data) | ✓ | ✓ | [Floor filter](/samples/toolkit-floor-filter/) | | `BasemapGallery` | panel for a map | ✓ | ✓ | [Basemap gallery](/samples/toolkit-basemap-gallery/) | | `Bookmarks` | panel for a map or scene view | ✓ | — | [Bookmarks](/samples/toolkit-bookmarks/) | | `Legend` | panel for a map or scene view | — | ✓ | [Legend](/samples/toolkit-legend/) | | `Search` | panel for a map or scene view | ✓ | — | [Search](/samples/toolkit-search/) | | `FloatingPanel` | panel with React content, floating over a map or scene view | ✓ | — | [Floating panel](/samples/toolkit-floating-panel/) | | `BuildingExplorer` | panel for a local scene view | ✓ | — | [Building explorer](/samples/toolkit-building-explorer/) | | `UtilityNetworkTrace` | panel for a map view (utility networks) | ✓ | ✓ | [Utility network trace](/samples/toolkit-utility-network-trace/) | | `PopupView` | panel (a popup from `identifyPopups`) | ✓ | ✓ | [Popup](/samples/toolkit-popup/) | | `FeatureFormView` | panel (a feature from `identify`) | ✓ | ✓ | [Feature form](/samples/toolkit-feature-form/) | | `OfflineMapAreas` | panel for a web map (``) | ✓ | ✓ | [Offline map areas](/samples/toolkit-offline-map-areas/) | | `jobManager` | app-level: keeps long jobs across launches | ✓ | — | [Job manager](/samples/toolkit-job-manager/) | | `Authenticator` | app-level: prompts for authentication challenges | ✓ | ✓ | [Authenticator](/samples/toolkit-authenticator/) | | `TableTopSceneView` | augmented reality: the scene on a table | ✓ | ✓ | [AR tabletop](/samples/toolkit-ar-tabletop/) | | `FlyoverSceneView` | augmented reality: fly over the scene | ✓ | ✓ | [AR flyover](/samples/toolkit-ar-flyover/) | | `WorldScaleSceneView` | augmented reality: the scene in the world around you | ✓ | ✓ | [AR world scale](/samples/toolkit-ar-world-scale/) | A component that the Toolkit has on one platform only renders nothing on the other platform, and warns once in development. An API that one platform lacks does nothing there. The [Platform differences](/guides/platform-differences/) page lists them, with the settings that differ. Every component, prop and type is in the [Toolkit API reference](/api-toolkit/readme/). ## Where components go **Over a view.** `Compass`, `Scalebar`, `OverviewMap`, `LocationButton` and `FloorFilter` go inside the `` or ``. The view draws them over the map at their `alignment`, keeping its `contentInsets` clear. **Panels** are views of their own, which you lay out: * A panel for a map, such as `BasemapGallery`, goes anywhere inside the ``. * A panel for a view, such as `Bookmarks`, `Legend`, `Search`, `BuildingExplorer` or `UtilityNetworkTrace`, goes inside its `` / ``, over the map. It can also go anywhere else, with the view’s ref as its `geoView`. * `PopupView` and `FeatureFormView` show what `identifyPopups` and `identify` found: pass the result’s `ref`.
```tsx
import { Map, MapView, type MapViewHandle } from 'expo-arcgis';
import { Bookmarks, Compass, Scalebar } from 'expo-arcgis-toolkit';
import { useRef } from 'react';
export default function App() {
const mapView = useRef(null);
return (
<>
' }}>
{/* Outside the view: bound to it by its ref. */}
>
);
}
```
## Floating panel `` shows your React content in the Toolkit’s floating panel (iOS). Inside a `` or ``, it floats over the view, and touches outside the panel reach the map. The layout depends on the size class: * In portrait, it rests at the bottom of the view, like a sheet. * Elsewhere, it floats at the top, placed by `horizontalAlignment` and at most `maxWidth` wide. The user drags its handle between the `'summary'`, `'half'` and `'full'` detents. The panel decides the content’s size, and React lays the content out in it: give the content `flex: 1` to fill it.
```tsx
const [detent, setDetent] = useState('half');
```
## Authenticator `` goes once at the root of the app. While it is mounted, it handles the authentication challenges and shows the Toolkit’s prompts: * a username and password, for token-secured services and IWA servers; * the portal’s sign-in page, for a portal in `oAuthUserConfigurations`; * the IAP sign-in, for a host in `iapConfigurations`; * whether to trust an untrusted host, on iOS with `promptForUntrustedHosts`; * which client certificate to use.
```tsx
import { MapSettings, enablePersistentCredentialStore } from 'expo-arcgis';
import { Authenticator } from 'expo-arcgis-toolkit';
enablePersistentCredentialStore(); // keeps the sign-ins across launches
export default function RootLayout() {
return (
', redirectUrl: 'my-app://auth' },
]}
/>
);
}
```
It takes the place of expo-arcgis’s challenge handlers, and it hands the challenges back when it unmounts. Its ref’s `signOut()` is the Toolkit’s sign-out: it revokes the OAuth tokens, signs out of the IAPs and clears the credential stores. On iOS, App Transport Security rejects an untrusted host before the SDK can ask. Allow the host in Info.plist first (`NSAppTransportSecurity › NSExceptionDomains`), and keep Expo’s `NSAllowsLocalNetworking`: the development build loads its JavaScript from the local network. ## Augmented reality `TableTopSceneView`, `FlyoverSceneView` and `WorldScaleSceneView` are expo-arcgis’s `` shown in augmented reality: iOS uses ARKit, Android ARCore. * Place one inside a ``. * Overlays go inside it, and its events (`onTap`…) and ref (`identify`…) work as a scene view’s do. * The device’s movement controls the camera, so `camera` and `cameraController` don’t apply. For the camera feed to show through the scene, make the scene’s surface transparent. Tabletop and world-scale views also need a camera that can go below the surface:
```tsx
import { Scene, SceneLayer } from 'expo-arcgis';
import { TableTopSceneView } from 'expo-arcgis-toolkit';
```
AR needs a device: the iOS simulator has no ARKit, and an Android emulator has no ARCore unless Google Play Services for AR is installed. The Android views report why they failed to initialize (`onInitializationStatusChange`). ## With an AI agent The `expo-arcgis-toolkit` skill teaches coding agents these components: where each goes, its props and its platforms. Install it with the `expo-arcgis` skill: see [AI agents](/guides/ai-agents/).
# expo-arcgis-toolkit
## Type Aliases * [AccessoryAlignment](/api-toolkit/type-aliases/accessoryalignment/) * [ArInitializationStatus](/api-toolkit/type-aliases/arinitializationstatus/) * [ArLocation](/api-toolkit/type-aliases/arlocation/) * [ArSceneViewProps](/api-toolkit/type-aliases/arsceneviewprops/) * [AuthenticatorHandle](/api-toolkit/type-aliases/authenticatorhandle/) * [AuthenticatorProps](/api-toolkit/type-aliases/authenticatorprops/) * [BasemapGalleryProps](/api-toolkit/type-aliases/basemapgalleryprops/) * [Bookmark](/api-toolkit/type-aliases/bookmark/) * [BookmarksProps](/api-toolkit/type-aliases/bookmarksprops/) * [BuildingExplorerProps](/api-toolkit/type-aliases/buildingexplorerprops/) * [BuildingExplorerSelection](/api-toolkit/type-aliases/buildingexplorerselection/) * [CalibrationButtonAlignment](/api-toolkit/type-aliases/calibrationbuttonalignment/) * [CompassProps](/api-toolkit/type-aliases/compassprops/) * [FeatureFormEditingEvent](/api-toolkit/type-aliases/featureformeditingevent/) * [FeatureFormViewProps](/api-toolkit/type-aliases/featureformviewprops/) * [FloatingPanelDetent](/api-toolkit/type-aliases/floatingpaneldetent/) * [FloatingPanelProps](/api-toolkit/type-aliases/floatingpanelprops/) * [FloorFilterProps](/api-toolkit/type-aliases/floorfilterprops/) * [FloorFilterSelection](/api-toolkit/type-aliases/floorfilterselection/) * [FloorFilterUIProperties](/api-toolkit/type-aliases/floorfilteruiproperties/) * [FlyoverSceneViewProps](/api-toolkit/type-aliases/flyoversceneviewprops/) * [IapAuthorizationPromptType](/api-toolkit/type-aliases/iapauthorizationprompttype/) * [IapConfiguration](/api-toolkit/type-aliases/iapconfiguration/) * [LegendProps](/api-toolkit/type-aliases/legendprops/) * [LegendTextStyle](/api-toolkit/type-aliases/legendtextstyle/) * [LocationButtonProps](/api-toolkit/type-aliases/locationbuttonprops/) * [OAuthUserConfiguration](/api-toolkit/type-aliases/oauthuserconfiguration/) * [OfflineMapAreasHandle](/api-toolkit/type-aliases/offlinemapareashandle/) * [OfflineMapAreasProps](/api-toolkit/type-aliases/offlinemapareasprops/) * [OverviewMapProps](/api-toolkit/type-aliases/overviewmapprops/) * [PopupViewProps](/api-toolkit/type-aliases/popupviewprops/) * [ScalebarProps](/api-toolkit/type-aliases/scalebarprops/) * [ScalebarStyle](/api-toolkit/type-aliases/scalebarstyle/) * [SearchProps](/api-toolkit/type-aliases/searchprops/) * [SearchSource](/api-toolkit/type-aliases/searchsource/) * [TableTopSceneViewProps](/api-toolkit/type-aliases/tabletopsceneviewprops/) * [UtilityNetworkTraceProps](/api-toolkit/type-aliases/utilitynetworktraceprops/) * [WorldScaleSceneViewProps](/api-toolkit/type-aliases/worldscalesceneviewprops/) ## Variables * [Authenticator](/api-toolkit/variables/authenticator/) * [FlyoverSceneView](/api-toolkit/variables/flyoversceneview/) * [jobManager](/api-toolkit/variables/jobmanager/) * [OfflineMapAreas](/api-toolkit/variables/offlinemapareas/) * [TableTopSceneView](/api-toolkit/variables/tabletopsceneview/) * [WorldScaleSceneView](/api-toolkit/variables/worldscalesceneview/) ## Functions * [BasemapGallery](/api-toolkit/functions/basemapgallery/) * [Bookmarks](/api-toolkit/functions/bookmarks/) * [BuildingExplorer](/api-toolkit/functions/buildingexplorer/) * [Compass](/api-toolkit/functions/compass/) * [FeatureFormView](/api-toolkit/functions/featureformview/) * [FloatingPanel](/api-toolkit/functions/floatingpanel/) * [FloorFilter](/api-toolkit/functions/floorfilter/) * [Legend](/api-toolkit/functions/legend/) * [LocationButton](/api-toolkit/functions/locationbutton/) * [OverviewMap](/api-toolkit/functions/overviewmap/) * [PopupView](/api-toolkit/functions/popupview/) * [Scalebar](/api-toolkit/functions/scalebar/) * [Search](/api-toolkit/functions/search/) * [UtilityNetworkTrace](/api-toolkit/functions/utilitynetworktrace/)
# expo-arcgis
API reference # Every component, type and helper. Generated from the TypeScript source — interfaces, type aliases, the component variables you render, and the imperative functions and hooks behind them. ## [Variables](/api/readme/#variables) [35](/api/readme/#variables) [The renderable component objects — the things you actually mount in JSX.](/api/readme/#variables) [MapView SceneView FeatureLayer VectorTileLayer geometryEngine](/api/readme/#variables) ## [Functions](/api/readme/#functions) [25](/api/readme/#functions) [Component factories, auth helpers and the hooks that hand you imperative view & model handles.](/api/readme/#functions) [Map Scene useGeoView signInWithOAuth Viewshed](/api/readme/#functions) ## [Type Aliases](/api/readme/#type-aliases) [204](/api/readme/#type-aliases) [Every prop bag, geometry, symbol and result type the SDK takes or returns.](/api/readme/#type-aliases) [MapViewProps Point Viewpoint RouteResult BasemapStyle](/api/readme/#type-aliases) ## [Interfaces](/api/readme/#interfaces) [7](/api/readme/#interfaces) [The imperative handles you capture with a ref to drive views, models and overlays.](/api/readme/#interfaces) [MapRef SceneRef LayerRef GraphicRef JobRef](/api/readme/#interfaces) *** ## Interfaces * [AnalysisOverlayRef](/api/interfaces/analysisoverlayref/) * [AnalysisRef](/api/interfaces/analysisref/) * [DistanceMeasurementRef](/api/interfaces/distancemeasurementref/) * [DynamicEntityLayerRef](/api/interfaces/dynamicentitylayerref/) * [ExpoArcgisModule](/api/interfaces/expoarcgismodule/) * [FeatureLayerRef](/api/interfaces/featurelayerref/) * [FeatureRef](/api/interfaces/featureref/) * [GeoElementLineOfSightRef](/api/interfaces/geoelementlineofsightref/) * [GeoElementViewshedRef](/api/interfaces/geoelementviewshedref/) * [GeometryEditorRef](/api/interfaces/geometryeditorref/) * [GeoViewRef](/api/interfaces/geoviewref/) * [GraphicRef](/api/interfaces/graphicref/) * [GraphicsOverlayRef](/api/interfaces/graphicsoverlayref/) * [ImageOverlayRef](/api/interfaces/imageoverlayref/) * [JobRef](/api/interfaces/jobref/) * [KmlLayerRef](/api/interfaces/kmllayerref/) * [LayerRef](/api/interfaces/layerref/) * [LineOfSightRef](/api/interfaces/lineofsightref/) * [MapRef](/api/interfaces/mapref/) * [PointCloudLayerRef](/api/interfaces/pointcloudlayerref/) * [PopupRef](/api/interfaces/popupref/) * [RasterLayerRef](/api/interfaces/rasterlayerref/) * [SceneRef](/api/interfaces/sceneref/) * [ServiceGeodatabaseRef](/api/interfaces/servicegeodatabaseref/) * [ViewshedRef](/api/interfaces/viewshedref/) ## Type Aliases * [AccessoryHost](/api/type-aliases/accessoryhost/) * [AnalysisOverlayHost](/api/type-aliases/analysisoverlayhost/) * [AnalysisOverlayProps](/api/type-aliases/analysisoverlayprops/) * [AngularUnit](/api/type-aliases/angularunit/) * [AnnotationLayerProps](/api/type-aliases/annotationlayerprops/) * [AreaUnit](/api/type-aliases/areaunit/) * [AtmosphereEffect](/api/type-aliases/atmosphereeffect/) * [AttachmentInfo](/api/type-aliases/attachmentinfo/) * [BasemapInfo](/api/type-aliases/basemapinfo/) * [BasemapQuery](/api/type-aliases/basemapquery/) * [BasemapStyle](/api/type-aliases/basemapstyle/) * [BuildingSceneLayerProps](/api/type-aliases/buildingscenelayerprops/) * [BuildRasterPyramidsParameters](/api/type-aliases/buildrasterpyramidsparameters/) * [CalloutProps](/api/type-aliases/calloutprops/) * [Camera](/api/type-aliases/camera/) * [CameraController](/api/type-aliases/cameracontroller/) * [ClassBreak](/api/type-aliases/classbreak/) * [ClassBreaksRenderer](/api/type-aliases/classbreaksrenderer/) * [ClusterReduction](/api/type-aliases/clusterreduction/) * [ColorStop](/api/type-aliases/colorstop/) * [ColorVisualVariable](/api/type-aliases/colorvisualvariable/) * [CompositeSymbolType](/api/type-aliases/compositesymboltype/) * [ConnectionStatus](/api/type-aliases/connectionstatus/) * [ContingentValueEntry](/api/type-aliases/contingentvalueentry/) * [ContingentValuesResult](/api/type-aliases/contingentvaluesresult/) * [CreateVersionParams](/api/type-aliases/createversionparams/) * [CustomDynamicSource](/api/type-aliases/customdynamicsource/) * [DictionaryRendererProp](/api/type-aliases/dictionaryrendererprop/) * [DimensionLayerProps](/api/type-aliases/dimensionlayerprops/) * [DirectionManeuver](/api/type-aliases/directionmaneuver/) * [DistanceCompositeSceneSymbol](/api/type-aliases/distancecompositescenesymbol/) * [DistanceMeasurementEvents](/api/type-aliases/distancemeasurementevents/) * [DistanceMeasurementProps](/api/type-aliases/distancemeasurementprops/) * [DistanceMeasurementResult](/api/type-aliases/distancemeasurementresult/) * [DistanceSymbolRange](/api/type-aliases/distancesymbolrange/) * [DynamicEntityChange](/api/type-aliases/dynamicentitychange/) * [DynamicEntityChangeType](/api/type-aliases/dynamicentitychangetype/) * [DynamicEntityField](/api/type-aliases/dynamicentityfield/) * [DynamicEntityInfo](/api/type-aliases/dynamicentityinfo/) * [DynamicEntityLayerEvents](/api/type-aliases/dynamicentitylayerevents/) * [DynamicEntityLayerHandle](/api/type-aliases/dynamicentitylayerhandle/) * [DynamicEntityLayerProps](/api/type-aliases/dynamicentitylayerprops/) * [DynamicEntityObservationInfo](/api/type-aliases/dynamicentityobservationinfo/) * [DynamicEntityPurgeOptions](/api/type-aliases/dynamicentitypurgeoptions/) * [EditResult](/api/type-aliases/editresult/) * [ElevationSource](/api/type-aliases/elevationsource/) * [Envelope](/api/type-aliases/envelope/) * [Feature](/api/type-aliases/feature/) * [FeatureCollectionFeatureSpec](/api/type-aliases/featurecollectionfeaturespec/) * [FeatureCollectionField](/api/type-aliases/featurecollectionfield/) * [FeatureCollectionLayerProps](/api/type-aliases/featurecollectionlayerprops/) * [FeatureLayerHandle](/api/type-aliases/featurelayerhandle/) * [FeatureLayerProps](/api/type-aliases/featurelayerprops/) * [FeatureReduction](/api/type-aliases/featurereduction/) * [FeatureTableSource](/api/type-aliases/featuretablesource/) * [FeatureTemplate](/api/type-aliases/featuretemplate/) * [GeocodeParameters](/api/type-aliases/geocodeparameters/) * [GeocodeResult](/api/type-aliases/geocoderesult/) * [GeodatabaseHandle](/api/type-aliases/geodatabasehandle/) * [GeodesicEllipseParams](/api/type-aliases/geodesicellipseparams/) * [GeodesicGeometryType](/api/type-aliases/geodesicgeometrytype/) * [GeodesicSectorParams](/api/type-aliases/geodesicsectorparams/) * [GeodeticCurveType](/api/type-aliases/geodeticcurvetype/) * [GeodeticDistanceResult](/api/type-aliases/geodeticdistanceresult/) * [GeoElementLineOfSightProps](/api/type-aliases/geoelementlineofsightprops/) * [GeoElementViewshedProps](/api/type-aliases/geoelementviewshedprops/) * [Geometry](/api/type-aliases/geometry/) * [GeometryEditorElementKind](/api/type-aliases/geometryeditorelementkind/) * [GeometryEditorEvents](/api/type-aliases/geometryeditorevents/) * [GeometryEditorHandle](/api/type-aliases/geometryeditorhandle/) * [GeometryEditorHost](/api/type-aliases/geometryeditorhost/) * [GeometryEditorInteractionPreview](/api/type-aliases/geometryeditorinteractionpreview/) * [GeometryEditorInteractionType](/api/type-aliases/geometryeditorinteractiontype/) * [GeometryEditorProps](/api/type-aliases/geometryeditorprops/) * [GeometryEditorTool](/api/type-aliases/geometryeditortool/) * [GeometryEditorType](/api/type-aliases/geometryeditortype/) * [GeometryOffsetType](/api/type-aliases/geometryoffsettype/) * [GeoModelRef](/api/type-aliases/geomodelref/) * [GeoPackageLayerProps](/api/type-aliases/geopackagelayerprops/) * [GeoprocessingInput](/api/type-aliases/geoprocessinginput/) * [GeoprocessingRasterOutput](/api/type-aliases/geoprocessingrasteroutput/) * [GeoprocessingResult](/api/type-aliases/geoprocessingresult/) * [GeoViewHandle](/api/type-aliases/geoviewhandle/) * [GeoViewHost](/api/type-aliases/geoviewhost/) * [GraphicProps](/api/type-aliases/graphicprops/) * [GraphicsOverlayHost](/api/type-aliases/graphicsoverlayhost/) * [GraphicsOverlayProps](/api/type-aliases/graphicsoverlayprops/) * [GridConfig](/api/type-aliases/gridconfig/) * [IdentifiedFeature](/api/type-aliases/identifiedfeature/) * [IdentifyResult](/api/type-aliases/identifyresult/) * [ImageOverlayHost](/api/type-aliases/imageoverlayhost/) * [ImageOverlayProps](/api/type-aliases/imageoverlayprops/) * [InsetsViewpointAdjustment](/api/type-aliases/insetsviewpointadjustment/) * [IntegratedMeshLayerProps](/api/type-aliases/integratedmeshlayerprops/) * [JobEvents](/api/type-aliases/jobevents/) * [KeychainAccess](/api/type-aliases/keychainaccess/) * [KmlLayerHandle](/api/type-aliases/kmllayerhandle/) * [KmlLayerProps](/api/type-aliases/kmllayerprops/) * [KmlNodeInfo](/api/type-aliases/kmlnodeinfo/) * [LabelDefinition](/api/type-aliases/labeldefinition/) * [LatitudeLongitudeFormat](/api/type-aliases/latitudelongitudeformat/) * [LayerProps](/api/type-aliases/layerprops/) * [LinearUnit](/api/type-aliases/linearunit/) * [LineOfSightEvents](/api/type-aliases/lineofsightevents/) * [LineOfSightProps](/api/type-aliases/lineofsightprops/) * [LocalSceneViewHandle](/api/type-aliases/localsceneviewhandle/) * [LocalSceneViewProps](/api/type-aliases/localsceneviewprops/) * [LocationDisplay](/api/type-aliases/locationdisplay/) * [LocationDisplayAutoPanMode](/api/type-aliases/locationdisplayautopanmode/) * [LocationEventPayload](/api/type-aliases/locationeventpayload/) * [MapImageLayerProps](/api/type-aliases/mapimagelayerprops/) * [MapLoadedEventPayload](/api/type-aliases/maploadedeventpayload/) * [MapLoadErrorEventPayload](/api/type-aliases/maploaderroreventpayload/) * [MapProps](/api/type-aliases/mapprops/) * [MapSettingsConfig](/api/type-aliases/mapsettingsconfig/) * [MapSettingsProps](/api/type-aliases/mapsettingsprops/) * [MapViewHandle](/api/type-aliases/mapviewhandle/) * [MapViewInsets](/api/type-aliases/mapviewinsets/) * [MapViewProps](/api/type-aliases/mapviewprops/) * [MgrsConversionMode](/api/type-aliases/mgrsconversionmode/) * [ModelSceneSymbol](/api/type-aliases/modelscenesymbol/) * [MultilayerPointSymbolType](/api/type-aliases/multilayerpointsymboltype/) * [Multipoint](/api/type-aliases/multipoint/) * [OfflineGeodatabaseResult](/api/type-aliases/offlinegeodatabaseresult/) * [OfflineMapParameterOverrides](/api/type-aliases/offlinemapparameteroverrides/) * [OfflineMapResult](/api/type-aliases/offlinemapresult/) * [OfflineTileResult](/api/type-aliases/offlinetileresult/) * [Ogc3DTilesLayerProps](/api/type-aliases/ogc3dtileslayerprops/) * [OgcFeatureLayerProps](/api/type-aliases/ogcfeaturelayerprops/) * [OpacityStop](/api/type-aliases/opacitystop/) * [OpacityVisualVariable](/api/type-aliases/opacityvisualvariable/) * [OpenAuthSession](/api/type-aliases/openauthsession/) * [OpenStreetMapLayerProps](/api/type-aliases/openstreetmaplayerprops/) * [OrderByField](/api/type-aliases/orderbyfield/) * [OrientedImageryLayerProps](/api/type-aliases/orientedimagerylayerprops/) * [PersistentCredentialStoreOptions](/api/type-aliases/persistentcredentialstoreoptions/) * [PictureFillSymbol](/api/type-aliases/picturefillsymbol/) * [PictureMarkerSymbol](/api/type-aliases/picturemarkersymbol/) * [PictureMarkerSymbolLayerSpec](/api/type-aliases/picturemarkersymbollayerspec/) * [Point](/api/type-aliases/point/) * [PointCloudAttribute](/api/type-aliases/pointcloudattribute/) * [PointCloudAttributeTransformType](/api/type-aliases/pointcloudattributetransformtype/) * [PointCloudColorClassBreak](/api/type-aliases/pointcloudcolorclassbreak/) * [PointCloudColorModulation](/api/type-aliases/pointcloudcolormodulation/) * [PointCloudColorStop](/api/type-aliases/pointcloudcolorstop/) * [PointCloudColorUniqueValue](/api/type-aliases/pointcloudcoloruniquevalue/) * [PointCloudFilter](/api/type-aliases/pointcloudfilter/) * [PointCloudLayerHandle](/api/type-aliases/pointcloudlayerhandle/) * [PointCloudLayerProps](/api/type-aliases/pointcloudlayerprops/) * [PointCloudRenderer](/api/type-aliases/pointcloudrenderer/) * [PointCloudRendererBase](/api/type-aliases/pointcloudrendererbase/) * [PointCloudReturnType](/api/type-aliases/pointcloudreturntype/) * [PointCloudSizeAlgorithm](/api/type-aliases/pointcloudsizealgorithm/) * [PointGeometry](/api/type-aliases/pointgeometry/) * [Polygon](/api/type-aliases/polygon/) * [Polyline](/api/type-aliases/polyline/) * [PolylineGeometry](/api/type-aliases/polylinegeometry/) * [PopupMediaInfo](/api/type-aliases/popupmediainfo/) * [PopupResult](/api/type-aliases/popupresult/) * [PortalItem](/api/type-aliases/portalitem/) * [PortalItemInfo](/api/type-aliases/portaliteminfo/) * [PortalQuery](/api/type-aliases/portalquery/) * [PreplannedMapAreaInfo](/api/type-aliases/preplannedmapareainfo/) * [ProximityResult](/api/type-aliases/proximityresult/) * [QueryParameters](/api/type-aliases/queryparameters/) * [RasterLayerHandle](/api/type-aliases/rasterlayerhandle/) * [RasterLayerProps](/api/type-aliases/rasterlayerprops/) * [RasterPyramidCompressionType](/api/type-aliases/rasterpyramidcompressiontype/) * [RasterPyramidInfo](/api/type-aliases/rasterpyramidinfo/) * [RasterResamplingType](/api/type-aliases/rasterresamplingtype/) * [RasterSource](/api/type-aliases/rastersource/) * [RelatedFeaturesResult](/api/type-aliases/relatedfeaturesresult/) * [Renderer](/api/type-aliases/renderer/) * [ReverseGeocodeParameters](/api/type-aliases/reversegeocodeparameters/) * [RotationVisualVariable](/api/type-aliases/rotationvisualvariable/) * [Route](/api/type-aliases/route/) * [RouteParameters](/api/type-aliases/routeparameters/) * [RouteResult](/api/type-aliases/routeresult/) * [RouteStop](/api/type-aliases/routestop/) * [RouteTrackerHandle](/api/type-aliases/routetrackerhandle/) * [RouteTrackingStatus](/api/type-aliases/routetrackingstatus/) * [SceneLayerProps](/api/type-aliases/scenelayerprops/) * [SceneProperties](/api/type-aliases/sceneproperties/) * [SceneProps](/api/type-aliases/sceneprops/) * [SceneViewContainer](/api/type-aliases/sceneviewcontainer/) * [SceneViewHandle](/api/type-aliases/sceneviewhandle/) * [SceneViewProps](/api/type-aliases/sceneviewprops/) * [ScreenPoint](/api/type-aliases/screenpoint/) * [ServiceAreaPolygon](/api/type-aliases/serviceareapolygon/) * [ServiceAreaResult](/api/type-aliases/servicearearesult/) * [ServiceAreaSolveParams](/api/type-aliases/serviceareasolveparams/) * [ServiceGeodatabaseHandle](/api/type-aliases/servicegeodatabasehandle/) * [ServiceVersionInfo](/api/type-aliases/serviceversioninfo/) * [SharedTemplateInfo](/api/type-aliases/sharedtemplateinfo/) * [SharedTemplateRelationship](/api/type-aliases/sharedtemplaterelationship/) * [SimpleFillSymbol](/api/type-aliases/simplefillsymbol/) * [SimpleFillSymbolStyle](/api/type-aliases/simplefillsymbolstyle/) * [SimpleLineSymbol](/api/type-aliases/simplelinesymbol/) * [SimpleLineSymbolStyle](/api/type-aliases/simplelinesymbolstyle/) * [SimpleMarkerSceneSymbol](/api/type-aliases/simplemarkerscenesymbol/) * [SimpleMarkerSymbol](/api/type-aliases/simplemarkersymbol/) * [SimpleMarkerSymbolStyle](/api/type-aliases/simplemarkersymbolstyle/) * [SimpleRenderer](/api/type-aliases/simplerenderer/) * [SizeStop](/api/type-aliases/sizestop/) * [SizeVisualVariable](/api/type-aliases/sizevisualvariable/) * [SpatialReference](/api/type-aliases/spatialreference/) * [SpatialRelationship](/api/type-aliases/spatialrelationship/) * [StatisticDefinition](/api/type-aliases/statisticdefinition/) * [StatisticRecord](/api/type-aliases/statisticrecord/) * [StatisticsQueryParameters](/api/type-aliases/statisticsqueryparameters/) * [StatisticType](/api/type-aliases/statistictype/) * [Stroke](/api/type-aliases/stroke/) * [SubtypeFeatureLayerProps](/api/type-aliases/subtypefeaturelayerprops/) * [SuggestParameters](/api/type-aliases/suggestparameters/) * [SuggestResult](/api/type-aliases/suggestresult/) * [SunLighting](/api/type-aliases/sunlighting/) * [Surface](/api/type-aliases/surface/) * [SurfacePlacement](/api/type-aliases/surfaceplacement/) * [Symbol](/api/type-aliases/symbol/) * [SymbolLayerSpec](/api/type-aliases/symbollayerspec/) * [TapEventPayload](/api/type-aliases/tapeventpayload/) * [TargetVisibility](/api/type-aliases/targetvisibility/) * [TextSymbol](/api/type-aliases/textsymbol/) * [TileCacheSizeEstimate](/api/type-aliases/tilecachesizeestimate/) * [TileLayerProps](/api/type-aliases/tilelayerprops/) * [TrackDisplay](/api/type-aliases/trackdisplay/) * [TrackedLocation](/api/type-aliases/trackedlocation/) * [UniqueValueInfo](/api/type-aliases/uniquevalueinfo/) * [UniqueValueRenderer](/api/type-aliases/uniquevaluerenderer/) * [UtilityAssociationSummary](/api/type-aliases/utilityassociationsummary/) * [UtilityElementDescriptor](/api/type-aliases/utilityelementdescriptor/) * [UtilityElementInfo](/api/type-aliases/utilityelementinfo/) * [UtilityNamedTraceConfiguration](/api/type-aliases/utilitynamedtraceconfiguration/) * [UtilityNetworkHandle](/api/type-aliases/utilitynetworkhandle/) * [UtilityNetworkProps](/api/type-aliases/utilitynetworkprops/) * [UtilityNetworkState](/api/type-aliases/utilitynetworkstate/) * [UtilityTerminal](/api/type-aliases/utilityterminal/) * [UtilityTerminalConfiguration](/api/type-aliases/utilityterminalconfiguration/) * [UtilityTraceFunctionResult](/api/type-aliases/utilitytracefunctionresult/) * [UtilityTraceResult](/api/type-aliases/utilitytraceresult/) * [UtilityTraceType](/api/type-aliases/utilitytracetype/) * [UtmConversionMode](/api/type-aliases/utmconversionmode/) * [VectorMarkerSymbolLayerSpec](/api/type-aliases/vectormarkersymbollayerspec/) * [VectorTileFeature](/api/type-aliases/vectortilefeature/) * [VectorTileLayerProps](/api/type-aliases/vectortilelayerprops/) * [VectorTileStyleLayerType](/api/type-aliases/vectortilestylelayertype/) * [VersionAccess](/api/type-aliases/versionaccess/) * [Viewpoint](/api/type-aliases/viewpoint/) * [ViewshedProps](/api/type-aliases/viewshedprops/) * [VisualVariable](/api/type-aliases/visualvariable/) * [WebTiledLayerProps](/api/type-aliases/webtiledlayerprops/) * [WfsLayerProps](/api/type-aliases/wfslayerprops/) * [WmsLayerProps](/api/type-aliases/wmslayerprops/) * [WmtsLayerProps](/api/type-aliases/wmtslayerprops/) ## Variables * [AnnotationLayer](/api/variables/annotationlayer/) * [BuildingSceneLayer](/api/variables/buildingscenelayer/) * [coordinateFormatter](/api/variables/coordinateformatter/) * [default](/api/variables/default/) * [DimensionLayer](/api/variables/dimensionlayer/) * [DynamicEntityLayer](/api/variables/dynamicentitylayer/) * [FeatureCollectionLayer](/api/variables/featurecollectionlayer/) * [FeatureLayer](/api/variables/featurelayer/) * [geocoder](/api/variables/geocoder/) * [GeometryEditor](/api/variables/geometryeditor/) * [geometryEngine](/api/variables/geometryengine/) * [GeoPackageLayer](/api/variables/geopackagelayer/) * [geoprocessor](/api/variables/geoprocessor/) * [Graphic](/api/variables/graphic/) * [GraphicsOverlay](/api/variables/graphicsoverlay/) * [IntegratedMeshLayer](/api/variables/integratedmeshlayer/) * [KmlLayer](/api/variables/kmllayer/) * [LocalSceneView](/api/variables/localsceneview/) * [MapView](/api/variables/mapview/) * [offline](/api/variables/offline/) * [Ogc3DTilesLayer](/api/variables/ogc3dtileslayer/) * [OgcFeatureLayer](/api/variables/ogcfeaturelayer/) * [OpenStreetMapLayer](/api/variables/openstreetmaplayer/) * [OrientedImageryLayer](/api/variables/orientedimagerylayer/) * [PointCloudLayer](/api/variables/pointcloudlayer/) * [portal](/api/variables/portal/) * [RasterLayer](/api/variables/rasterlayer/) * [router](/api/variables/router/) * [SceneView](/api/variables/sceneview/) * [serviceArea](/api/variables/servicearea/) * [SubtypeFeatureLayer](/api/variables/subtypefeaturelayer/) * [UtilityNetwork](/api/variables/utilitynetwork/) * [VectorTileLayer](/api/variables/vectortilelayer/) * [WebTiledLayer](/api/variables/webtiledlayer/) * [WfsLayer](/api/variables/wfslayer/) * [WmsLayer](/api/variables/wmslayer/) * [WmtsLayer](/api/variables/wmtslayer/) ## Functions * [AnalysisOverlay](/api/functions/analysisoverlay/) * [Callout](/api/functions/callout/) * [clearCredentialStore](/api/functions/clearcredentialstore/) * [DistanceMeasurement](/api/functions/distancemeasurement/) * [enablePersistentCredentialStore](/api/functions/enablepersistentcredentialstore/) * [GroupLayer](/api/functions/grouplayer/) * [ImageOverlay](/api/functions/imageoverlay/) * [LineOfSight](/api/functions/lineofsight/) * [Map](/api/functions/map/) * [MapImageLayer](/api/functions/mapimagelayer/) * [MapSettings](/api/functions/mapsettings/) * [Scene](/api/functions/scene/) * [SceneLayer](/api/functions/scenelayer/) * [setAllowUntrustedHosts](/api/functions/setallowuntrustedhosts/) * [setAppCredential](/api/functions/setappcredential/) * [setServiceCredential](/api/functions/setservicecredential/) * [setTokenCredential](/api/functions/settokencredential/) * [signInWithOAuth](/api/functions/signinwithoauth/) * [signOut](/api/functions/signout/) * [TileLayer](/api/functions/tilelayer/) * [useGeoModel](/api/functions/usegeomodel/) * [useGeoView](/api/functions/usegeoview/) * [useGeoViewRef](/api/functions/usegeoviewref/) * [useGraphicsOverlay](/api/functions/usegraphicsoverlay/) * [useMapSettings](/api/functions/usemapsettings/) * [Viewshed](/api/functions/viewshed/)
# AI agents
> Install the expo-arcgis and expo-arcgis-toolkit skills in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot and other coding agents, and give them the docs as text.
Coding agents know the ArcGIS Maps SDK for JavaScript far better than expo-arcgis, so they tend to write `@arcgis/core` code. Two things help them write code for these packages: * the packages’ **skills**, which an agent loads when the task needs them; * the docs **as text** (`llms.txt`), for an agent or a chat that reads a URL. ## The skills There is a skill for each package. They follow the open [Agent Skills](https://agentskills.io) format, which most coding agents read. | Skill | What it covers | | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `expo-arcgis` | Setup and the config plugin, maps and scenes, layers, graphics, geometry, editing, query, geocoding, routing, offline, real-time, authentication and 3D analysis. | | `expo-arcgis-toolkit` | The Toolkit’s components, the options of its config plugin, and what each platform has. | An agent reads each skill’s description at the start and loads the rest when the task matches. For the Toolkit, install both skills: it builds on expo-arcgis. The skills are in the repository’s [`skills/`](https://github.com/alex-krassavin/expo-arcgis/tree/main/skills) folder. Each npm package also ships its own skill, for the version you have installed. ## Claude Code Add the repository as a plugin marketplace, then install the plugins:
```text
/plugin marketplace add alex-krassavin/expo-arcgis
/plugin install expo-arcgis@expo-arcgis
/plugin install expo-arcgis-toolkit@expo-arcgis
```
The Toolkit’s plugin depends on the core’s, so installing `expo-arcgis-toolkit` installs both. The same, from a terminal:
```sh
claude plugin marketplace add alex-krassavin/expo-arcgis
claude plugin install expo-arcgis-toolkit@expo-arcgis
```
Claude uses a skill on its own when the task matches it. You can also call one: `/expo-arcgis:expo-arcgis` or `/expo-arcgis-toolkit:expo-arcgis-toolkit`. To get newer skills, run `/plugin marketplace update expo-arcgis`, or turn on auto-update for the marketplace in `/plugin`. ### For a team Add `--scope project` to both commands. Claude Code then records the marketplace and the plugins in the project’s `.claude/settings.json`. Commit it. Each teammate’s Claude Code adds the marketplace once they trust the folder, and each teammate runs the install command once:
```sh
claude plugin install expo-arcgis-toolkit@expo-arcgis --scope project
```
## Codex, Cursor, Gemini CLI, GitHub Copilot and others The [`skills`](https://github.com/vercel-labs/skills) command line installs both skills into the folders your agents read:
```sh
npx skills add alex-krassavin/expo-arcgis
```
It asks which skills to install and for which agents. To answer up front, name them:
```sh
npx skills add alex-krassavin/expo-arcgis --skill '*' --agent codex cursor gemini-cli github-copilot -y
```
The skills go into the project’s `.agents/skills/`, which these agents share. If you also pick Claude Code, the command links them into `.claude/skills/`. Add `-g` to install them for your user instead of the project. `npx skills update` updates them later. The `skills` command sends anonymous install counts to [skills.sh](https://skills.sh). Set `DISABLE_TELEMETRY=1` to turn that off. ### The skill of your installed version The npm packages ship their skills in `node_modules`, so an agent can get the skill of the version you use, not of the repository’s main branch. Install them from there:
```sh
npx skills add ./node_modules/expo-arcgis
npx skills add ./node_modules/expo-arcgis-toolkit
```
A local path sends no telemetry. Run the commands again after you update the packages. ## Copy the folders An agent that only reads a folder needs the skill’s folder copied into it. A skill is its whole folder, `SKILL.md` and `references/`, under the skill’s own name:
```sh
mkdir -p .agents/skills
cp -R node_modules/expo-arcgis/skills/expo-arcgis .agents/skills/
cp -R node_modules/expo-arcgis-toolkit/skills/expo-arcgis-toolkit .agents/skills/
```
Where each agent looks: | Agent | In the project | For your user | | ------------------------------------------------------------------------------------------ | ----------------- | ------------------- | | Claude Code | `.claude/skills/` | `~/.claude/skills/` | | Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, Windsurf, Amp, Goose, Roo Code, Junie | `.agents/skills/` | `~/.agents/skills/` | | Cline | `.cline/skills/` | `~/.cline/skills/` | | Kiro | `.kiro/skills/` | `~/.kiro/skills/` | ## The docs as text The site also serves its pages as plain text, in the [llms.txt](https://llmstxt.org) format: | File | What it has | | ------------------------------------ | ----------------------------------------------------------------------------- | | [`/llms.txt`](/llms.txt) | An index: what the packages are, and a link to each part of the docs. | | [`/llms-full.txt`](/llms-full.txt) | Every page: the guides, the samples and both API references. | | [`/llms-small.txt`](/llms-small.txt) | The guides, the samples and the API indexes, without the page of each symbol. | Give an agent one of these URLs, for example as a docs source in Cursor, or paste it into a chat. The skills point to the docs for what they don’t cover.
# Platform differences
> What the ArcGIS Maps SDKs and Toolkits have on one platform only, and how expo-arcgis and expo-arcgis-toolkit handle it.
The API is the same on iOS and Android. Where the native SDKs or Toolkits differ, it follows each platform’s own, and it doesn’t make up what a platform lacks: * A component that one platform’s Toolkit doesn’t have renders nothing on the other platform, and warns once in development. * A setting that one platform doesn’t have does nothing on the other. * The [API reference](/api/readme/) and the [Toolkit API reference](/api-toolkit/readme/) mark each of them with **Platform**. To show something else on the platform that lacks a component, branch on `Platform.OS`. ## Toolkit components | Component | iOS | Android | | ------------------------------------------------------------------------------------------- | --- | ------- | | `Compass`, `Scalebar`, `FloorFilter`, `BasemapGallery` | ✓ | ✓ | | `PopupView`, `FeatureFormView`, `UtilityNetworkTrace`, `OfflineMapAreas` | ✓ | ✓ | | `Authenticator` | ✓ | ✓ | | `TableTopSceneView`, `FlyoverSceneView`, `WorldScaleSceneView` | ✓ | ✓ | | `OverviewMap`, `LocationButton`, `Bookmarks`, `Search`, `BuildingExplorer`, `FloatingPanel` | ✓ | — | | `jobManager` (its functions do nothing on Android) | ✓ | — | | `Legend` | — | ✓ | ## Settings that differ The Toolkits configure some components differently. Each setting keeps its own platform’s name. | Component | iOS only | Android only | | --------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `FloorFilter` | `automaticSelectionMode`, `automaticSingleSiteSelectionDisabled`, `levelSelectorWidth` | `uiProperties` (colors, button size, which buttons show) | | `FeatureFormView` | `editingButtons` | `showFormActions`, `showCloseIcon` | | `PopupView` | — | `showCloseIcon` | | `Authenticator` | `promptForUntrustedHosts` (the Kotlin Toolkit always asks) | `dismissAll()` on its ref | | `TableTopSceneView` | `coachingOverlayHidden` | `requestCameraPermissionAutomatically`, `onInitializationStatusChange` | | `FlyoverSceneView` | — | `onInitializationStatusChange` | | `WorldScaleSceneView` | `trackingMode`, `calibrationViewHidden`, `calibrationButtonAlignment`, `onCalibratingChange` | `worldScaleTrackingMode`, `onInitializationStatusChange`, `onTrackingErrorChange` | The Swift Toolkit’s AR views report no initialization status, so `onInitializationStatusChange` is Android’s. ## In expo-arcgis | API | iOS only | Android only | | --------------------------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | `` | — | `leaderPosition`, `colors`, `shapes`: the Kotlin Toolkit’s callout styling. The Swift SDK’s callout has the system’s look, and places its leader itself. | | `enablePersistentCredentialStore` | `access`, `synchronizesWithiCloud`: the keychain’s options | — | ## Setting up the app * **iOS: App Transport Security.** ATS rejects an untrusted host before the SDK can ask about it. To trust a host (`setAllowUntrustedHosts`, or the Authenticator’s prompt), allow it in Info.plist under `NSAppTransportSecurity › NSExceptionDomains`. See the [Toolkit guide](/guides/toolkit/#authenticator). * **Android: OAuth and IAP redirects.** The Kotlin Toolkit’s sign-in pages come back to the app through its `AuthenticationActivity`. The toolkit’s config plugin declares it for the redirect URIs in `oAuthRedirectUris`. iOS needs nothing for them. * **Android: offline downloads.** On Android 13+, request the notification permission at runtime to see a download’s progress. * **Augmented reality.** iOS uses ARKit and Android uses ARCore. The config plugin’s `ar` option makes ARCore optional by default, or required. The minimum versions (iOS 18, Android API 28) are in [Getting started](/guides/getting-started/#requirements).
# expo-arcgis
> The native ArcGIS Maps SDK for React Native and Expo: maps and scenes, layers, editing, geocoding, routing, offline and the ArcGIS Toolkit's components.
Native ArcGIS Maps SDK · Expo modules The ArcGIS SDK,\ rewritten as components. ======================== 2D & 3D maps, layers, geometry, editing, query, geocoding, routing, analysis, offline and real-time — for React Native, faithful to the ArcGIS object model. [Getting started](/guides/getting-started/)[View on GitHub](https://github.com/alex-krassavin/expo-arcgis) CoreWith the Toolkit `$ npx expo install expo-arcgis ` `$ npx expo install expo-arcgis expo-arcgis-toolkit ` Declarative by design ## A component tree that mirrors the object model. A `` model lives inside a `` host, with layers and graphics as children. If you know ArcGIS, you already know the API. App.tsx
```
// a Map model inside a MapView host
```
What's in the box 01 ### 2D & 3D, every layer type `` and `` host the full ArcGIS layer set inside declarative `` containers. featuretilevectorrasterWMS / WMTSKMLscenepoint cloudWFS / OGC 02 ### Declarative & SDK-faithful A component API that mirrors the ArcGIS object model — a `` model inside a `` host, with layers and graphics as children. If you know ArcGIS, you already know the API. 03 ### Everything in the box Query, identify, popups, batch & related editing with attachments, geocoding (with suggestion round-trip), routing & turn-by-turn navigation, 3D viewshed / line-of-sight / measurement, geoprocessing, utility networks, real-time dynamic-entity tracking, offline maps and authentication. 04 ### Genuinely native A Kotlin (Android) + Swift (iOS) bridge over ArcGIS Maps SDK 300. Not Expo Go — use a development build. 05 ### The ArcGIS Toolkit, too `expo-arcgis-toolkit` brings the Toolkits' own components to your views: Esri's look and behavior, the Toolkit's settings as props. compassscalebarbasemap gallerysearchpopupsfeature formsoffline map areassign-inaugmented realityfloating panel Running on device ## The same components. Real native maps. Native iOS & Android maps, rendered by the SDK.  iOS · MAPVIEW · 2D  ANDROID · SCENEVIEW · 3D expo-arcgis-toolkit ## The ArcGIS Toolkit's components, native too. Esri's own Toolkit views — search, popups, forms, offline areas, sign-in and augmented reality — driven by your maps and scenes, with the Toolkit's settings as props.  iOS · FLOATINGPANEL  ANDROID · BASEMAPGALLERY  iOS · OFFLINEMAPAREAS [Explore the Toolkit](/guides/toolkit/) ## Start mapping in minutes. Add the module, run a development build, render your first ``. [Read the guide](/guides/getting-started/) Built on the native ArcGIS Maps SDKFor AI agents: [Agent Skills](/guides/ai-agents/) · [llms.txt](/llms.txt)
# Authentication
> Token login, OAuth sign-in and sign-out.
Token login, OAuth sign-in and sign-out.  iOS  Android This is the real source of the example app’s `auth/authentication` screen — run it on a device or simulator to see it live. app/auth/authentication.tsx
```tsx
import { Map, MapView, setTokenCredential, signInWithOAuth, signOut } from 'expo-arcgis';
import { useState } from 'react';
import { Linking } from 'react-native';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
/**
* Authentication entry points: a stored token login, an OAuth user sign-in, and sign-out.
* OAuth needs a registered app's client id + redirect — the placeholders here are illustrative.
*/
export default function Authentication() {
const [status, setStatus] = useState('Token, OAuth or sign-out.');
function tokenLogin() {
// Stored login; the challenge handler authenticates secured services as they load.
setTokenCredential('viewer01', 'I68VGU^nMurF');
setStatus('Token credential stored — secured services authenticate on load');
}
async function oauth() {
setStatus('OAuth: signing in…');
try {
// The module has no browser dependency — the consumer opens the auth session. Here we use
// React Native's Linking; a real app could use expo-web-browser / expo-auth-session.
const openAuthSession = (authorizeUrl: string, redirectUrl: string) =>
new Promise((resolve) => {
const subscription = Linking.addEventListener('url', ({ url }) => {
if (url.startsWith(redirectUrl)) {
subscription.remove();
resolve(url);
}
});
Linking.openURL(authorizeUrl);
});
await signInWithOAuth(
'https://www.arcgis.com',
'YOUR_CLIENT_ID',
'expoarcgisexample://auth',
openAuthSession
);
setStatus('OAuth sign-in ✅ — secured portal items now load');
} catch (e) {
setStatus(`OAuth error: ${String(e)}`);
}
}
return (
signOut()} />
>
}
>
);
}
```
# Bookmarks
> Declare named saved viewpoints and navigate to them.
Declare named saved viewpoints and navigate to them.  iOS  Android This is the real source of the example app’s `basics/bookmarks` screen — run it on a device or simulator to see it live. app/basics/bookmarks.tsx
```tsx
import { Map, MapView, type MapViewHandle, type Viewpoint } from 'expo-arcgis';
import { useRef, useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
// Named saved viewpoints, declared on the map. The buttons read them back and navigate by name
// through the native bookmark API (`getBookmarkNames` / `setBookmark`) — the same calls work against
// a web map's own saved bookmarks.
const BOOKMARKS: { name: string; viewpoint: Viewpoint }[] = [
{ name: 'Los Angeles', viewpoint: { latitude: 34.05, longitude: -118.24, scale: 200_000 } },
{ name: 'San Francisco', viewpoint: { latitude: 37.77, longitude: -122.42, scale: 200_000 } },
{ name: 'New York', viewpoint: { latitude: 40.71, longitude: -74.0, scale: 200_000 } },
];
/** Declares named bookmarks on the map, lists them, and navigates by name via the native handle. */
export default function Bookmarks() {
const view = useRef(null);
const [status, setStatus] = useState('Pick a bookmark.');
const goTo = (name: string) => async () => {
const found = await view.current?.setBookmark(name);
setStatus(found ? name : `${name}: not found`);
};
const list = async () => {
const names = (await view.current?.getBookmarkNames()) ?? [];
setStatus(`Bookmarks: ${names.join(', ') || '—'}`);
};
return (
{BOOKMARKS.map((b) => (
))}
>
}
>
);
}
```
# Branch versioning
> List, create and switch service-geodatabase versions (ArcGIS Enterprise).
List, create and switch service-geodatabase versions (ArcGIS Enterprise).  iOS  Android This is the real source of the example app’s `editing/branch-versioning` screen — run it on a device or simulator to see it live. app/editing/branch-versioning.tsx
```tsx
import {
FeatureLayer,
Map,
MapView,
type FeatureLayerHandle,
type ServiceGeodatabaseHandle,
} from 'expo-arcgis';
import { useRef, useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
// Branch versioning is an ArcGIS *Enterprise* feature — there is no anonymous public branch-versioned
// service. This demo points at a normal hosted service so the flow runs end-to-end: "Connect" works,
// but `supportsBranchVersioning()` reports false and the version operations surface the SDK error.
// To exercise it for real, swap in your own branch-versioned FeatureServer URL and sign in first with
// `auth.setServiceCredential(url, user, pass)` (see the Authentication sample).
const SERVICE = 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0';
/**
* Branch versioning: get the layer's service geodatabase, list / create / switch named versions, and
* push service-wide local edits to the active version. Edit features through the layer with
* `apply: false`, then `applyEdits()` here.
*/
export default function BranchVersioning() {
const layer = useRef(null);
const gdb = useRef(null);
const [status, setStatus] = useState('Tap “Connect”.');
const run = (fn: () => Promise) => () => {
fn().catch((e) => setStatus(String(e)));
};
const requireGdb = () => {
if (!gdb.current) throw new Error('Connect first');
return gdb.current;
};
const connect = run(async () => {
const handle = await layer.current?.getServiceGeodatabase();
if (!handle) return setStatus('Layer not ready');
gdb.current = handle;
const supported = handle.supportsBranchVersioning();
setStatus(
`Connected — version "${handle.getVersionName()}"` +
(supported ? '' : ' · branch versioning NOT supported by this service')
);
});
const versions = run(async () => {
const list = await requireGdb().fetchVersions();
setStatus(`${list.length} version(s): ${list.map((v) => v.name).join(', ') || '—'}`);
});
const create = run(async () => {
const info = await requireGdb().createVersion({ name: `demo_${Date.now()}`, access: 'public' });
setStatus(`Created "${info.name}" (${info.access})`);
});
const switchDefault = run(async () => {
const handle = requireGdb();
if (handle.hasLocalEdits()) return setStatus('Apply or undo local edits first');
await handle.switchVersion(handle.getDefaultVersionName());
setStatus(`Switched to "${handle.getVersionName()}"`);
});
const localEdit = run(async () => {
const id = await layer.current?.addFeature({}, { type: 'point', x: -117.18, y: 34.05 }, false);
setStatus(`Local edit added (#${id ?? '—'}); pending: ${requireGdb().hasLocalEdits()}`);
});
const apply = run(async () => {
const results = await requireGdb().applyEdits();
setStatus(`Applied ${results.length} edit(s) to "${requireGdb().getVersionName()}"`);
});
const undo = run(async () => {
await requireGdb().undoLocalEdits();
setStatus('Local edits discarded');
});
return (
>
}
>
);
}
```
# Buffer
> Geodesic buffer and coordinate formatting.
Geodesic buffer and coordinate formatting.  iOS  Android This is the real source of the example app’s `geometry/buffer` screen — run it on a device or simulator to see it live. app/geometry/buffer.tsx
```tsx
import {
Graphic,
GraphicsOverlay,
Map,
MapView,
coordinateFormatter,
geometryEngine,
type Geometry,
type TapEventPayload,
} from 'expo-arcgis';
import { useState } from 'react';
import { SampleScreen } from '../../src/SampleScreen';
/** Computes a geodesic buffer around the tapped point and reads its lat/long (GeometryEngine + CoordinateFormatter). */
export default function Buffer() {
const [buffer, setBuffer] = useState(null);
const [status, setStatus] = useState('Tap the map to buffer a point.');
function onTap(point: { latitude: number; longitude: number }) {
const geometry = { type: 'point' as const, x: point.longitude, y: point.latitude };
setBuffer(geometryEngine.geodesicBuffer(geometry, 500, 'meters'));
const dms = coordinateFormatter.toLatitudeLongitude(geometry, 'degreesMinutesSeconds', 1);
setStatus(`${dms ?? '—'} · 500 m buffer`);
}
return (
onTap(event.nativeEvent.mapPoint)}>
{buffer && (
)}
);
}
```
# Callout
> The SDK's callout with React content: at a graphic, then where you tap.
The SDK’s callout with React content: at a graphic, then where you tap.  iOS  Android This is the real source of the example app’s `basics/callout` screen — run it on a device or simulator to see it live. app/basics/callout.tsx
```tsx
import { useState } from 'react';
import { Pressable, StyleSheet, Text, View } from 'react-native';
import { Callout, Graphic, GraphicsOverlay, Map, MapView, type GraphicRef } from 'expo-arcgis';
type Location = { latitude: number; longitude: number };
const REDLANDS: Location = { latitude: 34.0565, longitude: -117.1956 };
/**
* The SDK's callout with React content: tap the map, and a callout points at the spot with its
* coordinates and a Close button. Before any tap, it points at a graphic (a `geoElement`).
*/
export default function CalloutSample() {
// The graphic, once mounted: a callback ref, so that the callout re-renders with it.
const [marker, setMarker] = useState(null);
const [tapped, setTapped] = useState(null);
const [closed, setClosed] = useState(false);
const [presses, setPresses] = useState(0);
return (
{
setTapped(nativeEvent.mapPoint);
setClosed(false);
}}
>
{!closed && (
{tapped ? 'You tapped here' : 'Esri, Redlands'}
{(tapped ?? REDLANDS).latitude.toFixed(4)}, {(tapped ?? REDLANDS).longitude.toFixed(4)}
setPresses((n) => n + 1)}>
Pressed {presses}
setClosed(true)}>
Close
)}
);
}
const styles = StyleSheet.create({
callout: { padding: 4, width: 220 },
title: { fontSize: 15, fontWeight: '700', color: '#111827' },
detail: { fontSize: 13, color: '#4b5563', marginTop: 2 },
row: { flexDirection: 'row', gap: 8, marginTop: 8 },
button: { paddingHorizontal: 10, paddingVertical: 6, borderRadius: 8, backgroundColor: '#2563eb' },
buttonText: { color: 'white', fontWeight: '600' },
});
```
# Camera controller
> Orbit a fixed target with an orbit camera controller.
Orbit a fixed target with an orbit camera controller.  iOS  Android This is the real source of the example app’s `three-d/camera-controller` screen — run it on a device or simulator to see it live. app/three-d/camera-controller.tsx
```tsx
import { Scene, SceneView, type Surface } from 'expo-arcgis';
const ELEVATION: Surface = {
elevationSources: [
{ url: 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer' },
],
};
/**
* An orbit camera controller locks the camera onto a fixed target and circles it as you drag —
* ideal for inspecting a site from every side. Pass `{ type: 'globe' }` for free navigation.
*/
export default function CameraController() {
return (
);
}
```
# Change viewpoint
> Animate the map to a new viewpoint at runtime.
Animate the map to a new viewpoint at runtime.  iOS  Android This is the real source of the example app’s `basics/change-viewpoint` screen — run it on a device or simulator to see it live. app/basics/change-viewpoint.tsx
```tsx
import { Map, MapView, type Viewpoint } from 'expo-arcgis';
import { useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
const SANTA_MONICA: Viewpoint = { latitude: 34.027, longitude: -118.805, scale: 72_000 };
const GRIFFITH: Viewpoint = { latitude: 34.1184, longitude: -118.3004, scale: 40_000 };
/** Animates the map to a new viewpoint at runtime via the `viewpoint` prop. */
export default function ChangeViewpoint() {
const [viewpoint, setViewpoint] = useState(SANTA_MONICA);
return (
setViewpoint(SANTA_MONICA)} />
setViewpoint(GRIFFITH)} />
>
}
>
);
}
```
# Class-breaks renderer
> Style a feature layer with graduated symbols by a field.
Style a feature layer with graduated symbols by a field.  iOS  Android This is the real source of the example app’s `symbols/class-breaks-renderer` screen — run it on a device or simulator to see it live. app/symbols/class-breaks-renderer.tsx
```tsx
import { FeatureLayer, Map, MapView, type Renderer } from 'expo-arcgis';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
// Class-breaks renderer — graduated circles by the POP (population) field.
const CITIES_RENDERER: Renderer = {
type: 'class-breaks',
field: 'POP',
classBreaks: [
{ min: 0, max: 1_000_000, symbol: { type: 'simple-marker', color: '#2c7fb8', size: 6 }, label: '< 1M' },
{ min: 1_000_000, max: 5_000_000, symbol: { type: 'simple-marker', color: '#7fcdbb', size: 11 }, label: '1–5M' },
{ min: 5_000_000, max: 50_000_000, symbol: { type: 'simple-marker', color: '#edf8b1', size: 18 }, label: '> 5M' },
],
};
/** Styles a feature layer with a class-breaks renderer (graduated circles by population). */
export default function ClassBreaksRenderer() {
return (
);
}
```
# Clustering
> Reduce dense features into clusters.
Reduce dense features into clusters.  iOS  Android This is the real source of the example app’s `symbols/clustering` screen — run it on a device or simulator to see it live. app/symbols/clustering.tsx
```tsx
import { FeatureLayer, Map, MapView, type FeatureReduction } from 'expo-arcgis';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
// Cluster nearby features within a 60-point radius.
const CITY_CLUSTER: FeatureReduction = { type: 'cluster', radius: 60 };
/** Reduces dense features into clusters (feature reduction). */
export default function Clustering() {
return (
);
}
```
# Composite symbol
> Stack several symbols into one.
Stack several symbols into one.  iOS  Android This is the real source of the example app’s `symbols/composite-symbol` screen — run it on a device or simulator to see it live. app/symbols/composite-symbol.tsx
```tsx
import { Graphic, GraphicsOverlay, Map, MapView, type Symbol } from 'expo-arcgis';
// A composite symbol draws several symbols stacked as one — here a white halo behind a red dot,
// a common "pin" look built without a picture marker.
const PIN: Symbol = {
type: 'composite',
symbols: [
{ type: 'simple-marker', color: '#ffffff', size: 22 },
{ type: 'simple-marker', color: '#e63946', size: 11 },
],
};
/** A composite symbol stacks several symbols into one — a white halo behind a red dot. */
export default function CompositeSymbol() {
return (
);
}
```
# Contingent values
> Valid coded values for a field constrained by another (bird-nests geodatabase).
Valid coded values for a field constrained by another (bird-nests geodatabase).  iOS This is the real source of the example app’s `editing/contingent-values` screen — run it on a device or simulator to see it live. app/editing/contingent-values.tsx
```tsx
import {
FeatureLayer,
Map,
MapView,
offline,
type FeatureLayerHandle,
type GeodatabaseHandle,
} from 'expo-arcgis';
import { Asset } from 'expo-asset';
import { useEffect, useRef, useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
// The Esri "Contingent Values Bird Nests" mobile geodatabase. Its `BirdNests` table defines a
// contingent-values constraint: a nest's valid `Protection` depends on its `Status`.
const GDB = require('../../assets/birdnests.geodatabase');
/**
* Contingent values express that one field's allowed values depend on another's. Here a bird nest's
* valid `Protection` codes are contingent on its `Status` — `contingentValues({Status}, 'Protection')`
* returns only the codes permitted for that status.
*/
export default function ContingentValues() {
const gdb = useRef(null);
const [layer, setLayer] = useState(null);
const [status, setStatus] = useState('Loading bird-nests geodatabase…');
const showFor = async (handle: FeatureLayerHandle, nestStatus: string) => {
const options = await handle.contingentValues({ Status: nestStatus }, 'Protection');
setStatus(`Protection valid for ${nestStatus}: ${options.map((o) => o.name).join(', ') || '—'}`);
};
useEffect(() => {
(async () => {
const asset = await Asset.fromModule(GDB).downloadAsync();
const path = (asset.localUri ?? asset.uri).replace('file://', '');
gdb.current = await offline.openGeodatabase(path);
const fl = gdb.current.getFeatureLayer('BirdNests');
setLayer(fl);
await showFor(fl, 'OCCUPIED');
})().catch((e) => setStatus(String(e)));
}, []);
const tap = (nestStatus: string) => () => {
if (layer) showFor(layer, nestStatus).catch((e) => setStatus(String(e)));
};
return (
>
}
>
{layer && }
);
}
```
# Device location
> Show a moving position from a simulated source.
Show a moving position from a simulated source.  iOS  Android This is the real source of the example app’s `location/device-location` screen — run it on a device or simulator to see it live. app/location/device-location.tsx
```tsx
import { Map, MapView, type Geometry, type LocationEventPayload } from 'expo-arcgis';
import { useState } from 'react';
import { SampleScreen } from '../../src/SampleScreen';
// A short route the simulated location data source follows (Santa Monica Mountains).
const ROUTE: Geometry = {
type: 'polyline',
points: [
{ x: -118.805, y: 34.0 },
{ x: -118.8, y: 34.005 },
{ x: -118.795, y: 34.01 },
{ x: -118.79, y: 34.012 },
],
};
/** Shows a moving device position from a simulated location data source, auto-panning to follow it. */
export default function DeviceLocation() {
const [status, setStatus] = useState('Following a simulated route…');
return (
setStatus(
`Location ${event.nativeEvent.position.latitude.toFixed(4)}, ${event.nativeEvent.position.longitude.toFixed(4)}`
)
}
/>
);
}
```
# Display filter
> Hide features client-side with a where-clause, no re-query.
Hide features client-side with a where-clause, no re-query.  iOS  Android This is the real source of the example app’s `layers/display-filter` screen — run it on a device or simulator to see it live. app/layers/display-filter.tsx
```tsx
import { FeatureLayer, Map, MapView } from 'expo-arcgis';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
/**
* A display filter hides features on the client without re-querying the service — here only
* cities with a population over five million are drawn.
*/
export default function DisplayFilter() {
return (
5000000', name: 'Megacities' }}
/>
);
}
```
# Display a map
> A basemap and an initial viewpoint.
A basemap and an initial viewpoint.  iOS  Android This is the real source of the example app’s `basics/display-map` screen — run it on a device or simulator to see it live. app/basics/display-map.tsx
```tsx
import { Map, MapView } from 'expo-arcgis';
/** Displays a topographic basemap centered on the Santa Monica Mountains. */
export default function DisplayMap() {
return (
);
}
```
# Entity change events
> React to per-entity received / purged stream events.
React to per-entity received / purged stream events.  iOS  Android This is the real source of the example app’s `real-time/dynamic-entity-changes` screen — run it on a device or simulator to see it live. app/real-time/dynamic-entity-changes.tsx
```tsx
import { DynamicEntityLayer, Map, MapView } from 'expo-arcgis';
import { useRef, useState } from 'react';
import { SampleScreen } from '../../src/SampleScreen';
// Esri sample real-time stream service (live moving vehicles around the NE US).
const SANDY_RTGIS =
'https://realtimegis2016.esri.com:6443/arcgis/rest/services/SandyRTGIS/StreamServer';
/**
* Subscribes to per-entity change events on a live stream. The SDK emits one `received` event per
* entity as its latest observation arrives (and `purged` when an entity is evicted), so the rate is
* bounded by the number of tracked entities rather than raw observation throughput.
*/
export default function DynamicEntityChanges() {
const count = useRef(0);
const [status, setStatus] = useState('Connecting to the stream…');
return (
{
if (nativeEvent.changeType === 'received') count.current += 1;
setStatus(`Updates: ${count.current} · last change: ${nativeEvent.changeType} #${nativeEvent.entityId}`);
}}
/>
);
}
```
# Dynamic entity layer
> Stream live moving entities from a stream service.
Stream live moving entities from a stream service.  iOS  Android This is the real source of the example app’s `real-time/dynamic-entity-layer` screen — run it on a device or simulator to see it live. app/real-time/dynamic-entity-layer.tsx
```tsx
import { DynamicEntityLayer, Map, MapView, type DynamicEntityLayerHandle } from 'expo-arcgis';
import { useRef, useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
// Esri sample real-time stream service (live moving vehicles around the NE US).
const SANDY_RTGIS =
'https://realtimegis2016.esri.com:6443/arcgis/rest/services/SandyRTGIS/StreamServer';
/** Streams live moving entities from a stream service and queries how many are tracked. */
export default function DynamicEntityLayerSample() {
const layer = useRef(null);
const [status, setStatus] = useState('Connecting to the stream…');
async function query() {
const result = await layer.current?.queryDynamicEntities();
setStatus(`Tracked entities: ${result?.count ?? 0}`);
}
return (
}>
setStatus(`Connection: ${connectionStatus}`)}
/>
);
}
```
# Edit features
> Add, move and delete features on an editable service.
Add, move and delete features on an editable service.  iOS  Android This is the real source of the example app’s `editing/edit-features` screen — run it on a device or simulator to see it live. app/editing/edit-features.tsx
```tsx
import {
FeatureLayer,
Map,
MapView,
type FeatureLayerHandle,
type TapEventPayload,
} from 'expo-arcgis';
import { useRef, useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
// A public, anonymously-editable feature service (Esri sample).
const WILDFIRE = 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0';
/** Adds, moves and deletes a feature on an editable service via the feature-layer ref. */
export default function EditFeatures() {
const layer = useRef(null);
const [pin, setPin] = useState<{ latitude: number; longitude: number } | null>(null);
const [editedId, setEditedId] = useState(null);
const [status, setStatus] = useState('Tap the map, then “Add here”.');
async function add() {
if (!pin) return setStatus('Tap the map first');
const id = await layer.current?.addFeature({}, { type: 'point', x: pin.longitude, y: pin.latitude });
setEditedId(id ?? null);
setStatus(`Added feature #${id ?? '—'}`);
}
async function move() {
if (editedId == null || !pin) return setStatus('Add a feature, then tap to move it');
await layer.current?.updateFeature(editedId, {
geometry: { type: 'point', x: pin.longitude, y: pin.latitude },
});
setStatus(`Moved feature #${editedId}`);
}
async function remove() {
if (editedId == null) return setStatus('Add a feature first');
await layer.current?.deleteFeature(editedId);
setStatus(`Deleted feature #${editedId}`);
setEditedId(null);
}
return (
>
}
>
setPin(event.nativeEvent.mapPoint)}
/>
);
}
```
# Feature collection
> Build an in-memory layer from a schema + features.
Build an in-memory layer from a schema + features.  iOS  Android This is the real source of the example app’s `layers/feature-collection` screen — run it on a device or simulator to see it live. app/layers/feature-collection.tsx
```tsx
import { FeatureCollectionLayer, Map, MapView } from 'expo-arcgis';
const FIELDS = [
{ name: 'name', type: 'text' as const },
{ name: 'magnitude', type: 'double' as const },
];
const FEATURES = [
{ attributes: { name: 'A', magnitude: 4.1 }, geometry: { type: 'point' as const, x: -118.2, y: 34.05 } },
{ attributes: { name: 'B', magnitude: 5.6 }, geometry: { type: 'point' as const, x: -117.9, y: 34.1 } },
{ attributes: { name: 'C', magnitude: 3.2 }, geometry: { type: 'point' as const, x: -118.4, y: 33.9 } },
];
/** Builds an in-memory layer from a client-side schema + features (no feature service). */
export default function FeatureCollection() {
return (
);
}
```
# Feature layer
> Add a feature service layer to the map.
Add a feature service layer to the map.  iOS  Android This is the real source of the example app’s `layers/feature-layer` screen — run it on a device or simulator to see it live. app/layers/feature-layer.tsx
```tsx
import { FeatureLayer, Map, MapView } from 'expo-arcgis';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
/** Adds a feature service layer (world cities) on top of a navigation basemap. */
export default function FeatureLayerSample() {
return (
);
}
```
# Geocode
> Forward-geocode an address to a point.
Forward-geocode an address to a point.  iOS  Android This is the real source of the example app’s `geocode/geocode` screen — run it on a device or simulator to see it live. app/geocode/geocode.tsx
```tsx
import { Graphic, GraphicsOverlay, Map, MapView, geocoder, type Geometry } from 'expo-arcgis';
import { useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
/** Forward-geocodes an address to a point and marks it (geocoder namespace). */
export default function Geocode() {
const [location, setLocation] = useState(null);
const [status, setStatus] = useState('Tap “Find Los Angeles”.');
async function find() {
const [result] = await geocoder.geocode('Los Angeles, CA');
if (result?.location) {
setLocation(result.location);
setStatus(`${result.label} (score ${Math.round(result.score)})`);
} else setStatus('No result');
}
return (
}>
{location && (
)}
);
}
```
# Geodatabase transactions
> Begin/commit/rollback edits on a local mobile geodatabase.
Begin/commit/rollback edits on a local mobile geodatabase.  iOS  Android This is the real source of the example app’s `editing/geodatabase-transactions` screen — run it on a device or simulator to see it live. app/editing/geodatabase-transactions.tsx
```tsx
import {
FeatureLayer,
Map,
MapView,
offline,
type FeatureLayerHandle,
type GeodatabaseHandle,
} from 'expo-arcgis';
import { useRef, useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
// Transactions operate on a local .geodatabase file — there is no bundled one, so this is a
// button-driven status demo. Supply your own path: download one with `offline.generateGeodatabase`
// (its result `path`), or sideload a `.geodatabase` into the app's documents directory.
const GEODATABASE_PATH = '/path/to/local.geodatabase';
/**
* Transactional editing of a local mobile geodatabase: open it, `beginTransaction`, make edits, then
* `commitTransaction` (persist) or `rollbackTransaction` (discard) the whole batch.
*/
export default function GeodatabaseTransactions() {
const gdb = useRef(null);
const [layer, setLayer] = useState(null);
const [status, setStatus] = useState('Tap “Open” (needs a real .geodatabase path).');
const run = (fn: () => Promise) => () => {
fn().catch((e) => setStatus(String(e)));
};
const requireGdb = () => {
if (!gdb.current) throw new Error('Open the geodatabase first');
return gdb.current;
};
const open = run(async () => {
gdb.current = await offline.openGeodatabase(GEODATABASE_PATH);
const names = gdb.current.getFeatureTableNames();
// Display the first table on the map (its edits within a transaction are shown live).
if (names[0]) setLayer(gdb.current.getFeatureLayer(names[0]));
setStatus(`Tables: ${names.join(', ') || '—'}`);
});
const begin = run(async () => {
await requireGdb().beginTransaction();
setStatus(`In transaction: ${requireGdb().isInTransaction()}`);
});
const count = run(async () => {
const handle = requireGdb();
const name = handle.getFeatureTableNames()[0];
setStatus(name ? `${name}: ${await handle.queryFeatureCount(name)} features` : 'No tables');
});
const rollback = run(async () => {
await requireGdb().rollbackTransaction();
setStatus('Rolled back — edits discarded');
});
const commit = run(async () => {
await requireGdb().commitTransaction();
setStatus('Committed — edits persisted');
});
return (
>
}
>
{layer && }
);
}
```
# Geodesic shapes
> Build a geodesic ellipse and sector on the spheroid.
Build a geodesic ellipse and sector on the spheroid.  iOS  Android This is the real source of the example app’s `geometry/geodesic-shapes` screen — run it on a device or simulator to see it live. app/geometry/geodesic-shapes.tsx
```tsx
import {
Graphic,
GraphicsOverlay,
Map,
MapView,
geometryEngine,
type PointGeometry,
type Symbol,
} from 'expo-arcgis';
const CENTER: PointGeometry = { type: 'point', x: -100, y: 40 };
// Geodesic shapes follow the curvature of the earth. The ellipse and sector are built on the
// spheroid, so their edges stay true at continental scale.
const ELLIPSE = geometryEngine.ellipseGeodesic({
center: CENTER,
semiAxis1Length: 1_500_000,
semiAxis2Length: 800_000,
axisDirection: 45,
linearUnit: 'meters',
geometryType: 'polygon',
});
const SECTOR = geometryEngine.sectorGeodesic({
center: CENTER,
semiAxis1Length: 1_200_000,
semiAxis2Length: 1_200_000,
sectorAngle: 80,
startDirection: 10,
linearUnit: 'meters',
geometryType: 'polygon',
});
const ELLIPSE_FILL: Symbol = { type: 'simple-fill', color: '#2c7fb855', outline: { color: '#2c7fb8', width: 2 } };
const SECTOR_FILL: Symbol = { type: 'simple-fill', color: '#e6394655', outline: { color: '#e63946', width: 2 } };
/** Builds a geodesic ellipse and a geodesic sector with `geometryEngine` and draws them. */
export default function GeodesicShapes() {
return (
{ELLIPSE &&
}
{SECTOR &&
}
);
}
```
# GeoElement viewshed
> A viewshed that follows a moving graphic observer.
A viewshed that follows a moving graphic observer.  iOS  Android This is the real source of the example app’s `analysis/geoelement-viewshed` screen — run it on a device or simulator to see it live. app/analysis/geoelement-viewshed.tsx
```tsx
import {
AnalysisOverlay,
Graphic,
GraphicsOverlay,
Scene,
SceneView,
Viewshed,
type Camera,
type GraphicRef,
type Surface,
} from 'expo-arcgis';
import { useState } from 'react';
const CAMERA: Camera = { position: { x: -118.804, y: 33.997, z: 5330 }, heading: 355, pitch: 72, roll: 0 };
const ELEVATION: Surface = {
elevationSources: [
{ url: 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer' },
],
elevationExaggeration: 2.5,
};
/**
* A GeoElement-anchored viewshed follows a `` instead of a fixed point — move the graphic
* and the visible area moves with it. The graphic forwards its native ref (via a callback ref into
* state) so the `` can attach to it once it has mounted.
*/
export default function GeoElementViewshed() {
const [observer, setObserver] = useState(null);
return (
{observer && (
)}
);
}
```
# Geometry editor
> Interactively sketch geometry and measure it.
Interactively sketch geometry and measure it.  iOS  Android This is the real source of the example app’s `editing/geometry-editor` screen — run it on a device or simulator to see it live. app/editing/geometry-editor.tsx
```tsx
import { GeometryEditor, Map, MapView, geometryEngine } from 'expo-arcgis';
import { useState } from 'react';
import { SampleScreen } from '../../src/SampleScreen';
/** Interactive sketching with the `` — reports the drawn polygon's geodesic area. */
export default function GeometryEditorSample() {
const [status, setStatus] = useState('Sketch a polygon on the map.');
return (
{
if (!geometry) return;
const area = Math.abs(geometryEngine.geodesicArea(geometry, 'squareMeters'));
setStatus(`Sketch area: ${(area / 1e6).toFixed(3)} km²`);
}}
/>
);
}
```
# Geoprocessing
> Run a geoprocessing task and draw its result.
Run a geoprocessing task and draw its result.  iOS  Android This is the real source of the example app’s `geoprocessing/geoprocessing` screen — run it on a device or simulator to see it live. app/geoprocessing/geoprocessing.tsx
```tsx
import {
Graphic,
GraphicsOverlay,
Map,
MapView,
geoprocessor,
type Feature,
type Geometry,
} from 'expo-arcgis';
import { useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
// Esri sample Viewshed geoprocessing service — observation point + distance → visible polygons.
const VIEWSHED_GP =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/Elevation/ESRI_Elevation_World/GPServer/Viewshed';
/** Runs a geoprocessing task (Viewshed) and draws the result polygons (geoprocessor namespace). */
export default function Geoprocessing() {
const [polygons, setPolygons] = useState([]);
const [status, setStatus] = useState('Tap “Run viewshed”.');
async function run() {
setStatus('Running viewshed…');
try {
const job = await geoprocessor.execute(VIEWSHED_GP, {
Input_Observation_Point: {
type: 'features',
geometries: [{ type: 'point', x: -118.49, y: 34.05 }],
},
Viewshed_Distance: { type: 'linearUnit', value: 2, unit: 'miles' },
});
const { outputs } = await job.result();
const features = (outputs.Viewshed_Result as Feature[] | undefined) ?? [];
const result = features.map((f) => f.geometry).filter((g): g is Geometry => g != null);
setPolygons(result);
setStatus(`${result.length} visible polygon(s)`);
} catch (e) {
setStatus(`Error: ${String(e)}`);
}
}
return (
}>
{polygons.map((geometry, i) => (
))}
);
}
```
# Graphics
> Draw a point, polyline and polygon on a graphics overlay.
Draw a point, polyline and polygon on a graphics overlay.  iOS  Android This is the real source of the example app’s `basics/graphics` screen — run it on a device or simulator to see it live. app/basics/graphics.tsx
```tsx
import { Graphic, GraphicsOverlay, Map, MapView } from 'expo-arcgis';
const POINT = { x: -118.80657, y: 34.00059 };
const LINE_POINTS = [
{ x: -118.821, y: 34.0138 },
{ x: -118.799, y: 34.0048 },
{ x: -118.8049, y: 33.9925 },
];
const POLYGON_POINTS = [
{ x: -118.818, y: 34.0021 },
{ x: -118.8086, y: 34.0035 },
{ x: -118.8055, y: 33.9961 },
{ x: -118.8154, y: 33.9938 },
];
/** Draws a point, a polyline and a polygon as graphics on a ``. */
export default function Graphics() {
return (
);
}
```
# Coordinate grid
> Overlay an MGRS / UTM / USNG / lat-long coordinate grid.
Overlay an MGRS / UTM / USNG / lat-long coordinate grid.  iOS  Android This is the real source of the example app’s `basics/grid` screen — run it on a device or simulator to see it live. app/basics/grid.tsx
```tsx
import { Map, MapView } from 'expo-arcgis';
/**
* Overlays a coordinate grid on the map — here the military grid (MGRS). Also available:
* `utm`, `usng` and `latitude-longitude`.
*/
export default function Grid() {
return (
);
}
```
# Group layer
> Group child layers into a single unit.
Group child layers into a single unit.  iOS  Android This is the real source of the example app’s `layers/group-layer` screen — run it on a device or simulator to see it live. app/layers/group-layer.tsx
```tsx
import { FeatureLayer, GroupLayer, Map, MapImageLayer, MapView } from 'expo-arcgis';
const USA_MAP_SERVICE = 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
/** Groups two layers into one unit with `` — they share the group's opacity. */
export default function GroupLayerSample() {
return (
);
}
```
# Identify
> Identify the feature under a tap.
Identify the feature under a tap.  iOS  Android This is the real source of the example app’s `query/identify` screen — run it on a device or simulator to see it live. app/query/identify.tsx
```tsx
import {
FeatureLayer,
Map,
MapView,
type MapViewHandle,
type TapEventPayload,
} from 'expo-arcgis';
import { useRef, useState } from 'react';
import { SampleScreen } from '../../src/SampleScreen';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
/** Identifies the feature under a tap via the map-view ref. */
export default function Identify() {
const view = useRef(null);
const [status, setStatus] = useState('Tap a city.');
async function identifyAt(screenPoint: { x: number; y: number }) {
const results = await view.current?.identify(screenPoint, { tolerance: 12, maxResults: 1 });
const feature = results?.find((r) => r.features.length > 0)?.features[0];
setStatus(feature ? `Identified: ${String(feature.attributes.CITY_NAME ?? '—')}` : 'Nothing here');
}
return (
identifyAt(event.nativeEvent.screenPoint)}
/>
);
}
```
# Image overlay
> Display a georeferenced local image stretched to a map extent.
Display a georeferenced local image stretched to a map extent.  iOS  Android This is the real source of the example app’s `layers/image-overlay` screen — run it on a device or simulator to see it live. app/layers/image-overlay.tsx
```tsx
import { ImageOverlay, Map, MapView, type Envelope } from 'expo-arcgis';
import { SampleScreen } from '../../src/SampleScreen';
// draws a *local* image file stretched to a geographic extent. There's no bundled
// image here, so point IMAGE_PATH at a real local file (e.g. one downloaded into
// FileSystem.documentDirectory, or a georeferenced weather/radar frame) to see it draw. A missing
// file is a no-op, so the map still renders.
const IMAGE_PATH = '/path/to/local-overlay.png';
const EXTENT: Envelope = { xMin: -120, yMin: 33, xMax: -116, yMax: 36 };
/**
* Displays a georeferenced local image stretched over a map extent. Updating `imagePath` swaps the
* frame — drive an animation by cycling a sequence of images.
*/
export default function ImageOverlaySample() {
return (
);
}
```
# KML layer
> Add a KML layer from a remote feed.
Add a KML layer from a remote feed.  iOS  Android This is the real source of the example app’s `layers/kml-layer` screen — run it on a device or simulator to see it live. app/layers/kml-layer.tsx
```tsx
import { KmlLayer, Map, MapView } from 'expo-arcgis';
// A public KML feed (USGS earthquakes, magnitude 2.5+ over the past week).
const EARTHQUAKES_KML =
'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.kml';
/** Adds a KML layer from a remote `.kml` feed. */
export default function KmlLayerSample() {
return (
);
}
```
# KML node tree
> Read a KML document's node hierarchy via the layer ref.
Read a KML document’s node hierarchy via the layer ref.  iOS  Android This is the real source of the example app’s `layers/kml-tree` screen — run it on a device or simulator to see it live. app/layers/kml-tree.tsx
```tsx
import { KmlLayer, Map, MapView, type KmlLayerHandle, type KmlNodeInfo } from 'expo-arcgis';
import { useRef, useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
const EARTHQUAKES_KML = 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.kml';
const countNodes = (nodes: KmlNodeInfo[]): number =>
nodes.reduce((sum, n) => sum + 1 + countNodes(n.children ?? []), 0);
/** Loads a KML layer and reads its node tree (names, hierarchy) through the layer ref. */
export default function KmlTree() {
const layer = useRef(null);
const [status, setStatus] = useState('Tap “Read node tree”.');
const read = async () => {
try {
const nodes = (await layer.current?.getNodes()) ?? [];
const names = nodes.map((n) => n.name).join(', ') || '—';
setStatus(`${nodes.length} root · ${countNodes(nodes)} total — ${names}`);
} catch (e) {
setStatus(String(e));
}
};
return (
}>
);
}
```
# Labels
> Label a feature layer with an Arcade expression.
Label a feature layer with an Arcade expression.  iOS  Android This is the real source of the example app’s `symbols/labels` screen — run it on a device or simulator to see it live. app/symbols/labels.tsx
```tsx
import { FeatureLayer, Map, MapView, type LabelDefinition } from 'expo-arcgis';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
// White city names with a dark halo. The text comes from `expression`.
const CITIES_LABELS: LabelDefinition[] = [
{
expression: '[CITY_NAME]',
symbol: { type: 'text', text: '', color: '#ffffff', size: 11, haloColor: '#000000', haloWidth: 1.5 },
},
];
/** Labels a feature layer's features with an Arcade expression. */
export default function Labels() {
return (
);
}
```
# Light and shadows
> Sun lighting with cast shadows over a scene.
Sun lighting with cast shadows over a scene.  iOS  Android This is the real source of the example app’s `three-d/light-and-shadows` screen — run it on a device or simulator to see it live. app/three-d/light-and-shadows.tsx
```tsx
import { Scene, SceneLayer, SceneView, type Camera } from 'expo-arcgis';
const SF_BUILDINGS =
'https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/SanFrancisco_Bldgs/SceneServer';
const CAMERA_SF: Camera = {
position: { x: -122.4, y: 37.78, z: 600 },
heading: 0,
pitch: 65,
roll: 0,
};
// A fixed sun position (summer solstice noon, Pacific) so the buildings cast clear shadows.
const SUN_TIME = Date.UTC(2024, 5, 21, 19, 0, 0);
/** Sun lighting with cast shadows over a 3D scene (`sunLighting` + `sunTime`). */
export default function LightAndShadows() {
return (
);
}
```
# Line of sight
> Test visibility between an observer and a target.
Test visibility between an observer and a target.  iOS  Android This is the real source of the example app’s `analysis/line-of-sight` screen — run it on a device or simulator to see it live. app/analysis/line-of-sight.tsx
```tsx
import { AnalysisOverlay, LineOfSight, Scene, SceneView, type Camera, type Surface } from 'expo-arcgis';
import { useState } from 'react';
import { SampleScreen } from '../../src/SampleScreen';
const CAMERA: Camera = {
position: { x: -118.804, y: 34.0, z: 5330 },
heading: 355,
pitch: 72,
roll: 0,
};
const ELEVATION: Surface = {
elevationSources: [
{ url: 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer' },
],
elevationExaggeration: 2.5,
};
/** Tests visibility between an observer and a target over terrain, reporting it via an event. */
export default function LineOfSightSample() {
const [status, setStatus] = useState('Computing line of sight…');
return (
setStatus(`Target is ${visibility}`)}
/>
);
}
```
# Local scene
> A local web scene with a building model, in a .
A local web scene with a building model, in a \.  iOS This is the real source of the example app’s `three-d/local-scene` screen — run it on a device or simulator to see it live. app/three-d/local-scene.tsx
```tsx
import { useState } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { LocalSceneView, Scene } from 'expo-arcgis';
// A public local web scene with a building scene layer (Esri's Building E, used by the Toolkit's
// building explorer example).
const LOCAL_WEB_SCENE_ID = 'b7c387d599a84a50aafaece5ca139d44';
/**
* Shows a local web scene in a ``: a building model on a local, flat surface. Tap
* the building to read where you tapped.
*/
export default function LocalScene() {
const [status, setStatus] = useState('Loading the scene…');
return (
setStatus('Loaded. Tap the building.')}
onSceneLoadError={({ nativeEvent }) => setStatus(`Failed: ${nativeEvent.message}`)}
onTap={({ nativeEvent }) =>
setStatus(
`Tapped ${nativeEvent.mapPoint.latitude.toFixed(5)}, ${nativeEvent.mapPoint.longitude.toFixed(5)}`
)
}
>
{status}
);
}
const styles = StyleSheet.create({
banner: {
position: 'absolute',
top: 12,
left: 12,
right: 12,
padding: 10,
borderRadius: 10,
backgroundColor: 'rgba(255, 255, 255, 0.92)',
},
text: { fontSize: 15, fontWeight: '600', color: '#1f2937' },
});
```
# Map image layer
> Add a dynamic, server-rendered map image layer.
Add a dynamic, server-rendered map image layer.  iOS  Android This is the real source of the example app’s `layers/map-image-layer` screen — run it on a device or simulator to see it live. app/layers/map-image-layer.tsx
```tsx
import { Map, MapImageLayer, MapView } from 'expo-arcgis';
// A public ArcGIS dynamic map service.
const USA_MAP_SERVICE = 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer';
/** Adds a dynamic map-image layer (server-rendered) over a basemap. */
export default function MapImageLayerSample() {
return (
);
}
```
# Model scene symbol
> Render a 3D glTF model at a point with ModelSceneSymbol.
Render a 3D glTF model at a point with ModelSceneSymbol.  iOS This is the real source of the example app’s `three-d/model-scene` screen — run it on a device or simulator to see it live. app/three-d/model-scene.tsx
```tsx
import {
Graphic,
GraphicsOverlay,
Scene,
SceneView,
type Camera,
type GraphicRef,
type Surface,
} from 'expo-arcgis';
import * as FileSystem from 'expo-file-system/legacy';
import { useEffect, useState } from 'react';
const ELEVATION: Surface = {
elevationSources: [
{ url: 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer' },
],
};
// `ModelSceneSymbol` loads its model from a LOCAL file, so the public glTF (the Khronos "Duck") is
// downloaded to the cache once, then the `file://` path is handed to the symbol.
const MODEL_URL =
'https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Assets/main/Models/Duck/glTF-Binary/Duck.glb';
const POINT = { type: 'point', x: -112.115, y: 36.2, z: 3500 } as const;
// Initial view over the Grand Canyon, until the model loads and the orbit camera frames it.
const CAMERA: Camera = { position: { x: -112.115, y: 36.0, z: 6000 }, heading: 0, pitch: 70, roll: 0 };
/**
* A `ModelSceneSymbol` renders a 3D glTF model at a point graphic in a ``. Once the model
* has downloaded and mounted, an orbit-GeoElement camera frames it. The model floats above the Grand
* Canyon rim (graphics overlays place `z` as an absolute height).
*/
export default function ModelScene() {
const [target, setTarget] = useState(null);
const [modelUri, setModelUri] = useState(null);
useEffect(() => {
let alive = true;
FileSystem.downloadAsync(MODEL_URL, `${FileSystem.cacheDirectory}duck.glb`)
.then((res) => alive && setModelUri(res.uri))
.catch(() => {});
return () => {
alive = false;
};
}, []);
return (
{modelUri && (
)}
);
}
```
# Multilayer symbol
> A point symbol composed from picture-marker symbol layers.
A point symbol composed from picture-marker symbol layers.  iOS  Android This is the real source of the example app’s `symbols/multilayer-symbol` screen — run it on a device or simulator to see it live. app/symbols/multilayer-symbol.tsx
```tsx
import { Graphic, GraphicsOverlay, Map, MapView, type Symbol } from 'expo-arcgis';
// A multilayer point symbol composed from one or more picture-marker symbol layers (each an image
// at its own size / offset). Here a single pin image.
const PIN: Symbol = {
type: 'multilayer-point',
symbolLayers: [
{ type: 'picture-marker', url: 'https://static.arcgis.com/images/Symbols/Shapes/RedPin1LargeB.png', width: 36, height: 36 },
],
};
/** A `MultilayerPointSymbol` built from a picture-marker symbol layer. */
export default function MultilayerSymbol() {
return (
);
}
```
# Offline map
> Generate an on-demand offline map and display it.
Generate an on-demand offline map and display it.  iOS  Android This is the real source of the example app’s `offline/offline-map` screen — run it on a device or simulator to see it live. app/offline/offline-map.tsx
```tsx
import {
Map,
MapView,
offline,
type Geometry,
type JobRef,
type OfflineMapResult,
} from 'expo-arcgis';
import { useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
// Esri sample offline-enabled web map (Naperville) + a small area of interest.
const OFFLINE_WEBMAP = 'acc027394bc84c2fb04d1ed317aac674';
const OFFLINE_AREA: Geometry = {
type: 'envelope',
xMin: -88.1526,
yMin: 41.7694,
xMax: -88.1387,
yMax: 41.7799,
};
/** Generates an on-demand offline map (progress + cancel) and displays the downloaded package. */
export default function OfflineMap() {
const [path, setPath] = useState(null);
const [job, setJob] = useState | null>(null);
const [status, setStatus] = useState('Tap “Take offline”.');
async function takeOffline() {
setStatus('Taking map offline… 0%');
try {
const newJob = await offline.generateOfflineMap(OFFLINE_WEBMAP, OFFLINE_AREA, 'offlineMap1');
setJob(newJob);
const subscription = newJob.addListener('onProgress', ({ progress }) =>
setStatus(`Taking map offline… ${progress}%`)
);
const result = await newJob.result();
subscription.remove();
setJob(null);
if (result.path) {
setPath(result.path);
setStatus('Offline map downloaded ✅');
} else setStatus('No package path returned');
} catch (e) {
setJob(null);
setStatus(`Offline error/cancelled: ${String(e)}`);
}
}
return (
{!path && }
{job && job.cancel()} />}
{path && setPath(null)} />}
>
}
>
{path ? (
) : (
)}
);
}
```
# Orbit camera
> An orbit camera that follows a moving graphic (orbitGeoElement).
An orbit camera that follows a moving graphic (orbitGeoElement).  iOS  Android This is the real source of the example app’s `three-d/orbit-camera` screen — run it on a device or simulator to see it live. app/three-d/orbit-camera.tsx
```tsx
import {
Graphic,
GraphicsOverlay,
Scene,
SceneView,
type GraphicRef,
type Surface,
} from 'expo-arcgis';
import { useState } from 'react';
const ELEVATION: Surface = {
elevationSources: [
{ url: 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer' },
],
};
/**
* An orbit-GeoElement camera circles a `` and follows it as it moves. The graphic forwards
* its ref (via a callback ref into state); once it has mounted, the camera controller and the
* `orbitGraphic` prop both point at it.
*/
export default function OrbitCamera() {
const [target, setTarget] = useState(null);
return (
);
}
```
# Picture fill
> Fill a polygon by tiling an image.
Fill a polygon by tiling an image.  iOS  Android This is the real source of the example app’s `symbols/picture-fill` screen — run it on a device or simulator to see it live. app/symbols/picture-fill.tsx
```tsx
import { Graphic, GraphicsOverlay, Map, MapView } from 'expo-arcgis';
// A rectangle in the Santa Monica Mountains.
const POLYGON_POINTS = [
{ x: -118.85, y: 34.04 },
{ x: -118.76, y: 34.04 },
{ x: -118.76, y: 33.98 },
{ x: -118.85, y: 33.98 },
];
const TEXTURE = 'https://static.arcgis.com/images/Symbols/Shapes/BlackStarLargeB.png';
/** Fills a polygon by tiling an image from a URL with a `picture-fill` symbol. */
export default function PictureFill() {
return (
);
}
```
# Popups
> Read an evaluated popup (title + fields) under a tap.
Read an evaluated popup (title + fields) under a tap.  iOS  Android This is the real source of the example app’s `query/popups` screen — run it on a device or simulator to see it live. app/query/popups.tsx
```tsx
import {
FeatureLayer,
Map,
MapView,
type MapViewHandle,
type TapEventPayload,
} from 'expo-arcgis';
import { useRef, useState } from 'react';
import { SampleScreen } from '../../src/SampleScreen';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
/** Reads the evaluated popup (title + formatted fields) under a tap via `identifyPopups`. */
export default function Popups() {
const view = useRef(null);
const [status, setStatus] = useState('Tap a city.');
async function showPopupAt(screenPoint: { x: number; y: number }) {
const popups = await view.current?.identifyPopups(screenPoint, { tolerance: 12, maxResults: 1 });
const popup = popups?.[0];
if (!popup) {
setStatus('No popup here');
return;
}
const fields = popup.fields
.slice(0, 3)
.map((f) => `${f.label}: ${f.value}`)
.join(' · ');
setStatus(`${popup.title} — ${fields}`);
}
return (
showPopupAt(event.nativeEvent.screenPoint)}
/>
);
}
```
# Portal search
> Search ArcGIS Online for items (web maps) anonymously.
Search ArcGIS Online for items (web maps) anonymously.  iOS  Android This is the real source of the example app’s `basics/portal-search` screen — run it on a device or simulator to see it live. app/basics/portal-search.tsx
```tsx
import { portal, type PortalItemInfo } from 'expo-arcgis';
import { useEffect, useState } from 'react';
import { ScrollView, Text } from 'react-native';
import { SampleScreen } from '../../src/SampleScreen';
/** Searches ArcGIS Online anonymously for Esri web maps and lists them. */
export default function PortalSearch() {
const [items, setItems] = useState([]);
const [status, setStatus] = useState('Searching ArcGIS Online…');
useEffect(() => {
portal
.findItems({ query: 'type:"Web Map" owner:esri', max: 20 })
.then((r) => {
setItems(r);
setStatus(`${r.length} web maps found`);
})
.catch((e) => setStatus(String(e)));
}, []);
return (
{items.map((it) => (
{it.title} · {it.type}
))}
);
}
```
# Query features
> Count features matching a SQL where clause.
Count features matching a SQL where clause.  iOS  Android This is the real source of the example app’s `query/query-features` screen — run it on a device or simulator to see it live. app/query/query-features.tsx
```tsx
import { FeatureLayer, Map, MapView, type FeatureLayerHandle } from 'expo-arcgis';
import { useRef, useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
/** Counts the features matching a SQL `where` clause via the feature-layer ref. */
export default function QueryFeatures() {
const layer = useRef(null);
const [status, setStatus] = useState('Tap “Count cities > 5M”.');
async function count() {
const n = await layer.current?.queryFeatureCount({ whereClause: 'POP > 5000000' });
setStatus(`Cities over 5M people: ${n ?? '—'}`);
}
return (
}>
);
}
```
# Query statistics
> Compute an aggregate statistic over a layer.
Compute an aggregate statistic over a layer.  iOS  Android This is the real source of the example app’s `query/query-statistics` screen — run it on a device or simulator to see it live. app/query/query-statistics.tsx
```tsx
import { FeatureLayer, Map, MapView, type FeatureLayerHandle } from 'expo-arcgis';
import { useRef, useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
/** Computes an aggregate statistic (average population) over the layer's features. */
export default function QueryStatistics() {
const layer = useRef(null);
const [status, setStatus] = useState('Tap “Average population”.');
async function average() {
const records = await layer.current?.queryStatistics({
statistics: [{ field: 'POP', type: 'average', outName: 'avgPop' }],
});
const avg = records?.[0]?.statistics.avgPop;
setStatus(
typeof avg === 'number'
? `Average city population: ${Math.round(avg).toLocaleString()}`
: 'No result'
);
}
return (
}>
);
}
```
# Raster function
> Apply an on-the-fly Hillshade raster function to an image service.
Apply an on-the-fly Hillshade raster function to an image service.  iOS  Android This is the real source of the example app’s `layers/raster-function` screen — run it on a device or simulator to see it live. app/layers/raster-function.tsx
```tsx
import { Map, MapView, RasterLayer } from 'expo-arcgis';
// Esri World Elevation image service.
const ELEVATION = 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer';
// A Hillshade raster function — computed on-the-fly from the elevation raster (the source raster is
// wired in as the function's raster argument by the native layer).
const HILLSHADE = JSON.stringify({
rasterFunction: 'Hillshade',
rasterFunctionArguments: { Azimuth: 315, Altitude: 45, ZFactor: 1 },
outputPixelType: 'U8',
});
/** Applies an on-the-fly Hillshade `rasterFunction` to an elevation image service. */
export default function RasterFunction() {
return (
);
}
```
# Route
> Solve a route and read its metrics.
Solve a route and read its metrics.  iOS  Android This is the real source of the example app’s `routing/route` screen — run it on a device or simulator to see it live. app/routing/route.tsx
```tsx
import { Graphic, GraphicsOverlay, Map, MapView, router, type Geometry } from 'expo-arcgis';
import { useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
/** Solves a route between two stops and draws it with turn-by-turn metrics (router namespace). */
export default function Route() {
const [geometry, setGeometry] = useState(null);
const [status, setStatus] = useState('Tap “Solve route”.');
async function solve() {
const { routes } = await router.solveRoute([
{ point: { type: 'point', x: -118.4965, y: 34.0195 }, name: 'Santa Monica' },
{ point: { type: 'point', x: -118.2437, y: 34.0522 }, name: 'Downtown LA' },
]);
const route = routes[0];
if (route?.geometry) {
setGeometry(route.geometry);
setStatus(
`${(route.totalLength / 1000).toFixed(1)} km · ${Math.round(route.travelTime)} min · ${route.directions.length} steps`
);
} else setStatus('No route found');
}
return (
}>
{geometry && (
)}
);
}
```
# Route tracker
> Turn-by-turn navigation status from tracked locations.
Turn-by-turn navigation status from tracked locations.  iOS  Android This is the real source of the example app’s `routing/route-tracker` screen — run it on a device or simulator to see it live. app/routing/route-tracker.tsx
```tsx
import { Map, MapView, router, type RouteTrackerHandle } from 'expo-arcgis';
import { useRef, useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
/**
* Turn-by-turn navigation: solve a route into a `RouteTracker`, then feed it a device location with
* `trackLocation` (normally from ``). Each call returns the remaining
* distance / time and the current voice-guidance text.
*/
export default function RouteTracker() {
const tracker = useRef(null);
const [status, setStatus] = useState('Tap “Start navigation”.');
async function start() {
setStatus('Solving route…');
tracker.current = await router.createRouteTracker([
{ point: { type: 'point', x: -118.4965, y: 34.0195 }, name: 'Santa Monica' },
{ point: { type: 'point', x: -118.2437, y: 34.0522 }, name: 'Downtown LA' },
]);
const s = await tracker.current.trackLocation({ latitude: 34.0195, longitude: -118.4965, speed: 15 });
setStatus(
`${(s.distanceRemaining / 1000).toFixed(1)} km · ${Math.round(s.timeRemaining)} min left · ${
s.voiceText || s.destinationStatus
}`
);
}
return (
}>
);
}
```
# Scale display filter
> Swap the active where-clause as the map scale changes.
Swap the active where-clause as the map scale changes.  iOS  Android This is the real source of the example app’s `layers/scale-display-filter` screen — run it on a device or simulator to see it live. app/layers/scale-display-filter.tsx
```tsx
import { FeatureLayer, Map, MapView } from 'expo-arcgis';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
/**
* A scale-based display filter swaps the active where-clause as you zoom: only the largest cities
* are drawn at small scales, every city once you zoom in. (`0` = unbounded.)
*/
export default function ScaleDisplayFilter() {
return (
5000000' },
{ minScale: 0, maxScale: 25_000_000, whereClause: '1=1' },
]}
/>
);
}
```
# Display a scene
> A 3D scene with terrain and a camera.
A 3D scene with terrain and a camera.  iOS  Android This is the real source of the example app’s `three-d/scene` screen — run it on a device or simulator to see it live. app/three-d/scene.tsx
```tsx
import { Scene, SceneView, type Camera, type Surface } from 'expo-arcgis';
const CAMERA: Camera = {
position: { x: -118.804, y: 34.0, z: 5330 },
heading: 355,
pitch: 72,
roll: 0,
};
const ELEVATION: Surface = {
elevationSources: [
{ url: 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer' },
],
elevationExaggeration: 2.5,
};
/** A 3D scene with world terrain and an initial camera over the Santa Monica Mountains. */
export default function SceneSample() {
return (
);
}
```
# Scene layer
> Add a 3D object scene layer (buildings).
Add a 3D object scene layer (buildings).  iOS  Android This is the real source of the example app’s `three-d/scene-layer` screen — run it on a device or simulator to see it live. app/three-d/scene-layer.tsx
```tsx
import { Scene, SceneLayer, SceneView, type Camera } from 'expo-arcgis';
// Public 3D object scene layer — San Francisco buildings.
const SF_BUILDINGS =
'https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/SanFrancisco_Bldgs/SceneServer';
const CAMERA_SF: Camera = {
position: { x: -122.4, y: 37.78, z: 600 },
heading: 0,
pitch: 65,
roll: 0,
};
/** Adds a 3D object scene layer (textured buildings) to a scene. */
export default function SceneLayerSample() {
return (
);
}
```
# Service area
> Drive-time reachable-area polygons from a facility.
Drive-time reachable-area polygons from a facility.  iOS  Android This is the real source of the example app’s `routing/service-area` screen — run it on a device or simulator to see it live. app/routing/service-area.tsx
```tsx
import { Graphic, GraphicsOverlay, Map, MapView, serviceArea, type Geometry } from 'expo-arcgis';
import { useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
// Esri World Service Areas (network analysis) service — needs an API key (applied via ).
const SERVICE_AREA_URL =
'https://route-api.arcgis.com/arcgis/rest/services/World/ServiceAreas/NAServer/ServiceArea_World';
// Lightest ring first so the nested cutoffs stay visible.
const FILLS = ['#5856d611', '#5856d622', '#5856d644'];
/** Computes 5 / 10 / 15-minute drive-time areas from a facility (serviceArea namespace). */
export default function ServiceArea() {
const [polygons, setPolygons] = useState([]);
const [status, setStatus] = useState('Tap “Solve service areas”.');
async function solve() {
setStatus('Solving…');
try {
const { polygons: result } = await serviceArea.solve({
serviceUrl: SERVICE_AREA_URL,
facilities: [{ type: 'point', x: -118.4, y: 34.05 }],
cutoffs: [5, 10, 15],
});
// Largest cutoff first so smaller rings draw on top.
setPolygons([...result].sort((a, b) => b.toCutoff - a.toCutoff).map((p) => p.geometry));
setStatus(`${result.length} reachable-area ring(s)`);
} catch (e) {
setStatus(`Error: ${String(e)}`);
}
}
return (
}>
{polygons.map((geometry, i) => (
))}
);
}
```
# Suggest
> Autocomplete a partial search.
Autocomplete a partial search.  iOS  Android This is the real source of the example app’s `geocode/suggest` screen — run it on a device or simulator to see it live. app/geocode/suggest.tsx
```tsx
import { Map, MapView, geocoder } from 'expo-arcgis';
import { useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
/** Autocompletes a partial search into place suggestions (geocoder namespace). */
export default function Suggest() {
const [status, setStatus] = useState('Tap “Suggest ‘Coffee’”.');
async function suggest() {
const results = await geocoder.suggest('Coffee');
setStatus(results.length ? `Top suggestion: ${results[0].label}` : 'No suggestions');
}
return (
}>
);
}
```
# Suggestion round-trip
> Geocode a chosen autocomplete suggestion precisely via its id.
Geocode a chosen autocomplete suggestion precisely via its id.  iOS  Android This is the real source of the example app’s `geocode/suggestion-roundtrip` screen — run it on a device or simulator to see it live. app/geocode/suggestion-roundtrip.tsx
```tsx
import { Map, MapView, geocoder } from 'expo-arcgis';
import { useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
/**
* Autocomplete, then geocode the *chosen* suggestion precisely via its `suggestionId` — the SDK
* reuses the held suggestion instead of re-searching the label text.
*/
export default function SuggestionRoundtrip() {
const [status, setStatus] = useState('Tap to suggest + geocode “Coffee”.');
async function run() {
const suggestions = await geocoder.suggest('Coffee');
if (!suggestions.length) {
setStatus('No suggestions');
return;
}
const top = suggestions[0];
const results = await geocoder.geocodeSuggestion(top.suggestionId);
setStatus(results.length ? `${top.label} → ${results[0].label}` : `No match for ${top.label}`);
}
return (
}>
);
}
```
# Text symbol
> Draw a labeled point with a text symbol.
Draw a labeled point with a text symbol.  iOS  Android This is the real source of the example app’s `symbols/text-symbol` screen — run it on a device or simulator to see it live. app/symbols/text-symbol.tsx
```tsx
import { Graphic, GraphicsOverlay, Map, MapView } from 'expo-arcgis';
/** Draws a labeled point with a `text` symbol (white text + dark halo). */
export default function TextSymbol() {
return (
);
}
```
# Tile cache estimate
> Estimate a tile-cache download size before exporting.
Estimate a tile-cache download size before exporting.  iOS  Android This is the real source of the example app’s `offline/tile-cache-estimate` screen — run it on a device or simulator to see it live. app/offline/tile-cache-estimate.tsx
```tsx
import { Graphic, GraphicsOverlay, Map, MapView, offline, type Geometry } from 'expo-arcgis';
import { useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
// A tiled map service that supports tile-cache export.
const TILE_SERVICE = 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer';
// The rectangle to estimate (a small area over western Europe).
const AREA: Geometry = {
type: 'polygon',
points: [
{ x: -5, y: 52 },
{ x: 9, y: 52 },
{ x: 9, y: 44 },
{ x: -5, y: 44 },
],
};
/** Estimates a tile-cache download size BEFORE exporting (offline.estimateTileCacheSize). */
export default function TileCacheEstimate() {
const [status, setStatus] = useState('Tap “Estimate size”.');
async function estimate() {
setStatus('Estimating…');
try {
const { fileSizeBytes, tileCount } = await offline.estimateTileCacheSize({
serviceUrl: TILE_SERVICE,
area: AREA,
});
setStatus(`${(fileSizeBytes / 1_000_000).toFixed(1)} MB · ${tileCount.toLocaleString()} tiles`);
} catch (e) {
setStatus(`Error: ${String(e)}`);
}
}
return (
}>
);
}
```
# Time extent
> Filter a time-aware layer to a time window via the MapView timeExtent prop.
Filter a time-aware layer to a time window via the MapView timeExtent prop.  iOS  Android This is the real source of the example app’s `layers/time-extent` screen — run it on a device or simulator to see it live. app/layers/time-extent.tsx
```tsx
import { Map, MapImageLayer, MapView } from 'expo-arcgis';
import { useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
// A time-aware map service (Atlantic hurricane tracks).
const HURRICANES = 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer';
// The 2005 Atlantic hurricane season (Katrina, Rita, Wilma…), epoch milliseconds.
const SEASON_2005 = { startTime: Date.UTC(2005, 5, 1), endTime: Date.UTC(2005, 10, 30) };
/** Filters a time-aware layer to a time window via the `` `timeExtent` prop. */
export default function TimeExtent() {
const [filtered, setFiltered] = useState(true);
return (
setFiltered((f) => !f)} />
}
>
);
}
```
# AR flyover
> Fly over a scene by moving the device (ARKit / ARCore).
Fly over a scene by moving the device (ARKit / ARCore). This is the real source of the example app’s `toolkit/ar-flyover` screen — run it on a device or simulator to see it live. app/toolkit/ar-flyover.tsx
```tsx
import { useState } from 'react';
import { Scene } from 'expo-arcgis';
import { FlyoverSceneView } from 'expo-arcgis-toolkit';
import { SampleScreen } from '../../src/SampleScreen';
import { describeStatus } from '../../lib/arStatus';
// The Swift Toolkit's flyover example: a web scene of Rotterdam, from 1,000 m up.
const ROTTERDAM_WEB_SCENE = '7558ee942b2547019f66885c44d4f0b1';
/**
* The ArcGIS Toolkit's flyover AR scene view: move the device, and the camera flies over the
* scene, a meter of movement for each kilometer. Needs a device with ARKit or ARCore.
*/
export default function FlyoverSample() {
const [status, setStatus] = useState('Move the device to fly over Rotterdam.');
return (
setStatus(describeStatus(next))}
/>
);
}
```
# AR tabletop
> Place a scene on a table with the camera, and walk around it (ARKit / ARCore).
Place a scene on a table with the camera, and walk around it (ARKit / ARCore). This is the real source of the example app’s `toolkit/ar-tabletop` screen — run it on a device or simulator to see it live. app/toolkit/ar-tabletop.tsx
```tsx
import { useState } from 'react';
import { Scene, SceneLayer, type Surface } from 'expo-arcgis';
import { TableTopSceneView } from 'expo-arcgis-toolkit';
import { SampleScreen } from '../../src/SampleScreen';
import { describeStatus } from '../../lib/arStatus';
// The Swift Toolkit's tabletop example: Portland's building shells, on a transparent surface the
// camera can go below.
const BUILDINGS =
'https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/DevA_BuildingShells/SceneServer';
const SURFACE: Surface = {
elevationSources: [
{ url: 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer' },
],
opacity: 0,
navigationConstraint: 'unconstrained',
};
/**
* The ArcGIS Toolkit's tabletop AR scene view: find a table with the camera, tap it, and the
* buildings stand on it at 1:1000. Needs a device with ARKit or ARCore.
*/
export default function TableTopSample() {
const [status, setStatus] = useState('Point the camera at a table, then tap it to place the scene.');
return (
setStatus(describeStatus(next))}
onTap={({ nativeEvent }) =>
setStatus(
`Tapped ${nativeEvent.mapPoint.latitude.toFixed(5)}, ${nativeEvent.mapPoint.longitude.toFixed(5)}`
)
}
/>
);
}
```
# AR world scale
> Line a scene up with the world around you and drop markers on the ground (ARKit / ARCore).
Line a scene up with the world around you and drop markers on the ground (ARKit / ARCore). This is the real source of the example app’s `toolkit/ar-world-scale` screen — run it on a device or simulator to see it live. app/toolkit/ar-world-scale.tsx
```tsx
import { useState } from 'react';
import { Graphic, GraphicsOverlay, Scene, type Surface } from 'expo-arcgis';
import { WorldScaleSceneView } from 'expo-arcgis-toolkit';
import { SampleScreen } from '../../src/SampleScreen';
import { describeStatus } from '../../lib/arStatus';
// As in the Swift Toolkit's world-scale example: imagery and terrain on a transparent surface, so
// the camera feed shows, and only what the app draws appears in the world.
const SURFACE: Surface = {
elevationSources: [
{ url: 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer' },
],
opacity: 0,
navigationConstraint: 'unconstrained',
};
type Location = { latitude: number; longitude: number };
/**
* The ArcGIS Toolkit's world-scale AR scene view: the scene lines up with the world around the
* device. Tap to drop a marker where the tap meets the ground. Needs a device with ARKit or ARCore.
*/
export default function WorldScaleSample() {
const [status, setStatus] = useState('Look around, then tap the ground to drop a marker.');
const [markers, setMarkers] = useState([]);
return (
setStatus(describeStatus(next))}
onTrackingErrorChange={(error) => error && setStatus(`Tracking: ${error}`)}
onCalibratingChange={(calibrating) => setStatus(calibrating ? 'Calibrating…' : 'Calibrated.')}
onTap={({ nativeEvent }) => {
setMarkers((current) => [...current, nativeEvent.mapPoint]);
setStatus(`Marker ${markers.length + 1} dropped.`);
}}
>
{markers.map((marker, index) => (
))}
);
}
```
# Authenticator
> Sign-in, OAuth and trust prompts for secured content, from the Toolkit's authenticator.
Sign-in, OAuth and trust prompts for secured content, from the Toolkit’s authenticator.  iOS  Android This is the real source of the example app’s `toolkit/authenticator` screen — run it on a device or simulator to see it live. app/toolkit/authenticator.tsx
```tsx
import { useRef, useState } from 'react';
import {
Map,
MapImageLayer,
MapView,
clearCredentialStore,
enablePersistentCredentialStore,
} from 'expo-arcgis';
import { Authenticator, type AuthenticatorHandle } from 'expo-arcgis-toolkit';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
// Esri's demo OAuth app from its samples ("for demo purposes only"), with its registered redirect.
// Android receives the redirect through the toolkit plugin's `oAuthRedirectUris` (app.json).
const OAUTH = {
portalUrl: 'https://www.arcgis.com',
clientId: 'lgAdHkYZYlwwfAhC',
redirectUrl: 'my-ags-app://auth',
};
// Secured content, one layer at a time, each with the prompt it brings up.
const LAYERS = {
// Token-secured ArcGIS Server: a username and password.
token: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA_secure_user1/MapServer',
// Premium ArcGIS Online content: the portal's sign-in page (OAuth).
oauth: 'https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer',
// A self-signed certificate: whether to trust the host. On iOS, app.json allows the host in App
// Transport Security, which would otherwise reject it before any prompt.
untrusted: 'https://self-signed.badssl.com/arcgis/rest/services/Sample/MapServer',
} as const;
const PROMPTS: Record = {
token: 'Token-secured service: the authenticator asks for a username and password.',
oauth: 'ArcGIS Online traffic: the authenticator opens the portal sign-in page (OAuth).',
untrusted: 'Self-signed host: the authenticator asks whether to trust it.',
};
/**
* The ArcGIS Toolkit's authenticator: while it is mounted it handles the authentication challenges
* and shows the Toolkit's prompts. Load a secured layer to bring one up. On leaving, the challenges
* go back to expo-arcgis's handler.
*/
export default function AuthenticatorSample() {
const authenticator = useRef(null);
const [layer, setLayer] = useState(null);
const [load, setLoad] = useState(0);
const [status, setStatus] = useState('Load secured content to bring up a prompt.');
function show(name: keyof typeof LAYERS) {
setLayer(name);
setLoad((count) => count + 1);
setStatus(PROMPTS[name]);
}
async function run(label: string, action: () => Promise) {
try {
await action();
setStatus(`${label}: done`);
} catch (error) {
setStatus(`${label}: ${String(error)}`);
}
}
return (
show('token')} />
show('oauth')} />
show('untrusted')} />
run('Persistent credential stores', () => enablePersistentCredentialStore())}
/>
run('Sign out', async () => authenticator.current?.signOut())}
/>
run('Clear credential stores', () => clearCredentialStore())}
/>
>
}
>
{layer && }
);
}
```
# Basemap gallery
> Pick a basemap from ArcGIS Online's developer basemaps.
Pick a basemap from ArcGIS Online’s developer basemaps.  iOS  Android This is the real source of the example app’s `toolkit/basemap-gallery` screen — run it on a device or simulator to see it live. app/toolkit/basemap-gallery.tsx
```tsx
import { Map, MapView } from 'expo-arcgis';
import { BasemapGallery } from 'expo-arcgis-toolkit';
/** The ArcGIS Toolkit's basemap gallery under the map: picking a basemap applies it to the map. */
export default function BasemapGallerySample() {
return (
);
}
```
# Bookmarks
> The map's bookmarks, over the map view and bound by ref below it (iOS).
The map’s bookmarks, over the map view and bound by ref below it (iOS).  iOS This is the real source of the example app’s `toolkit/bookmarks` screen — run it on a device or simulator to see it live. app/toolkit/bookmarks.tsx
```tsx
import { useRef, useState } from 'react';
import { Pressable, StyleSheet, Text, View } from 'react-native';
import { Map, MapView, type MapViewHandle, type Viewpoint } from 'expo-arcgis';
import { Bookmarks } from 'expo-arcgis-toolkit';
// Bookmarks declared on the map; a web map's own saved bookmarks list the same way.
const BOOKMARKS: { name: string; viewpoint: Viewpoint }[] = [
{ name: 'Los Angeles', viewpoint: { latitude: 34.05, longitude: -118.24, scale: 200_000 } },
{ name: 'San Francisco', viewpoint: { latitude: 37.77, longitude: -122.42, scale: 200_000 } },
{ name: 'New York', viewpoint: { latitude: 40.71, longitude: -74.0, scale: 200_000 } },
];
/**
* The ArcGIS Toolkit's bookmarks, bound to the map view both ways: over the map, placed inside the
* `` (the button opens it, picking closes it), and below the map, outside it, through the
* view's ref.
*/
export default function BookmarksSample() {
const mapView = useRef(null);
const [overlay, setOverlay] = useState(false);
const [picked, setPicked] = useState(null);
return (
{overlay ? (
setPicked(bookmark.name)}
onIsPresentedChange={setOverlay}
/>
) : (
setOverlay(true)}>
Bookmarks
)}
{picked ? `Went to ${picked}` : 'Pick a bookmark'}
setPicked(bookmark.name)}
/>
);
}
const styles = StyleSheet.create({
overlay: {
position: 'absolute',
top: 60,
right: 12,
width: 260,
height: 260,
borderRadius: 12,
overflow: 'hidden',
backgroundColor: 'white',
},
button: {
position: 'absolute',
top: 60,
right: 12,
paddingHorizontal: 14,
paddingVertical: 10,
borderRadius: 10,
backgroundColor: 'white',
},
buttonText: { fontSize: 15, fontWeight: '600', color: '#2563eb' },
banner: {
position: 'absolute',
top: 12,
left: 12,
right: 12,
padding: 10,
borderRadius: 10,
backgroundColor: 'rgba(255, 255, 255, 0.92)',
},
text: { fontSize: 15, fontWeight: '600', color: '#1f2937' },
below: { height: 260, backgroundColor: 'white' },
});
```
# Building explorer
> Browse a building's levels and phases in a local scene (iOS).
Browse a building’s levels and phases in a local scene (iOS).  iOS This is the real source of the example app’s `toolkit/building-explorer` screen — run it on a device or simulator to see it live. app/toolkit/building-explorer.tsx
```tsx
import { useRef, useState } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { LocalSceneView, Scene, type LocalSceneViewHandle } from 'expo-arcgis';
import { BuildingExplorer, type BuildingExplorerSelection } from 'expo-arcgis-toolkit';
// Esri's local web scene with Building E, as in the Toolkit's building explorer example.
const LOCAL_WEB_SCENE_ID = 'b7c387d599a84a50aafaece5ca139d44';
/**
* The ArcGIS Toolkit's building explorer below a local scene, bound to the ``
* through its ref: pick a level to see it with the ones above hidden, browse phases and
* categories. iOS only; on Android it renders nothing.
*/
export default function BuildingExplorerSample() {
const view = useRef(null);
const [selection, setSelection] = useState(null);
const label = selection
? [selection.layer, selection.level && `level ${selection.level}`].filter(Boolean).join(' · ')
: 'Pick a level';
return (
{label}
);
}
const styles = StyleSheet.create({
explorer: { height: 360, backgroundColor: 'white' },
banner: {
position: 'absolute',
top: 12,
left: 12,
right: 12,
padding: 10,
borderRadius: 10,
backgroundColor: 'rgba(255, 255, 255, 0.92)',
},
text: { fontSize: 15, fontWeight: '600', color: '#1f2937' },
});
```
# Compass and scalebar
> The ArcGIS Toolkit's compass and scalebar over a rotated map.
The ArcGIS Toolkit’s compass and scalebar over a rotated map.  iOS  Android This is the real source of the example app’s `toolkit/compass-scalebar` screen — run it on a device or simulator to see it live. app/toolkit/compass-scalebar.tsx
```tsx
import { Map, MapView } from 'expo-arcgis';
import { Compass, Scalebar } from 'expo-arcgis-toolkit';
/**
* The ArcGIS Toolkit's compass and scalebar, drawn over the map. Rotate the map with two fingers;
* tap the compass to turn it back to north. `autoHide={false}` keeps the compass on screen while the
* map points north.
*/
export default function CompassScalebar() {
return (
);
}
```
# Feature form
> Tap a feature to edit it in its layer's form, then apply the edits.
Tap a feature to edit it in its layer’s form, then apply the edits.  iOS  Android This is the real source of the example app’s `toolkit/feature-form` screen — run it on a device or simulator to see it live. app/toolkit/feature-form.tsx
```tsx
import { useRef, useState } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Map, MapView, type FeatureRef, type MapViewHandle } from 'expo-arcgis';
import { FeatureFormView } from 'expo-arcgis-toolkit';
// The web map of the Toolkit's feature form example: feature layers with forms.
const WEB_MAP_ID = 'f72207ac170a40d8992b7a3507b44fad';
/**
* The ArcGIS Toolkit's feature form below the map: tap a feature, and the feature `identify` finds
* there (its `ref`) opens in the form its layer defines. Save keeps the edits on the feature's table;
* the sample then applies them to the service through `feature.getLayer()`, as the Toolkit's examples
* do.
*/
export default function FeatureFormSample() {
const mapView = useRef(null);
const [feature, setFeature] = useState(null);
const [status, setStatus] = useState('Tap a feature');
async function editFeatureAt(screenPoint: { x: number; y: number }) {
const results = (await mapView.current?.identify(screenPoint, { tolerance: 12 })) ?? [];
const hit = results.flatMap((result) => result.features)[0];
setFeature(hit?.ref ?? null);
setStatus(hit ? 'Edit, then Save' : 'Tap a feature');
}
async function applyEdits(edited: FeatureRef) {
try {
const layer = await edited.getLayer();
if (!layer) return setStatus('Saved (not a feature layer’s feature)');
const database = await layer.getServiceGeodatabase().catch(() => null);
const results = await (database ?? layer).applyEdits();
setStatus(`Applied ${results.length} edit result(s)`);
} catch (error) {
setStatus(`Saved locally; applying failed: ${String(error)}`);
}
}
return (
editFeatureAt(nativeEvent.screenPoint)}
>
{status}
{feature && (
{
if (event.type === 'savedEdits') applyEdits(feature);
else setStatus('Edits discarded');
}}
onDismiss={() => {
setFeature(null);
setStatus('Tap a feature');
}}
style={styles.form}
/>
)}
);
}
const styles = StyleSheet.create({
form: { height: 420, backgroundColor: 'white' },
banner: {
position: 'absolute',
top: 12,
left: 12,
right: 12,
padding: 10,
borderRadius: 10,
backgroundColor: 'rgba(255, 255, 255, 0.92)',
},
text: { fontSize: 15, fontWeight: '600', color: '#1f2937' },
});
```
# Floating panel
> React content in a panel over the map: drag between detents, filter, go to places (iOS).
React content in a panel over the map: drag between detents, filter, go to places (iOS).  iOS This is the real source of the example app’s `toolkit/floating-panel` screen — run it on a device or simulator to see it live. app/toolkit/floating-panel.tsx
```tsx
import { useMemo, useState } from 'react';
import { FlatList, Pressable, StyleSheet, Text, TextInput, View } from 'react-native';
import { Map, MapView, type Viewpoint } from 'expo-arcgis';
import { FloatingPanel, type FloatingPanelDetent } from 'expo-arcgis-toolkit';
const PLACES: { name: string; viewpoint: Viewpoint }[] = [
{ name: 'Los Angeles', viewpoint: { latitude: 34.05, longitude: -118.24, scale: 300_000 } },
{ name: 'San Francisco', viewpoint: { latitude: 37.77, longitude: -122.42, scale: 200_000 } },
{ name: 'Seattle', viewpoint: { latitude: 47.61, longitude: -122.33, scale: 200_000 } },
{ name: 'Denver', viewpoint: { latitude: 39.74, longitude: -104.99, scale: 200_000 } },
{ name: 'Chicago', viewpoint: { latitude: 41.88, longitude: -87.63, scale: 250_000 } },
{ name: 'New York', viewpoint: { latitude: 40.71, longitude: -74.0, scale: 200_000 } },
{ name: 'Miami', viewpoint: { latitude: 25.76, longitude: -80.19, scale: 200_000 } },
{ name: 'Austin', viewpoint: { latitude: 30.27, longitude: -97.74, scale: 200_000 } },
];
const DETENTS: FloatingPanelDetent[] = ['summary', 'half', 'full', { fraction: 0.4 }];
const ALIGNMENTS = ['leading', 'center', 'trailing'] as const;
function detentLabel(detent: FloatingPanelDetent): string {
if (typeof detent === 'string') return detent;
return 'fraction' in detent ? `${detent.fraction}` : `${detent.height}pt`;
}
/**
* The ArcGIS Toolkit's floating panel over the map, with React content: places to go to, and a field
* to filter them (the panel moves up with the keyboard). Drag the handle between detents, or pick
* one; the map takes the touches outside the panel. Outside portrait (iPad, landscape) the panel
* floats at the top, aligned as picked.
*/
export default function FloatingPanelSample() {
const [detent, setDetent] = useState('half');
const [alignment, setAlignment] = useState<(typeof ALIGNMENTS)[number]>('trailing');
const [isPresented, setIsPresented] = useState(true);
const [viewpoint, setViewpoint] = useState(PLACES[0].viewpoint);
const [filter, setFilter] = useState('');
const places = useMemo(
() => PLACES.filter((place) => place.name.toLowerCase().includes(filter.toLowerCase())),
[filter]
);
return (
Detent: {detentLabel(detent)}
setIsPresented(false)}>
Hide
{DETENTS.map((item) => (
setDetent(item)}
/>
))}
{ALIGNMENTS.map((item) => (
setAlignment(item)}
/>
))}
place.name}
keyboardShouldPersistTaps="handled"
renderItem={({ item }) => (
setViewpoint(item.viewpoint)}>
{item.name}
)}
/>
{!isPresented && (
setIsPresented(true)}>
Show panel
)}
);
}
function Chip({
label,
selected,
onPress,
}: {
label: string;
selected: boolean;
onPress: () => void;
}) {
return (
{label}
);
}
const styles = StyleSheet.create({
panel: { flex: 1, paddingHorizontal: 12, paddingTop: 8, gap: 8 },
row: { flexDirection: 'row', alignItems: 'center', gap: 6, flexWrap: 'wrap' },
label: { flex: 1, fontSize: 15, fontWeight: '600' },
link: { fontSize: 15, color: '#007aff' },
chip: {
paddingHorizontal: 10,
paddingVertical: 5,
borderRadius: 14,
backgroundColor: '#e5e5ea',
},
chipSelected: { backgroundColor: '#007aff' },
chipText: { fontSize: 13, color: '#1c1c1e' },
chipTextSelected: { color: 'white' },
input: {
borderRadius: 8,
backgroundColor: '#f2f2f7',
paddingHorizontal: 10,
paddingVertical: 8,
fontSize: 15,
},
place: {
paddingVertical: 12,
borderBottomWidth: StyleSheet.hairlineWidth,
borderColor: '#c6c6c8',
},
placeText: { fontSize: 16 },
show: {
position: 'absolute',
bottom: 40,
alignSelf: 'center',
backgroundColor: 'white',
paddingHorizontal: 16,
paddingVertical: 10,
borderRadius: 20,
shadowColor: 'black',
shadowOpacity: 0.2,
shadowRadius: 6,
shadowOffset: { width: 0, height: 2 },
},
showText: { fontSize: 15, fontWeight: '600', color: '#007aff' },
});
```
# Floor filter
> Browse a floor-aware campus map by site, building and floor.
Browse a floor-aware campus map by site, building and floor.  iOS  Android This is the real source of the example app’s `toolkit/floor-filter` screen — run it on a device or simulator to see it live. app/toolkit/floor-filter.tsx
```tsx
import { useState } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Map, MapView } from 'expo-arcgis';
import { FloorFilter, type FloorFilterSelection } from 'expo-arcgis-toolkit';
// Esri's floor-aware web map of its Redlands campus (public on ArcGIS Online).
const FLOOR_AWARE_WEB_MAP = 'b4b599a43a474d33946cf0df526426f5';
/**
* The ArcGIS Toolkit's floor filter over a floor-aware web map: browse the campus sites and
* buildings, pick a building to zoom to it, then a floor to show only that floor's rooms. The banner
* shows the selection the component reports.
*/
export default function FloorFilterSample() {
const [selection, setSelection] = useState(null);
const label = selection
? [selection.site?.name, selection.facility?.name, selection.level?.longName]
.filter(Boolean)
.join(' › ')
: 'Pick a site, building and floor';
return (
{label}
);
}
const styles = StyleSheet.create({
banner: {
position: 'absolute',
top: 12,
left: 12,
right: 12,
padding: 10,
borderRadius: 10,
backgroundColor: 'rgba(255, 255, 255, 0.92)',
},
text: { fontSize: 15, fontWeight: '600', color: '#1f2937' },
});
```
# Job manager
> Download a map area as a managed job that survives closing the app (iOS).
Download a map area as a managed job that survives closing the app (iOS).  iOS This is the real source of the example app’s `toolkit/job-manager` screen — run it on a device or simulator to see it live. app/toolkit/job-manager.tsx
```tsx
import { useEffect, useState } from 'react';
import { ScrollView, StyleSheet, Text, View } from 'react-native';
import { offline, type JobRef } from 'expo-arcgis';
import { jobManager } from 'expo-arcgis-toolkit';
import { Button } from '../../components/ui/button';
// The offline-enabled web map of the Toolkit's offline examples; its first preplanned area is small.
const WEB_MAP_ID = 'acc027394bc84c2fb04d1ed317aac674';
type Row = { job: JobRef; progress: number; result?: string };
/**
* The Swift Toolkit's job manager: download a preplanned map area as a managed job. Close the app
* while it downloads, and on the next launch the job comes back (`jobManager.jobs()`), resumes and
* finishes. iOS only.
*/
export default function JobManagerSample() {
const [rows, setRows] = useState([]);
const [status, setStatus] = useState('Loading the managed jobs…');
function follow(job: JobRef) {
setRows((current) => [...current.filter((row) => row.job !== job), { job, progress: 0 }]);
job.addListener('onProgress', ({ progress }) =>
setRows((current) => current.map((row) => (row.job === job ? { ...row, progress } : row)))
);
job
.result()
.then((result) => JSON.stringify(result))
.catch((error) => `failed: ${String(error)}`)
.then((result) =>
setRows((current) => current.map((row) => (row.job === job ? { ...row, result } : row)))
);
}
useEffect(() => {
// The jobs the manager kept across launches: resume the paused ones and follow them.
jobManager
.jobs()
.then(async (jobs) => {
await jobManager.resumeAllPausedJobs();
jobs.forEach(follow);
setStatus(`${jobs.length} managed job(s) kept from before`);
})
.catch((error) => setStatus(String(error)));
}, []);
async function download() {
try {
const job = await offline.downloadPreplannedOfflineMap(WEB_MAP_ID, 0, `managed-${Date.now()}`);
await jobManager.add(job);
follow(job);
setStatus('Downloading as a managed job — close the app to try it');
} catch (error) {
setStatus(String(error));
}
}
async function removeFinished() {
const finished = rows.filter((row) => row.result);
await Promise.all(finished.map((row) => jobManager.remove(row.job)));
setRows((current) => current.filter((row) => !row.result));
}
return (
{status}
{rows.map((row, index) => (
Job {index + 1}
{row.result ?? `${row.progress}%`}
))}
);
}
const styles = StyleSheet.create({
content: { padding: 16, gap: 12 },
status: { fontSize: 15, fontWeight: '600', color: '#1f2937' },
buttons: { flexDirection: 'row', gap: 8 },
row: { padding: 12, borderRadius: 10, backgroundColor: 'white', gap: 4 },
title: { fontWeight: '700' },
});
```
# Legend
> The symbols of the map's layers at the view's scale, over the map view (Android).
The symbols of the map’s layers at the view’s scale, over the map view (Android).  Android This is the real source of the example app’s `toolkit/legend` screen — run it on a device or simulator to see it live. app/toolkit/legend.tsx
```tsx
import { StyleSheet } from 'react-native';
import { FeatureLayer, Map, MapImageLayer, MapView } from 'expo-arcgis';
import { Legend } from 'expo-arcgis-toolkit';
const USA_MAP_SERVICE = 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
/**
* The ArcGIS Toolkit's legend over a map whose layers are declared in JS: a map image layer with
* sublayers and a feature layer. It follows the view's scale: zoom in and the layers that only draw
* up close join it. Android only; on iOS it renders nothing.
*/
export default function LegendSample() {
return (
);
}
const styles = StyleSheet.create({
legend: {
position: 'absolute',
left: 12,
bottom: 36,
width: 230,
height: 320,
borderRadius: 12,
overflow: 'hidden',
backgroundColor: 'white',
},
});
```
# Location button
> Start the location display and cycle its auto-pan modes (iOS only).
Start the location display and cycle its auto-pan modes (iOS only).  iOS This is the real source of the example app’s `toolkit/location-button` screen — run it on a device or simulator to see it live. app/toolkit/location-button.tsx
```tsx
import { Map, MapView } from 'expo-arcgis';
import { LocationButton } from 'expo-arcgis-toolkit';
/**
* The ArcGIS Toolkit's location button. A tap starts the map's location display; further taps cycle
* through the auto-pan modes (recenter, then compass navigation). iOS only: the Kotlin Toolkit has no
* location button.
*/
export default function LocationButtonSample() {
return (
);
}
```
# Offline map areas
> Download a web map's areas and open one offline in the map view.
Download a web map’s areas and open one offline in the map view.  iOS  Android This is the real source of the example app’s `toolkit/offline-map-areas` screen — run it on a device or simulator to see it live. app/toolkit/offline-map-areas.tsx
```tsx
import { useRef, useState } from 'react';
import { Pressable, StyleSheet, Text, View } from 'react-native';
import { Map, MapView, type MapRef } from 'expo-arcgis';
import { OfflineMapAreas, type OfflineMapAreasHandle } from 'expo-arcgis-toolkit';
// The offline-enabled web map of the Toolkit's offline map areas examples (Naperville water network).
const WEB_MAP_ID = 'acc027394bc84c2fb04d1ed317aac674';
/**
* The ArcGIS Toolkit's offline map areas below the map: download a preplanned area, open it, and the
* map view shows the offline map it hands out (``). "Go online" returns to the web map.
*/
export default function OfflineMapAreasSample() {
const areas = useRef(null);
const [offlineMap, setOfflineMap] = useState(null);
return (
{offlineMap ? 'Offline map area' : 'Web map (online)'}
{offlineMap && (
areas.current?.goOnline()}>
Go online
)}
);
}
const styles = StyleSheet.create({
panel: { height: 380, backgroundColor: 'white' },
banner: {
position: 'absolute',
top: 12,
left: 12,
right: 12,
padding: 10,
borderRadius: 10,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
backgroundColor: 'rgba(255, 255, 255, 0.92)',
},
text: { fontSize: 15, fontWeight: '600', color: '#1f2937' },
button: { paddingHorizontal: 10, paddingVertical: 6, borderRadius: 8, backgroundColor: '#2563eb' },
buttonText: { color: 'white', fontWeight: '600' },
});
```
# Overview map
> A small map that outlines the main map's visible area (iOS only).
A small map that outlines the main map’s visible area (iOS only).  iOS This is the real source of the example app’s `toolkit/overview-map` screen — run it on a device or simulator to see it live. app/toolkit/overview-map.tsx
```tsx
import { Map, MapView } from 'expo-arcgis';
import { OverviewMap } from 'expo-arcgis-toolkit';
/**
* The ArcGIS Toolkit's overview map: a small map that outlines the main map's visible area, at 25
* times its scale. Pan and zoom the map; the outline follows. iOS only: the Kotlin Toolkit has no
* overview map.
*/
export default function OverviewMapSample() {
return (
);
}
```
# Popup
> Tap a feature to show its popup: fields, media and attachments.
Tap a feature to show its popup: fields, media and attachments.  iOS  Android This is the real source of the example app’s `toolkit/popup` screen — run it on a device or simulator to see it live. app/toolkit/popup.tsx
```tsx
import { useRef, useState } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Map, MapView, type MapViewHandle, type PopupRef } from 'expo-arcgis';
import { PopupView } from 'expo-arcgis-toolkit';
// The web map of the Toolkit's popup example: layers with authored popups (fields, media,
// attachments).
const WEB_MAP_ID = '9f3a674e998f461580006e626611f9ad';
/**
* The ArcGIS Toolkit's popup view below the map: tap a feature, and the popup `identifyPopups`
* finds there (its `ref`) shows with its fields, media and attachments. Its close button clears it.
*/
export default function PopupSample() {
const mapView = useRef(null);
const [popup, setPopup] = useState(null);
async function showPopupAt(screenPoint: { x: number; y: number }) {
const [result] = (await mapView.current?.identifyPopups(screenPoint, { tolerance: 12 })) ?? [];
setPopup(result?.ref ?? null);
}
return (
showPopupAt(nativeEvent.screenPoint)}
>
{popup ? popup.title : 'Tap a feature'}
{popup && setPopup(null)} style={styles.popup} />}
);
}
const styles = StyleSheet.create({
popup: { height: 380, backgroundColor: 'white' },
banner: {
position: 'absolute',
top: 12,
left: 12,
right: 12,
padding: 10,
borderRadius: 10,
backgroundColor: 'rgba(255, 255, 255, 0.92)',
},
text: { fontSize: 15, fontWeight: '600', color: '#1f2937' },
});
```
# Scene accessories
> The compass and overview map over a 3D scene.
The compass and overview map over a 3D scene.  iOS  Android This is the real source of the example app’s `toolkit/scene-accessories` screen — run it on a device or simulator to see it live. app/toolkit/scene-accessories.tsx
```tsx
import { Scene, SceneView, type Camera, type Surface } from 'expo-arcgis';
import { Compass, OverviewMap } from 'expo-arcgis-toolkit';
const CAMERA: Camera = {
position: { x: -118.804, y: 34.0, z: 5330 },
heading: 355,
pitch: 72,
roll: 0,
};
const ELEVATION: Surface = {
elevationSources: [
{ url: 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer' },
],
};
/**
* Toolkit accessories over a 3D scene: the compass shows the camera's heading (tap it to face north,
* keeping the camera's position and pitch), and the overview map marks the scene's center (iOS only).
*/
export default function SceneAccessories() {
return (
);
}
```
# Search
> Search places with suggestions; results drawn into the app's overlay (iOS).
Search places with suggestions; results drawn into the app’s overlay (iOS).  iOS This is the real source of the example app’s `toolkit/search` screen — run it on a device or simulator to see it live. app/toolkit/search.tsx
```tsx
import { useRef, useState } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { GraphicsOverlay, Map, MapView, type GraphicsOverlayRef } from 'expo-arcgis';
import { Search } from 'expo-arcgis-toolkit';
/**
* The ArcGIS Toolkit's search over the map: suggestions as you type, the world geocoder, results
* drawn into a graphics overlay the app declares, prioritized around the view's center, and
* "Repeat search here" once the map moves. iOS only; on Android it renders nothing.
*/
export default function SearchSample() {
const results = useRef(null);
const [query, setQuery] = useState('');
return (
{query ? `Query: ${query}` : 'Try “coffee”'}
);
}
const styles = StyleSheet.create({
search: { position: 'absolute', top: 0, left: 0, right: 0, height: 380 },
banner: {
position: 'absolute',
bottom: 40,
left: 12,
right: 12,
padding: 10,
borderRadius: 10,
backgroundColor: 'rgba(255, 255, 255, 0.92)',
},
text: { fontSize: 15, fontWeight: '600', color: '#1f2937' },
});
```
# Utility network trace
> Run named traces from starting points tapped on the map; results in the app's overlay.
Run named traces from starting points tapped on the map; results in the app’s overlay.  iOS  Android This is the real source of the example app’s `toolkit/utility-network-trace` screen — run it on a device or simulator to see it live. app/toolkit/utility-network-trace.tsx
```tsx
import { useRef, useState } from 'react';
import { View } from 'react-native';
import {
GraphicsOverlay,
Map,
MapView,
setTokenCredential,
type GraphicsOverlayRef,
type MapViewHandle,
} from 'expo-arcgis';
import { UtilityNetworkTrace } from 'expo-arcgis-toolkit';
import { UN_LOGIN } from '../../src/utilityNetworkLogin';
// Esri's Naperville electric web map with named trace configurations, as in the Toolkit's
// utility network trace example. Its layers are on sampleserver7, behind Esri's public sample login.
const UN_WEB_MAP_ID = '471eb0bf37074b1fbb972b1da70fb310';
// The challenge handler signs in with this login when the web map's layers ask for it.
setTokenCredential(UN_LOGIN.username, UN_LOGIN.password);
/**
* The ArcGIS Toolkit's utility network trace below the map, bound to the `` through its
* ref. Pick a trace configuration, add starting points by tapping the map (the map view's taps go to
* the trace as `mapPoint`), and trace: starting points and results are drawn into the app's overlay.
*/
export default function UtilityNetworkTraceSample() {
const mapView = useRef(null);
const overlay = useRef(null);
const [mapPoint, setMapPoint] = useState<{ latitude: number; longitude: number } | null>(null);
return (
setMapPoint(nativeEvent.mapPoint)}
>
);
}
```
# Utility network
> Load a utility network and run traces.
Load a utility network and run traces.  iOS  Android This is the real source of the example app’s `utility-network/utility-network` screen — run it on a device or simulator to see it live. app/utility-network/utility-network.tsx
```tsx
import {
Map,
MapView,
UtilityNetwork,
setTokenCredential,
type UtilityNetworkHandle,
type UtilityTraceType,
} from 'expo-arcgis';
import { useRef, useState } from 'react';
import { Button } from '../../components/ui/button';
import { SampleScreen } from '../../src/SampleScreen';
import { UN_LOGIN } from '../../src/utilityNetworkLogin';
// Esri sample Naperville electric utility network (token-secured; public sample login).
const NAPERVILLE_UN =
'https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer';
/** Loads a utility network (token auth) and runs connected / downstream traces. */
export default function UtilityNetworkSample() {
const un = useRef(null);
const [loaded, setLoaded] = useState(false);
const [status, setStatus] = useState('Tap “Load network”.');
function load() {
// Store the login; the challenge handler authenticates the service when it loads.
setTokenCredential(UN_LOGIN.username, UN_LOGIN.password);
setLoaded(true);
}
async function trace(type: UtilityTraceType) {
if (!un.current) return setStatus('Load the network first');
setStatus(`Tracing (${type})…`);
try {
const result = await un.current.traceFromQuery('Electric Distribution Device', '1=1', type);
setStatus(`Trace ${type}: ${result.elementCount} element(s)`);
} catch (e) {
setStatus(`Trace error: ${String(e)}`);
}
}
return (
trace('connected')} />
trace('downstream')} />
>
}
>
{loaded && (
setStatus(`Loaded: ${name}`)}
onLoadError={(message) => setStatus(`Load error: ${message}`)}
/>
)}
);
}
```
# Viewshed
> Draw what is visible from an observer over terrain.
Draw what is visible from an observer over terrain.  iOS  Android This is the real source of the example app’s `analysis/viewshed` screen — run it on a device or simulator to see it live. app/analysis/viewshed.tsx
```tsx
import { AnalysisOverlay, Scene, SceneView, Viewshed, type Camera, type Surface } from 'expo-arcgis';
const CAMERA: Camera = {
position: { x: -118.804, y: 34.0, z: 5330 },
heading: 355,
pitch: 72,
roll: 0,
};
const ELEVATION: Surface = {
elevationSources: [
{ url: 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer' },
],
elevationExaggeration: 2.5,
};
/** Draws an exploratory viewshed (what's visible from an observer) over 3D terrain. */
export default function ViewshedSample() {
return (
);
}
```
# Visual variables
> Data-driven marker size and color from a feature attribute.
Data-driven marker size and color from a feature attribute.  iOS  Android This is the real source of the example app’s `symbols/visual-variables` screen — run it on a device or simulator to see it live. app/symbols/visual-variables.tsx
```tsx
import { FeatureLayer, Map, MapView, type Renderer } from 'expo-arcgis';
const WORLD_CITIES =
'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0';
// A simple renderer whose marker size AND color are both driven by the POP field — bigger,
// redder circles for more populous cities. Visual variables layer on top of any renderer.
const RENDERER: Renderer = {
type: 'simple',
symbol: { type: 'simple-marker', color: '#2c7fb8', size: 6 },
visualVariables: [
{ type: 'size', field: 'POP', minDataValue: 100_000, maxDataValue: 10_000_000, minSize: 6, maxSize: 42 },
{
type: 'color',
field: 'POP',
stops: [
{ value: 100_000, color: '#2c7fb8' },
{ value: 10_000_000, color: '#e63946' },
],
},
],
};
/** Data-driven symbology — marker size and color both scale with the POP (population) field. */
export default function VisualVariables() {
return (
);
}
```
# Web map
> Load a web map from a portal item.
Load a web map from a portal item.  iOS  Android This is the real source of the example app’s `basics/web-map` screen — run it on a device or simulator to see it live. app/basics/web-map.tsx
```tsx
import { Map, MapView } from 'expo-arcgis';
// A public ArcGIS Online web map (portal item).
const WEB_MAP_ID = '41281c51f9de45edaf1c8ed44bb10e30';
/** Loads a web map from a portal item — basemap, layers and bookmarks come from the item. */
export default function WebMap() {
return (
);
}
```
# Web scene
> Load a 3D web scene from a portal item.
Load a 3D web scene from a portal item.  iOS  Android This is the real source of the example app’s `three-d/web-scene` screen — run it on a device or simulator to see it live. app/three-d/web-scene.tsx
```tsx
import { Scene, SceneView } from 'expo-arcgis';
// A public ArcGIS Online web scene (portal item).
const WEB_SCENE_ID = '579f97b2f3b94d4a8e48a5f140a6639b';
/** Loads a 3D web scene from a portal item — layers, camera and lighting come from the item. */
export default function WebScene() {
return (
);
}
```
# WMS layer
> Add an OGC WMS layer by service URL and layer name.
Add an OGC WMS layer by service URL and layer name.  iOS  Android This is the real source of the example app’s `layers/wms-layer` screen — run it on a device or simulator to see it live. app/layers/wms-layer.tsx
```tsx
import { Map, MapView, WmsLayer } from 'expo-arcgis';
// A public WMS service (terrestris OpenStreetMap).
const WMS_URL = 'https://ows.terrestris.de/osm/service';
/** Adds an OGC WMS layer by service URL and visible layer name. */
export default function WmsLayerSample() {
return (
);
}
```