Finally, with new release (v2.77) Google Maps API provides interface to toggle on and off markers on map. I will test it soon, since right now with Run-N-Share I have some problems with markers highlighting. Now to highlight marker I have destroy old one and create new one. In FireFox it causes some delay, and it is especially visible with onmouseover/out
.
With this feature (marker.hide()/marker.show()
) it will be possible to do more smoothly. Just prepare two sets of markers to display (normal and highlighted) and toggle particular marker when mouse pointer hover over search results – should be enough.
For highlighting markers, I’d suggest using GMarker.setImage(), which came out last release. There are several demos of it in the blog. It’s really quite nice for highlighting.