Skip to content

clearMarkers issue #18

Closed
jawj opened this Issue Sep 25, 2012 · 2 comments

2 participants

@jawj
Owner
jawj commented Sep 25, 2012

sylon104 commented on 49657fd

Hi, for the life of me i'm trying to clear markers of the oms object from an outside function. I declared the oms variable as a global one. and try to call oms.clearMarkers() within another function to clear those markers but it does not work. Please advise.

@jawj
Owner
jawj commented Sep 25, 2012

(I've added this as an issue, since the comment was unrelated to the commit).

I suspect your problem is that clearMarkers() doesn't do what you think it does. It only removes markers from being tracked and spiderfied. It does not remove them from the map. If you want to remove them from the map, IIRC, you call setMap(null) (provided by the GMaps API) on each marker.

Lots of people have made the same error, so I must add some BIG RED CAPITALS about this to the README somewhere.

@jawj jawj closed this Sep 25, 2012
@sylon104

Thanks for the reply. I figured that was the case. But hit my head on the desk for a couple of hours. Just put my markers in an array and setmap(null) and poof gone!

Thanks. Great library btw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.