I want to create an option in my webmap (drawn with ArcGIS API for JS) where I allow the user to draw polygons (probably using the Sketch widget). I then want to submit this polygon to a database. What's the best way to do this? Perhaps GeoJSON? Are there any options to convert created polygons to geojson with this API?
I'm using php to connect to a postgreSQL db that stores this data.
Thanks!
Solved! Go to Solution.
There's no GeoJson support out of the box. Every ArcGIS geometry has toJSON method which allows to you to convert geometry objects to JSON geometry object. You can then perhaps use the following library to convert it to GeoJSON.
There's no GeoJson support out of the box. Every ArcGIS geometry has toJSON method which allows to you to convert geometry objects to JSON geometry object. You can then perhaps use the following library to convert it to GeoJSON.