How to add markers and save it?

47 views
Skip to first unread message

Georgi Stefanov

unread,
Oct 25, 2011, 4:00:44 PM10/25/11
to google-map...@googlegroups.com
Hi,
I need little help with Google Maps JavaScript API v3. The idea is : I need to make a website with a map. On this map the administrator of the site have to place a markers on diffrent location. Like resturants, schools, shop and etc. I look at the tutorials for "Map overlay" there i found a peace of code which promote me to add markers on the map, but the problem is when i refresh the page the markers disapeared. And the question is how to add markers on  the map  and save it in array or cookie and when the page refreshed they must be there.
(im soory if i have some spelling mistakes but my english is not very  good)

xelawho

unread,
Oct 25, 2011, 5:36:11 PM10/25/11
to Google Maps JavaScript API v3
And the question is how
> to add markers on  the map  and save it in array or cookie and when the
> page refreshed they must be there.

best is to save them to a database. You can use a combination of this:
http://code.google.com/apis/maps/articles/phpsqlinfo_v3.html
and this:
http://code.google.com/apis/maps/articles/phpsqlajax_v3.html

like I did here:
http://xelawho.com/map/input/input2.html

jufemaiz:joel

unread,
Oct 25, 2011, 9:37:23 PM10/25/11
to google-map...@googlegroups.com
What are you developing your backend in? That would be a start. You'll need to, at some point, send the data to it (either GET form, POST form or AJAX request) and "put it somewhere". Then provide a retrieval path.

Bob Torzynski

unread,
Oct 26, 2011, 5:27:57 AM10/26/11
to Google Maps JavaScript API v3
Hi Georgi,

There is an example of a map that does that here: http://zgroks.com/wikka/ZgroksMaps
with source code. It's based on the tutorials cited in the other
responses as well as Google Maps Hacks, Hack #63, http://mappinghacks.com/projects/gmaps/,
by Rich Gibson and Schuyler Erle. Uses version 3 of the Google Maps
API, a little bit of PHP, and an SQL database. Integrates
Markerclusterer, allows icons to be toggled on and off, as well as the
Panoramio layer, etc.

Grab the source code here, if you want: http://zgroks.com/wikka/SourceCodeZgroksMaps

Regards,

Bob
Reply all
Reply to author
Forward
0 new messages