Skip to content
Guides API

FeatureLayerHandle

FeatureLayerHandle = object

Defined in: src/ExpoArcgis.types.ts:560

addAttachment(objectId, name, contentType, dataBase64): Promise<void>

Defined in: src/ExpoArcgis.types.ts:649

Adds an attachment to the feature with objectId and immediately persists the edit.

number

string

File name (e.g. "photo.jpg").

string

MIME type (e.g. "image/jpeg").

string

Base64-encoded file contents.

Promise<void>


addFeature(attributes, geometry?, apply?): Promise<number | null>

Defined in: src/ExpoArcgis.types.ts:576

Adds a feature (attributes + optional geometry) to the layer’s table. By default pushes the edit to the service and resolves to the new object id; pass apply: false to make a local-only edit, then batch with applyEdits. Resolves to null for non-service tables or local edits.

Record<string, unknown>

Geometry

boolean

Promise<number | null>


addFeatureWithSubtype(subtypeName, attributes?, geometry?, apply?): Promise<number | null>

Defined in: src/ExpoArcgis.types.ts:621

Creates a feature from the named feature subtype (sets the subtype field and inherits the subtype’s default attribute values), then optionally overrides attributes on top and sets geometry. By default pushes the edit to the service and resolves to the new object id; pass apply: false to make a local-only edit. Rejects if no subtype with that name exists. Requires an ArcGIS feature table (service or mobile geodatabase) — rejects for shapefiles and WFS tables, which do not expose feature subtypes.

string

Record<string, unknown>

Geometry

boolean

Promise<number | null>

const id = await layer.current.addFeatureWithSubtype(
'Arterial',
{ ROADNAME: 'Main St' },
{ type: 'point', x: -117.19, y: 34.05 }
);

addFeatureWithTemplate(templateName, attributes?, geometry?, apply?): Promise<number | null>

Defined in: src/ExpoArcgis.types.ts:598

Creates a feature from the named editing template (so the new feature inherits the template’s prototype attributes), then optionally overrides attributes on top and sets geometry. By default pushes the edit to the service and resolves to the new object id; pass apply: false to make a local-only edit. Rejects if no template with that name exists. Requires an ArcGIS feature table (service or mobile geodatabase) — rejects for shapefiles and WFS tables, which do not expose editing templates.

string

Record<string, unknown>

Geometry

boolean

Promise<number | null>

const id = await layer.current.addFeatureWithTemplate(
'Residential',
{ ADDRESS: '1 Main St' },
{ type: 'point', x: -117.19, y: 34.05 }
);

applyEdits(): Promise<EditResult[]>

Defined in: src/ExpoArcgis.types.ts:636

Pushes all pending local edits to the service in one batch; resolves to each edit’s result.

Promise<EditResult[]>


contingentValues(attributes, fieldName): Promise<object[]>

Defined in: src/ExpoArcgis.types.ts:686

Returns the valid coded values for fieldName given the feature’s current attributes. Use this to drive editing-form dropdowns: pass the feature’s current attribute state and the name of the field being edited; returns [{ name, code }] for coded values that satisfy all contingent-value constraints defined on the table.

The table and its ContingentValuesDefinition are loaded automatically. A temporary feature is built from attributes (no server round-trip for the feature itself); only ArcGISFeature tables are supported — rejects for shapefiles and WFS tables.

Record<string, unknown>

string

Promise<object[]>

const options = await layer.current.contingentValues({ habitat: 'oak' }, 'species');
// options → [{ name: 'Red Oak', code: 1 }, { name: 'White Oak', code: 2 }]

deleteAttachment(objectId, attachmentId): Promise<void>

Defined in: src/ExpoArcgis.types.ts:656

Deletes the attachment with attachmentId from the feature with objectId and persists.

number

number

Promise<void>


deleteFeature(objectId, apply?): Promise<void>

Defined in: src/ExpoArcgis.types.ts:634

