Closed GoogleCodeExporter closed 8 years ago
I believe this is the same bug I've described in another issue, 168.
Original comment by oliveira...@gmail.com
on 11 Apr 2012 at 3:41
I am using this method until fix will available:
google.maps.event.addListener(marker, 'dragend', function(event) {
var mk = new google.maps.Marker({
map: map,
position: marker.getPosition(),
title: marker.getTitle(),
draggable: true,
Icon: new google.maps.MarkerImage("deptstore.png")
});
this.mc.removeMarker(marker);
this.mc.addMarker(mk);
});
very dirty solution - it causes problems with event listerens attached to old
marker, but it works for my purposes
Original comment by v.zoberg...@gmail.com
on 11 Apr 2012 at 4:57
I was considering doing the same, but I have too much built into the individual
markers (listeners and such) -- re-creating it all would be a major issue for
my app.
Original comment by christian.muise
on 11 Apr 2012 at 7:46
This doesn't resolve the core issue, but I've done some digging:
* The disappeared marker is visible, has the right icon, and is assigned to the
correct map.
* The problem arises when a marker is moved, then the map is set to null, and
then the map is set back to the right one.
Because of these things, I've modified the code to always maintain the marker on the right map, but just change its visibility (rather than set the map to null). This won't work if you hide invisible markers from the count, and it definitely causes a hit in performance (noticed with my ~460 marker application).
Attached is the revised (uncompressed) library, and a diff of the fix from the current version of MarkerClustererPlus:
-
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererpl
us/src/markerclusterer.js
Original comment by christian.muise
on 17 Apr 2012 at 4:24
Attachments:
I believe that this is not specifically related to the position property of the
marker, but with any property.
I've described, in issue 168, the same strange behavior caused by changing the
"x" property of google.maps.Icon.origin. I also perceive it when using
animation. Try to set any icon to bounce once it is clicked and you shall have
the same bug. But, if you undo the changes you've made before the marker is
clustered, then the marker behaves normally, being clustered and unclustered
when it should. I have tried that.
Position, icon, animation... My guess is that this bug is due any changes in
the marker properties, and that if you write down the position of the marker,
moved it, and restore its position manually you won't find that bug.
Original comment by oliveira...@gmail.com
on 17 Apr 2012 at 5:18
Interesting. Well resetting the position is definitely out of the question
(since dragging it to the new location is the whole point). Hopefully one of
the clusterer devs will get around to looking at this.
Original comment by christian.muise
on 17 Apr 2012 at 5:52
I think Christian's comment below implies a fundamental Google Maps bug:
"The problem arises when a marker is moved, then the map is set to null, and
then the map is set back to the right one."
Can someone on the Google Maps team check out whether this a bug in the
marker-handling library?
Original comment by garylitt...@gmail.com
on 21 Apr 2012 at 3:57
I now have a minimalist example showing the bug in action with a single
standard (but draggable) marker. Setting a marker's map to null, then setting
it back to the map works perfectly until the marker is dragged, then it doesn't
work at all.
I'll file a report.
Original comment by garylitt...@gmail.com
on 21 Apr 2012 at 4:19
Thanks Gary. Where does it get filed? (I'd like to monitor)
Original comment by christian.muise
on 21 Apr 2012 at 4:25
The bug has now been filed:
http://code.google.com/p/gmaps-api-issues/issues/detail?id=4091
Please begin starring the issue!
Original comment by garylitt...@gmail.com
on 21 Apr 2012 at 4:28
Original comment by garylitt...@gmail.com
on 21 Apr 2012 at 4:31
Google has now fixed this bug in the latest version of the API.
Original comment by garylitt...@gmail.com
on 24 Apr 2012 at 4:25
Original issue reported on code.google.com by
christian.muise
on 4 Apr 2012 at 3:23