My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 3114: Marker.getVisible() returns undefined
11 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Mar 2011


Sign in to add a comment
 
Reported by [email protected], Mar 7, 2011
The examples for the MarkerWithLabel utility library at http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerwithlabel/ stopped working over this past weekend -- the labels for the markers do not appear.

Everything works as expected for v=3.3 but not for v=3.4 or v=3.

It's odd, but I have several complex maps that continue to work well with MarkerWithLabel and v=3.4. For some reason, however, these simple examples have stopped working.


See also

https://code.google.com/p/google-maps-utility-library-v3/issues/detail?id=71
Mar 7, 2011
#1 [email protected]
We are experiencing the same problem with the MarkerWithLabel class on our website Mobilitate.co.za. Please see the following urls for examples (note that we are using the MarkerClusterer class to do client side clustering below a zoom level of 5km so you will need to zoom out beyond this level to see the problem with the MarkerWithLabel class): 

http://www.mobilitate.co.za/pg/servicedelivery
http://www.mobilitate.co.za/pg/community/
http://www.mobilitate.co.za/pg/councillors/

Has anyone managed to find a quick fix for this problem that we can use while we wait for an official solution?
Mar 8, 2011
#2 [email protected]
We suspect that the problem with the MarkerWithLabel class was brought in with the latest Google Maps API updates that where made today (March 8, 2011):

https://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog

Resolved issues:

Double clicking on a marker no longer zooms the map (  Issue 3090  )
Anchor point with custom marker shadow now works (  Issue 3112  )

Noticeable changes:

Directions marker z-indexing fixed
Default shadow position fixed
Mar 8, 2011
#3 [email protected]
Same here with MarkerWithLabel and Google Maps v 3.4. Revert to 3.3 seems to fix this for the moment.
Mar 8, 2011
#4 [email protected]
We are experiencing the same issue. The marker itself is still rendered but the secondary marker containing the text only is not. This issue appeared after the March 8 update to v3.4 as mentioned by other above. 

Mar 8, 2011
#5 [email protected]
The problem is occurring in this section of the MarkerWithLabel code:


MarkerLabel_.prototype.setVisible = function () {
  if (this.marker_.get("labelVisible")) {
    this.labelDiv_.style.display = this.marker_.getVisible() ? "block" : "none";
  } else {
    this.labelDiv_.style.display = "none";
  }
  this.eventDiv_.style.display = this.labelDiv_.style.display;
};


This code is failing because -- in v=3.4 only -- this.marker_.getVisible() [in line 3] is returning "undefined" instead of a boolean indicating whether the label's parent marker is visible.

In other words, the getVisible method of the google.maps.Marker class seems to be unavailable. As a result, the label's display property is set to "none" and the label disappears!

Mar 8, 2011
#7 [email protected]
(No comment was entered for this change.)
Summary: Marker.getVisible() returns undefined
Status: Confirmed
Labels: Type-Defect Regression-Yes Internal-4064049 ApiType-Javascript3
Mar 9, 2011
#8 [email protected]
Hint for Google:

The problem is that, when the "visible" property is NOT specified in the marker options passed when a Marker is created, you are not setting the default for the visible property in the constructor for Marker. The solution would be to add the following code to the constructor:

  if (typeof opt_options.visible === "undefined") {
    opt_options.visible = true;
  }

When I add this code to MarkerWithLabel's constructor everything works properly with V3.4. Of course, if you fix the bug in Marker I will not have to add this code to MarkerWithLabel because MarkerWithLabel's constructor calls Marker's constructor (because it is subclassing Marker).
Mar 9, 2011
#9 [email protected]
WORKAROUND

Until Google fixes this bug, an easy workaround is to explicitly set the visible property when you create a new MarkerWithLabel. In most cases you will want to set it to true so that the marker appears as soon as you create it.
Mar 11, 2011
#10 [email protected]
The tagged 1.1.1 release of MarkerWithLabel includes the workaround so should work fine with V3.4 while we're waiting for Google to fix the bug.

http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/
Mar 11, 2011
#11 [email protected]
The tagged release of MarkerWithLabel 1.1.1 was uploaded incorrectly. Use 1.1.2 instead.
Mar 15, 2011
#12 [email protected]
 Issue 3123  has been merged into this issue.
Mar 16, 2011
#13 [email protected]
(No comment was entered for this change.)
Status: Fixed
Labels: Fixed-3.4
Sign in to add a comment

Powered by Google Project Hosting