| Issue 3114: | Marker.getVisible() returns undefined | |
| 11 people starred this issue and may be notified of changes. | Back to list |
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]
Mar 8, 2011
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
Same here with MarkerWithLabel and Google Maps v 3.4. Revert to 3.3 seems to fix this for the moment.
Mar 8, 2011
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
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
(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
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
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
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
The tagged release of MarkerWithLabel 1.1.1 was uploaded incorrectly. Use 1.1.2 instead.
Mar 15, 2011
Issue 3123 has been merged into this issue.
Mar 16, 2011
(No comment was entered for this change.)
Status:
Fixed
Labels: Fixed-3.4 |
|
| ► Sign in to add a comment |