Select to view content in your preferred language

Save graphics direct to database and refresh display following db update

852
4
06-10-2013 11:42 AM
grahamcooke
Regular Contributor
Hi all,

I have a double headed issue I need to solve. First I need to allow my users to save their generated polygons back to the database as shapefiles. These polygons are multi-part/multi-ring but if I can only save the outer shape that would probably do as a first pass.

Secondly I need to have a display screen which displays my viewer in a "HQ" and refreshes every 20 seconds, picking up any changes users have made to the database by adding new polygon features or changing their status /symbolisation.

I know I can save polygons as text files, but has anyone successfully saved direct to the database from flexviewer?

As ever, hope someone can help!

Cheers
Tags (2)
0 Kudos
4 Replies
AnthonyGiles
Honored Contributor
Graham,

What version of flex are you using, if its the latest why not implement the editing widget:

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Edit_widget/01m30000003v000000/

To refresh your layer you can set the autorefresh attribute in the layer tag:

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Layer_tag_overview/01m30000000p...

Regards

Anthony

P.s. if you are using a 9.3.1 server you could try to implement this widget, but it will need updating

http://www.arcgis.com/home/item.html?id=798746aaabcc4e8f872a321257d8cfd4
0 Kudos
TonyCollins
Regular Contributor
Hi,

Are you using a Geodatabase?  If so, as Anthony suggests, I would think making live edits would be your cleanest solution

If not then just enumerate the relevant graphics in your graphics layer(s) and encode them as JSON which you can store in your custom database as a simple string. To display on a map simply read back the string data from the database and decode back into an Object which you then use to re-render your graphics.
0 Kudos
grahamcooke
Regular Contributor
Thanks for the replies.

I am using version 2.4 but have just started upgrading to 3.3 to investigate the editing widget. Was looking to write these to a centrally held SQL server sde database. I will check out the newest functionality and see how I get on.
0 Kudos
grahamcooke
Regular Contributor
I finally got my application converted to 3.3 and I checked out the edit widget but it looks like it only handles feature layers. I have complex polygons that have been created mn the fly and are displayed in a graphics layer. Is there an easy way to convert graphics in a graphics layer to features so that I can then write these features to an arcgis 10.1 sql server geodatabase?
0 Kudos