add points to a map

772
3
06-29-2020 10:43 AM
johnmarker
New Contributor III

Hello,

I'm very new to using ArcGIS. I have a starter app that uses qml. When the user clicks on a certain location on the map i want to create a point at that location and show the clicked point on the map. I'm not really sure how to go about this, so any help or suggestions would be appreciated! thank you.

0 Kudos
3 Replies
IhabHassan
Esri Contributor

Hi Walker
Please find the attached code snippet, I used it before to add new feature in a feature service.add feature code snippet
I hope this would help.

Regards

Ihab

Regards
Ihab
johnmarker
New Contributor III

I appreciate the Response! Whenever I add a feature (mouse click on the map) is there a way to save it to a local file system (ie. a json file)? So that the file will contain all of the points on the map and can be re uploaded at any time. 

0 Kudos
IhabHassan
Esri Contributor

No worries. I am not sure about the JSON storage, but the typical workflow for that is to create a local replica - in the form of file geo-database - from the feature service, the edits will be kept on the device, and you will control when you can push the edits to the feature service by starting a sync operation.
In order to prepare your feature service for offline use, this doco here has detailed explanation: Prepare data for offline use—Documentation | Documentation for ArcGIS Enterprise 
Also this QT doco guide is explaining in more details the workflow on syncing offline: Sync offline edits—ArcGIS Runtime SDK for Qt | ArcGIS for Developers 
Please let me know if you have any questions

Regards

Ihab

Regards
Ihab
0 Kudos