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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:06:12+00:00 2026-05-27T11:06:12+00:00

Currently working on a project to upgrade our Goole Maps API from v2 to

  • 0

Currently working on a project to upgrade our Goole Maps API from v2 to v3 and ran into an issue and need confirmation on whether it’s possible to register multiple listeners to the same marker. Can anyone confirm whether Goole Maps API v3 supports multiple listeners on the same marker like API v2 can?

Sample Code:

var mapObject = document.getElementById('map_canvas');
var points = new Array();
var markers = new Array();

var mapOptions = {
    zoom: 16,
    center: new google.maps.LatLng(33.260081, -117.279369),
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    streetViewControl: false,
    draggable: true,
    scaleControl: false,
    zoomControl: true,                  
    panControl: true,                    
    scrollwheel: false,
    disableDoubleClickZoom: false,
    navigationControlOptions: {
    style: google.maps.NavigationControlStyle.ZOOM_PAN
}

map = new google.maps.Map(mapObject, mapOptions);

points.push(lat:'33.260081', lng:'-117.279369');
points.push(lat:'33.260079', lng:'-117.279371');
points.push(lat:'33.260083', lng:'-117.279373');

for (var i in points) {

    var point = points[i];

    var marker = initMarker(point);

    markers.push(marker);

    google.maps.event.addListener(marker, 'mouseover', function() {
        alert('mouseover');
    });

    google.maps.event.addListener(marker, 'click', function() {
        alert('click');
    });

    google.maps.event.addListener(marker, 'mouseout', function() {
        alert('mouseout');
    });

    bounds.extend(new google.maps.LatLng(point.lat, point.lng));
}

When I hover over the marker, it alerts with ‘mouseout’, then ‘mouseover’ twice. I would expect it to just alert with ‘mouseover’ once.

When I click a marker it alerts with ‘click’, then ‘mouseout’, then ‘click’, then ‘mouseover’. I would expect it to just alert ‘click’.

When I disable ‘mouseover’ and ‘mouseout’, ‘click’ works as expected. And when I disable ‘click’ and ‘mouseout’, ‘mouseover’ works as expected.

Is there any reason why these events seem to chain to each other? In API v2 we were able to support this functionality no problem.

Thanks in advance.

— Edit —

This only appears to be happening in Firefox and IE, Chrome handles the events as expected.

— Edit —

I have gone ahead and setup 2 map demos so a side-by-side comparison
can be done.

Version 2 Url: http://map.ownij.com/index2.php

Version 3 Url: http://map.ownij.com/

Version 2 even listener behavior in Firefox, IE, Chrome:

  • mouseover: mouseover
  • click: click
  • mouseout: mouseout

Version 3 event listener behavior in Firefox, IE:

  • mouseover: mouseout, mouseover, mouseover
  • click: click, mouseout, click
  • mouseout: mouseout, mouseout

Version 3 even listener behavior in Chrome:

  • mouseover: mouseover
  • click: click
  • mouseout: mouseout

As you can see, v3 event behavior works as expected in chrome, but in
FF and IE, each event triggers multiple listeners which results in
unusual behavior.

We built our maps to allow a map bubble to appear
when a user hovers over a marker, so when the mouseover fires the
mouseout event, the bubble re-renders indefinitely until the user
moves the mouse off the marker.

We cannot release our v3 upgrade until this has been resolved,
otherwise we rob our clients of current functionality.

— Edit —

Updated code, by changing alerts to console.log() calls, the events fire as expected. It appears there is some unusual event handling with respect to non-infowindow calls (alerts, ebubble, etc.).

  • 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-27T11:06:13+00:00Added an answer on May 27, 2026 at 11:06 am

    Ended up just doing away with the hover listener and going with click listener. Would eventually like to add the hover functionality back, but don’t have the time to track it down now.

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

Sidebar

Related Questions

I'm currently working on project of where 2d terrain maps are saved into a
I am currently working on a project that is moving from .NET 2.0 to
I am currently working on a project which requires migration of content from different
Im currently working on a project that requires the following. I need to be
I'm currently working on an upgrade to a project that extensively uses COM /
I'm working on a Coldfusion project where I need to pull some information from
Im currently working on a project with pygame and am in need of being
I'm currently working on a project in which i need to read some (Latitude,
Currently working on a project where we need to drop in various static html
I'm currently working on project with Haskell, and have found myself some trouble. I'm

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.