Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7993321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:49:09+00:00 2026-06-04T13:49:09+00:00

Here is the link: http://alchemist3d.com/maptest.html Also I’m using geocoder in a loop to get

  • 0

Here is the link: http://alchemist3d.com/maptest.html

Also I’m using geocoder in a loop to get the coordinates of an array of addresses, here is the code:

function initialize() {
  var list = [
  {location:"residencial punta del sol casa 6  temixco Morelos Mexico",body : " 1", title : "m 1"},
  {location:"prol. harris num. 23 ampl. bugambilias jiutepec Morelos Mexico",body : "ampl. bugambilias 2", title : "f 2"},
  {location:"Gladiola Satelite Cuernavaca Morelos Mexico",body:"Montes de Oca"}
  ];
  var latlng = new google.maps.LatLng(18.92009,-99.20611);
  var myOptions = {
    zoom: 12,
    center: latlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  //map.fitBounds(getBounds());
  codeLocations(list, map);
}

function codeLocations(list, map) {
  for (var i = 0; i < list.length; i++) {
    //console.log("Looping " + list[i].location);
    var geocoder = new google.maps.Geocoder();
    var geoOptions = {
      address: list[i].location,
      bounds: getBounds(),
      region: "NO"
    };
    geocoder.geocode(geoOptions, createGeocodeCallback(list[i], map));
  }
}

function createGeocodeCallback(item, map) {
  //console.log("Generating geocode callback for " + item.location);
  return function(results, status) {
    if (status == google.maps.GeocoderStatus.OK) {
      //console.log("Geocoding " + item.location + " OK");
      addMarker(map, item, results[0].geometry.location);
    } else {
      //console.log("Geocode failed " + status);
    }
  }
}

function addMarker(map, item, location) {
  //console.log("Setting marker for " + item.location + " (location: " + location + ")");
  var marker = new google.maps.Marker({ map : map, position : location});
  marker.setTitle(item.title);
  var infowindow = new google.maps.InfoWindow( {
    content : item.body,
    size : new google.maps.Size(100, 300)
  });
  new google.maps.event.addListener(marker, "click", function() {
    infowindow.open(map, marker);
  });
}

function getBounds() {
  var myOptions = {
    zoom: 23,
    center: new google.maps.LatLng(-33.9, 151.2),
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  var southwest = new google.maps.LatLng(17.920,-100.206);
  var northeast =new google.maps.LatLng(19.920,-104.206);
  return new google.maps.LatLngBounds(southwest, northeast);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:49:11+00:00Added an answer on June 4, 2026 at 1:49 pm

    Yes, there is a rate limit, which isn’t too well documented. 9-10 requests per second? If you check the error status, it’s called OVER_QUERY_LIMIT. With 100 markers, I don’t think the common waiting technique will do you much good, because you have a lot of markers. It’s best to geocode once, save the LatLngs and use them.

    If you’re brave, you can try:

    setTimeout(function(){
      geocoder.geocode(geoOptions, createGeocodeCallback(list[i], map));
    }, 200*i);
    

    I don’t know why everyone uses 200 ms, maybe from trial and error? You can try 150, or 100. Still, at 100 ms it will take you 10 seconds to load 100 markers. Another idea I read about is to query in batches. Geocode ten, wait, then another ten.

    An alternate function you can try is sleep.

    function sleep(milliSeconds) {
      var startTime = new Date().getTime();
      while (new Date().getTime() < startTime + milliSeconds);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the link for the site: http://amfotography.com/newsite/clients.html I am only using this folder
Here is the link to the sample code http://developer.apple.com/library/ios/#samplecode/MVCNetworking/Introduction/Intro.html Below is the code snippet
here is link to an example: http://techchorus.net/demos/jquery/hiding-input-elements-in-a-div.html It actally disables few elements on click
So according to the link here: http://www.cplusplus.com/reference/algorithm/max_element/ , the max_element function is O(n), apparently
I'm developing a form with PHP and jQuery. Here is the link: http://www.yamaha-motor.com.pe/extreme/php/yamaha/registro/FrmRegistro01.php It
Folks, why jQuery hover does not work? Here is the link - http://layot.prestatrend.com/ Thanks
I installed Git via the Mac OS X link here http://git-scm.com/download After installing it,
Right now I'm building a website. Here's the link: http://theoew.uuuq.com/home/ This probably won't make
Here's a link: http://www.covers.com/pageLoader/pageLoader.aspx?page=/data/nba/results/2010-2011/boxscore819588.html I'm using HTML Agility Pack and I would like to
Here's the link: http://www.iancreates.com/3dbikefit/ The divs .pod have the following CSS: .pod { background-color:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.