zhugenkz / google-maps-utility-library-v3

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

Infobubble - hiding markers when we use single instance of Infobubble #264

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Demo link or sample code: http://jsfiddle.net/hyCKx/1/

What steps will reproduce the problem?
1. Go to the fiddle - you will see 3 markers on  the map.
2. click on a marker
3. click on another marker

Expected result:
One would expect that the infowindow will close and a new will open with all 
markers still visible on the map

Actual result:
When we click on the second marker, then the infowindow closes, the new one 
opens, but the marker that previously had the infowindow disappears from the 
map.

Version: 0.8

Browser / Operating System:
FF, chrome, IE...

Additional comments:
I was able to track the problem to the bindTo function call in the open_ 
method. Line 1017:
this.bindTo('position', opt_anchor);

If I comment this out then clicking on the markers produces the expected 
results, but then other weird things start to happen...

Original issue reported on code.google.com by danielsd...@yahoo.fr on 4 Jul 2013 at 6:14

GoogleCodeExporter commented 9 years ago
I still don't undestand why this happens, but after I removed nearly 90% of the 
code I found out that using setPosition is creating the problem. 
Over here you can see the same example -> this time I don't use .setPosition
http://jsfiddle.net/hyCKx/2/

The real question now is why do we have this problem when we use setPosition

Original comment by danielsd...@yahoo.fr on 4 Jul 2013 at 1:52

GoogleCodeExporter commented 9 years ago
I've done some testing with this myself and it appears that setPosition() 
actually moves the marker AND the infobox together.  When you click that second 
icon, you are actually overlapping them overtop of each other.  I will 
investigate further...but I think this is expected behaviour as odd as that 
sounds.  If you setPosition on the infobox, the marker will move with the box.  
If you setPosition on the marker, the infobox will move with it.  They are 
bound together this way on purpose.

Marking as invalid.  If you disagree, feel free to comment and I will re-open 
the issue.

Original comment by brett.mc...@gmail.com on 15 Jul 2013 at 10:33