Here's a function that makes this easy: https://groups.google.com/d/msg/jquery-en/xDWnbOwLp0I/pyCvgY5rKvUJ
I wrote it as a jQuery plugin, $.slowEach(), but it doesn't actually use jQuery, so you could easily change it to a standalone function if preferred. Just take the body of your for loop and put it inside the slowEach callback with a 5000 ms delay and you should be good. -Mike On Wed, Dec 7, 2011 at 3:42 PM, Cengizhan Peker <[email protected]>wrote: > Hello, > This is my code: > > GDownloadUrl("proxy.php", function(data) { > > var xml = GXml.parse(data); > var markers = xml.documentElement.getElementsByTagName("earhquake"); > for (var i=0; i <= markers.length; i++) { > var name = markers[i].getAttribute("name"); > var lokasyon = markers[i].getAttribute("lokasyon"); > var mag = markers[i].getAttribute("mag"); > var Depth = markers[i].getAttribute("Depth"); > var latlng = new GLatLng(parseFloat(markers[i].getAttribute("lat")), > > parseFloat(markers[i].getAttribute("lng"))); > var marker = createMarker(latlng, name, lokasyon, mag, Depth); > map.addOverlay(marker); > > In here, i need: > > Insert the first row of XML and stop 5 seconds, > then insert the second row of XML and stop 5 seconds again, > and again, and again... > > I have tried some codes like, settimeout(map.addOverlay(marker),5000); > but the codes didn't work or get the first data only. > > So how can i run the "for loop" with some time intervals? > how can i insert the data after 5 seconds? > > Sorry for my bad English. > Thanks a lot :) > > -- > You received this message because you are subscribed to the Google Groups > "Google Maps API V2" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-maps-api?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Maps API V2" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
