My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2449: event maptypeid_changed fires twice
7 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Nov 2010


Sign in to add a comment
 
Reported by [email protected], Jun 3, 2010
 var g = google.maps;
 g.event.addListener(map, "maptypeid_changed", function() {

   alert ("fired");
  });

The listener fires twice when the map type is changed. Especially annoying
when something will be added to the map when the map type is being changed:
It will be added twice.

Jun 3, 2010
#1 [email protected]
I just reported a similar  bug #2450 , it's probably related
Jun 7, 2010
Project Member #2 [email protected]
My tests are not showing that it is firing twice. Can you supply a link to your example that shows this happening.
Status: NeedsMoreInfo
Jun 13, 2010
#3 [email protected]
Yes, when map.setMapTypeId() is called from another function the listener fires twice.
Here is a demonstrator

http://www.wolfpil.de/maptypeid_changed.html

Nov 8, 2010
#4 [email protected]
i still get the same problem in the current version (3.2). please fix this.
Nov 15, 2010
#6 [email protected]
Thanks for the report.
Status: Confirmed
Labels: Internal-3198699
Nov 20, 2010
#7 [email protected]
It appears the maptypeid_changed event is fired when the maptypeid is set whether it is changed or not. That would explain why it is firing twice, once when it is set and once when it is changed.

See http://alttag.org/maps/maptypeid_changed.html and click the "Set to Roadmap" button while the map is already set to be a roadmap. The maptype does not change but the event is still fired.
Nov 28, 2010
Project Member #8 [email protected]
(No comment was entered for this change.)
Status: Fixed
Labels: Fixed-3.3
Sign in to add a comment

Powered by Google Project Hosting