javascript - Google Maps, over query limit -


i have 14 adresses in json object, want display on map - however, error im on query limit, fine query limit 10 pr second (i think) - however, how display locations on map, without going on query limit? i've tried settimeout() 500ms, im still getting error - appreciated:

$.getjson(apiurl, function( data ) {           _.each(data, function(value, key){              //clear markers             //deletemarkers();              var link = value.linkurl,             address = value.address,             content = value.openinghoursmessage;              settimeout(function(){                  geocodeaddress(link, content, address, map);             }, 500);            });          }); 

instead of 14 queries @ once, performing 14 queries @ once after 500ms ... set delay = 0 outside of each loop, @ end of each loop add 500 delay, use delay instead of value 500 in settimeout

a bit this:

$.getjson(apiurl, function (data) {     var delay = 0;     _.each(data, function (value, key) {          //clear markers         //deletemarkers();          var link = value.linkurl,             address = value.address,             content = value.openinghoursmessage;          settimeout(function () {             geocodeaddress(link, content, address, map);         }, delay);         delay += 500;     }); }); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -