how to update marker coordinates without reload map/page?

240 views
Skip to first unread message

Entana

unread,
Mar 6, 2011, 1:06:46 PM3/6/11
to Google Maps JavaScript API v3
Hi, i am working on a project that will display the location of all
busses in traffic in the town of Karlstad, Sweden.
I have written a script that gathers information about the coordinates
of every moving bus. This information is updated automaticaly every
10th second and saved in an .txt-file (Number, Destination, Lat, Long)
in one row for each bus.
(The txt-file is updated/rewritten every 10th second)

My question is how to print all this information on a map.
There are approx 40 busses that should be printed out as markers on
the map.

Is there a way to automaticaly update the positions of these markers
without "reseting" the map?

To be clear, its not a problem gathering the information, I just dont
know how to print it out.

geoco...@gmail.com

unread,
Mar 6, 2011, 4:11:21 PM3/6/11
to Google Maps JavaScript API v3
You are looking for AJAX (Asynchronous Javascript And Xml) or a
variant thereof (this is a general topic and doesn't really have
anything to do with this group).

A couple of references:
http://www.google.com/search?client=gmail&rls=gm&q=AJAX

From Mike Williams' Google Maps Javascript (v2) API Tutorial:
The Basics - Part 11 The AJAX Philosophy
http://econym.org.uk/gmap/basic11.htm
(while it contains examples from the v2 API, the concepts apply to
this version (v3) as well)

-- Larry




Reply all
Reply to author
Forward
0 new messages