nomo-kazza / google-maps-utility-library-v3

Automatically exported from code.google.com/p/google-maps-utility-library-v3
Apache License 2.0
0 stars 0 forks source link

MarkerWithLabel V3, cannot hide marker labels in V 1.1.0 #325

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
(Sorry for double post. This issue is a copy of my comment in  
https://code.google.com/p/google-maps-utility-library-v3/issues/detail?can=2&sta
rt=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Fixed%20Owner%20Summary%
20Stars&groupby=&sort=&id=60 since I just realized that issue 60 was already 
closed when I commented in it).

Anyway, I'm on:

Windows7 Enterprise SP1
Chrome Version 37.0.2062.120 m
@name MarkerWithLabel for V3
@version 1.1.10 [April 8, 2014]

and I feel so stupid, because I don't see what I'm doing wrong. This code 
alerts all labels, but does not hide them. Why?

function hideLabels() {

    for (i = 0; i < markers.length; i++) {
        alert(markers[i].labelContent);
        markers[i].set("labelVisible", false)
    }
 }

Original issue reported on code.google.com by per.g...@gmail.com on 10 Sep 2014 at 8:18

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
In fact, the labels actually gets hidden after the function runs, but a refresh 
was needed. I found this:

markers[i].label.draw();

which worked for me. So - problem solved.

Original comment by per.g...@gmail.com on 11 Sep 2014 at 11:04