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

  • Home
  • SEARCH
  • 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 3311664
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:54:13+00:00 2026-05-17T21:54:13+00:00

I’m quite new to Javascript and the GoogleMaps API.. I have a problem with

  • 0

I’m quite new to Javascript and the GoogleMaps API.. I have a problem with a map that I’m populating with markers.. I have a combo box that allows the user to select a marker and it highlights the marker on the screen for them by popping up an info box for it.

Using Mike Williams excellent tutorial on the google maps API (http://econym.org.uk/gmap/index.htm) I’ve gotten off to a good start and have most of my application working.

The problem can be distilled down into this link, which is a mildly modified version of one of Mike William’s examples:

http://duncanmargetts.com/map3.html

On the initial load of the page you can see 100 markers populated.. an event listener is created on GEvent for each marker and when the user selects an item from the Combo Box the info box is displayed..

I have added a SetInterval that redraws the map every 8 seconds.. after the map is redrawn the Combo Box still loads with the correct contents but the Event Listener won’t fire.. no pop up info box is seen.

Steps to recreate:

  1. Follow the link (http://duncanmargetts.com/map3.html)

  2. Immediately select an item from the drop down box at the bottom of the screen… observe that the associated marker has its pop up box appear.

  3. Wait at least 8 seconds for the setInterval to fire..

  4. Select an Item from the ComboBox.. observe that nothing happens 🙁

A bit of informatin about the code is:

drawMap() is called when the page first loads..
drawMap() is called every 8 seconds thereafter by SetInterval..

drawMap retrieves an XML file with the details of 100 markers and for each marker calls “createMarker”.. along the way select_html, a string, is built up and at the end of the iteration of the markers it is placed in a div (“selection”) using document.getElementById(“selection”).innerHTML = select_html;

I’m guessing maybe I’m not clearing old listeners.. perhaps.. I’ve looked at GEvent.clearListeners but cant work out if a) this is what I need or b) how to integrate it into my code.

Thank you so much for reading this far.. if you have any ideas I’d certainly be very grateful..

With many thanks,

Duncan.

  • 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-17T21:54:13+00:00Added an answer on May 17, 2026 at 9:54 pm

    var i = 0; at line 32 not being reset to zero on each map reload..

    Duncan.

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

Sidebar

Related Questions

I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6

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.