ArcGISKit Documentation

Function add(_:​to:​gdb​Version:​)

public func add(
		_ features: [AGKFeature],
		to id: String,
		gdbVersion: String? = nil
	) 

Adds features to the FeatureLayer with the id of id.

To add a feature to the first layer, you could write:

let layers = try await myFeatureServer
	.query(layerQueries: [.init(whereClause: "1=1", layerID: "0")])
var attributes = JSON()
attributes["Greeting"] = "Hi!"

let feature = Feature(geometry: Geometry(x: 0.0, y: 0.0, rings: nil), attributes: attributes)

let res = try await myFeatureServer.add([feature], to: "0")

Parameters

features [AGKFeature]

The Features you wish to add.

id String

The ID of the FeatureLayer you wish to add the features to.

gdb​Version String?

The version of the geo-database you want to add features to.

Throws

AGKRequestError

Returns

[EditResponse].