AnsweredAssumed Answered

Customizing the Add Features template

Question asked by glalla_uwi2017 on Sep 24, 2018
Latest reply on Sep 24, 2018 by ESoekianto-esristaff

Good Day,

After numerous failed attempts, I was successful in adding features to my feature class using the Add Feature Template in AppStudio. Now, I want these features to have its attributes as its x and y position or lat and long position as well as a user name. How can this be done? I tried using the code below but it did not run, 

 

Map { id: map anchors.fill: parent wrapAroundEnabled: true FeatureLayer { id: featureLayer featureTable: featureServiceTable //when the user clicks on the map, add feature to the feature layer with the mouse coordinates as geometry, and predefined attributes onMouseClicked: { var featureJson = { geometry: { x: mouse.mapX, y: mouse.mapY, spatialReference: mouse.mapPoint.spatialReference }, attributes: { TYPEDAMAGE: "Minor", PRIMCAUSE: "Earthquake", TYPEDAMAGE_INT: 3 } } if (featureServiceTable.featureTableStatus === Enums.FeatureTableStatusInitialized) { featureServiceTable.addFeature(featureJson) } } }

 

 

Below is a picture of the current attribute table that I want to populate with data. Attribute Table

Outcomes