My project call the Google Map API which have speed limitation. So my for loop have to be slowed down.
I have the following for loop JS code:
// Iterate Data and create markers
for (var i in Data) {
address = Data[i].address;
tag = Data[i].tag
placeAddressOnMap(address, tag);
i = i + 1 ;
}
How should I process to slow down an existing for loop ?
I tried the following JS code which doesn't work:
// Iterate Data and create markers
for (var i in Data) {
address = Data[i].address;
tag = Data[i].tag
placeAddressOnMap(address, tag);
i = i + 1 ;
setTimeout(function () { i = i }, 2000); // failing delay using setTimeout(function () { }, 2000);
}