Deletes the feature with objectId. Pass apply: false for a local-only edit.

number

boolean

Promise<void>


fetchAttachment(objectId, attachmentId): Promise<string>

Defined in: src/ExpoArcgis.types.ts:654

Fetches the binary data for the attachment with attachmentId on the feature with objectId and returns it as a base64 string.

number

number

Promise<string>


getContingentValues(objectId, fieldName): Promise<ContingentValuesResult>

Defined in: src/ExpoArcgis.types.ts:702

Returns the valid contingent values for fieldName on the feature with objectId, given the feature’s current attribute state. Contingent values constrain which attribute values are valid based on the values of other fields (e.g. “species” options depend on “habitat”).

Requires an ArcGIS feature table (service or mobile geodatabase) — rejects for shapefiles and WFS tables. Resolves with an empty contingentValues list when no constraints apply.

number

string

Promise<ContingentValuesResult>

const result = await layer.current.getContingentValues(42, 'species');
// result.contingentValues[0] → { type: 'coded', fieldGroupName: 'HabitatGroup',
// codedValue: { name: 'Oak', code: 1 } }

getServiceGeodatabase(): Promise<ServiceGeodatabaseHandle>

Defined in: src/ExpoArcgis.types.ts:669

Returns the branch-versioning handle for this layer’s service geodatabase (ArcGIS Enterprise branch-versioned services only). Loads the table first; rejects if the layer is not a service feature layer. The same handle is returned on repeat calls.

Promise<ServiceGeodatabaseHandle>


queryAttachments(objectId): Promise<AttachmentInfo[]>

Defined in: src/ExpoArcgis.types.ts:642

Returns the metadata for all attachments on the feature with objectId.

number

Promise<AttachmentInfo[]>


queryExtent(query?): Promise<Geometry | null>

Defined in: src/ExpoArcgis.types.ts:566

Returns the combined extent (envelope) of the features matching query.

QueryParameters

Promise<Geometry | null>


queryFeatureCount(query?): Promise<number>

Defined in: src/ExpoArcgis.types.ts:564

Returns the number of features matching query.

QueryParameters

Promise<number>


queryFeatures(query?): Promise<Feature[]>

Defined in: src/ExpoArcgis.types.ts:562

Returns the features matching query (all features when omitted).

QueryParameters

Promise<Feature[]>


queryFeatureTemplates(): Promise<FeatureTemplate[]>

Defined in: src/ExpoArcgis.types.ts:570

Returns the table’s editing templates (name + prototype attributes), for building edit UIs.

Promise<FeatureTemplate[]>


queryRelatedFeatures(objectId): Promise<RelatedFeaturesResult[]>

Defined in: src/ExpoArcgis.types.ts:640

Queries features related to objectId across all relationships, grouped by relationship.

number

Promise<RelatedFeaturesResult[]>


queryStatistics(query): Promise<StatisticRecord[]>

Defined in: src/ExpoArcgis.types.ts:568

Computes aggregate statistics over the layer’s features.

StatisticsQueryParameters

Promise<StatisticRecord[]>


undoLocalEdits(): Promise<void>

Defined in: src/ExpoArcgis.types.ts:638

Discards all pending local edits made since the last applyEdits.

Promise<void>


updateAttachment(objectId, attachmentId, name, contentType, dataBase64): Promise<void>

Defined in: src/ExpoArcgis.types.ts:663

Updates the attachment with attachmentId on the feature with objectId and persists.

number

number

string

New file name (e.g. "photo.jpg").

string

New MIME type (e.g. "image/jpeg").

string

New base64-encoded file contents.

Promise<void>


updateFeature(objectId, changes, apply?): Promise<void>

Defined in: src/ExpoArcgis.types.ts:628

Updates the feature with objectId. Pass apply: false for a local-only edit.

number

Record<string, unknown>

Geometry

boolean

Promise<void>