Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout or other time counters for "For Loop" #28

Open
GoogleCodeExporter opened this issue May 16, 2015 · 0 comments
Open

Timeout or other time counters for "For Loop" #28

GoogleCodeExporter opened this issue May 16, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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 :)

Original issue reported on code.google.com by [email protected] on 6 Dec 2011 at 9:31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant