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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:54:39+00:00 2026-05-31T13:54:39+00:00

i have a question about google maps markers and javascript. i have a page

  • 0

i have a question about google maps markers and javascript.

i have a page that only has a div (map_canvas) that creates a marker when you click on it, and a textfield where you input the name of a marker and the marker starts bouncing …

to keep track of the markers i have an array of all the markers added. The problem is that when it gets to 20+ markers the UI tends to become unresponsive while its looping…

here is the loop that i have, its inside a function that takes the marker id as a parameter

for (var i=0; i < markers.length; i++) {
        if(markers[i].id == id)
        {
            if(markers[i].getAnimation() != null)
            {
                markers[i].setAnimation(null);
            }
            else
            {
                markers[i].setAnimation(google.maps.Animation.BOUNCE);
            }
        }
        else
            markers[i].setAnimation(null);
    }

please let me know if this is a re-post or if i should provide more information … this is my first question here!

  • 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-31T13:54:41+00:00Added an answer on May 31, 2026 at 1:54 pm

    I would suggest using id as the index in your markers array so that you can access each marker directly rather than looping to find it. Once you have a “current” marker, make a note of which it is in order that you know which one to stop bouncing when you start the next one bouncing.

    var lastmarker;
    ...    
    if (lastmarker) {markers[lastmarker].setAnimation(null)}
    markers[id].setAnimation(google.maps.Animation.BOUNCE);
    lastmarker=id;
    

    Of course, the viability of this suggestion depends on the rest of your code, of which we know nothing.

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

Sidebar

Related Questions

I have a question about Google Maps integration inside a iPhone application. On my
I have a question concerning Google Maps. On the contact page of a website
I have a question about locking. This doesn't have to be only about record
I have a question about Google Fonts. I am using the font Lato from
I have a question about regex/Python. Sorry if this topic has been discussed millions
I have one question about C2DM, I registered yesterday and I got email that
Quick question regarding Google Maps. I have one fully working Google Maps project and
I have a question about Google Admob (referenced libraries GoogleAdMobAdsSdk-4.1.1.jar) . My question :
I'm having this problem: I have two Google maps in one page, showing just
I have a question about how the google crawler (googlebot) will do in this

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.