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 7407511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:44:03+00:00 2026-05-29T05:44:03+00:00

I am using google map v3 to do some address translation. I pass the

  • 0

I am using google map v3 to do some address translation.
I pass the request and callback function to Geocoder.geocode. The callback function will add a marker on the map. After all, I use map.FitBounds(fullBounds) to make all makers in sight, where map being the Map obejct, fullBounds being LatLngBounds obejct.

below is piece of my code:

    for(i = 0; i < requestArray.length; i ++)
    {
        geo.geocode(requestArray[i], calbck);
    }

My problem is that when I invoke map.fitBounds(fullBounds) in calbck, not all callback functions have finished(always none in my observation). So how can I delay the fitBounds so that all callback functions have finished?

  • 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-05-29T05:44:04+00:00Added an answer on May 29, 2026 at 5:44 am

    If you know the number of callbacks you can call some other function in your callback in which you increase the counter, and when the counter is the same as number of callbacks you execute the code.

    Something like:

    function myFunctionToExecuteAfterCallbacks()
    {
      numCallbacks++;
      if(numCallbacks == numAllCallbacks)
      {
        // Code to execute here...
      }
    }
    

    At least that’s how I solved it one time. Don’t know any better solutions.
    Maybe instead of calling another function you could fire an event. But it’s almost the same…

    Btw, I found some topics on this:

    Best solution to wait for all ajax callbacks to be executed

    javascript: execute a bunch of asynchronous method with one callback

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the Google Maps API v2. I add markers to the map and
Having some problems initialising a google map using geocoding. First issue is with any
I'm trying to extract some extra information from a location using google map api.
I'm using Google Maps API to display a map and some markers on it.
i am displaying some locations using Google map in my application, and displaying all
I have a scenario where I am using Google Map JavaScript API to process
I'm displaying a small Google map on a web page using the Google Maps
Is it possible to do a google map lookup using the google maps API
I am using GWT for google map application. I use Google's gwt-maps.jar for mapping
How to load google map geo-location not using kml. Like this site: http://www.housingmaps.com/

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.