Hi Team,
I have been trying to access a feature service published on ArcGIS Server 10.6 using ServiceFeatureTable:
I am accessing the feature service as following:
FeatureLayer {
id:trackerFeatureLayer
ServiceFeatureTable{
id:trackingServiceFeatureTable
url:"https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0"
// credential: Credential {
// username: "ABC"
// password: "XYZ"
// }
onApplyEditsStatusChanged: {
if (applyEditsStatus === Enums.TaskStatusCompleted) {
console.log("successfully updated feature");
}
}
}
Since ServiceFeatureTable inherits all the properties from FeatureTable I am trying to add a point to this feature service by using createFeature(), addFeature() and then applyEdits().
When I try using createFeature() it returns null, so I checked if the feature layer is editable or not and it returns fales.
console.log("checking if edits are permitted,",trackingServiceFeatureTable.canAdd())
console.log("checking if featurelayer is editable,",trackingServiceFeatureTable.editable)
var pointFeature = trackingServiceFeatureTable.createFeature();
console.log("checking pointFeature",pointFeature)
Result:
qml: checking if edits are permitted, false
qml: checking if featurelayer is editable, false
qml: checking pointFeature null
Not sure what is wrong in the code, the sample service is public, tried adding credentials user1/user1 however that also fails.