Select to view content in your preferred language

transfering local storage data to database..

1986
4
06-04-2012 08:12 AM
akpagaakpaga
Deactivated User
Hi friends,

I am  using the following sample to store the data for my feature layer:
http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/exp_localstora...


How can i transfer the data from local storage to my  feature service server  .can someone please give suggestions...

Thank you in advance
0 Kudos
4 Replies
BenFousek
Deactivated User
Are you wanting the geometry and attributes for a gis purpose or just to save them for the user in a more permanent form than local storage?

If it's the latter, I suggest using php and mysql to store and retrieve data. I use them so users can save maps, graphics, bookmarks and more. This approach does require some form of authentication for the application. The basic concept involves using dojo's xhrGet, xhrPost, toJson and fromJson on the front-end, and php (php has great json capabilities) & mysql on the back-end. Serialize objects with dojo on the front-end, post and save on the back-end. Retrieve them as needed and use the returned information to return a map to a previous state, recreate graphics, etc. In my opinion it's easier and more functional for such things. One of my newest features (the client who's testing it for me in their application loves it) is the ability to move and size the regions (i.e. map, controls, toolbar, etc) just like ArcMap. Not only is the map, it's layer state and user graphics just as it was last time they used it, so is the individual user's preferred layout of the application. It sounds like you have access to AGS, but it is possible to build a GIS data store with mysql. Mysql does have geometry field types. The JSAPI can be used to add feature layers, query, find, identify, etc from any url that returns json in the proper format. I've even seen dynamic layers returned with php and mysql; albeit slow and graphically unappealing.

That's my broad, non-technical take. If it's of no help, my apologies; but whatever your goal and however you end up there, good luck.
0 Kudos
JohnWall
Regular Contributor
Has anyone tested this and if so, how well did it workout? Are there any tutorials on the more technical side of this?
0 Kudos
BenFousek
Deactivated User
@John
What aspect are you interested in? Saving user info or creating an AGS equivalent in php/mysql? If it's the former I could put together a sample like saving a map, bookmarks or graphics, and add it to the code gallery. It's fairly easy. I'm trying to ease up on my hermit ways. As part of that I'm putting together some samples for the code gallery. I added my first one the other day. If it's the latter, I cannot help. I met someone a few years ago through a friend, while he was in graduate school, who was trying to develop an open source substitute for AGS. I did some testing for him at the time, but then he finished school and moved to China or somewhere over there, and that was the end of that.
0 Kudos
JohnWall
Regular Contributor
@John
What aspect are you interested in? Saving user info or creating an AGS equivalent in php/mysql? If it's the former I could put together a sample like saving a map, bookmarks or graphics, and add it to the code gallery. It's fairly easy. I'm trying to ease up on my hermit ways. As part of that I'm putting together some samples for the code gallery. I added my first one the other day. If it's the latter, I cannot help. I met someone a few years ago through a friend, while he was in graduate school, who was trying to develop an open source substitute for AGS. I did some testing for him at the time, but then he finished school and moved to China or somewhere over there, and that was the end of that.


The former is what I am looking for mainly because I do not know that much about PHP as it relates to ESRI products. Recently I posted my specific question to the ArcServer forum because I was uncertain where to post it exactly.

I was initially trained to use PostgreSQL + ArcSDE however now that PHP has been deemed a must for this project, I'm uncertain how to integrate it with the work we have already done: Convert MySQL to PostgreSQL, Develop an ArcSDE, Host a Service on ArcServer, and Begin developing in the JS API. Now, however, I need to be able to query information which is then shown both in a PHP table/form and on a map.

Might this be possible with the route you know? Would we need to convert back over to MySQL?
0 Kudos