Hi,
I am trying to add a feature as soon as an app is opened. I tried the code below but it is not working. The location is turning on however, the feature is not showing up. How can I fix this?
Component.onCompleted: { //Qt.openUrlExternally("%1/home/webmap/viewer.html?webmap=%2".arg(app.portalUrl).arg(portalItem.id)) if (!mapView.locationDisplay.started) { mapView.locationDisplay.start()
mapView.locationDisplay.autoPanMode = Enums.LocationDisplayAutoPanModeRecenter
// create attributes json for the new feature
var featureAttributes = {"xyz" : "xyz"}; // create a new feature using the mouse's map point
var point = mapView.locationDisplay.mapLocation
var feature = featureTable.createFeatureWithAttributes(featureAttributes, point);
// add the new feature to the feature table
featureTable.addFeature(feature);
} else { mapView.locationDisplay.stop()
}
}