views:

32

answers:

1

Hi,

What is the better way to remove and dispose one MVCObject including unbinds and clearing all events and markers ?. I have tried clearing markers and unbindAll() but the object is not removed of the map. Try with this sample

Thanks.

A: 

I think you might not have the right understanding of the MVCObject.

But if you implement a OverlayView which is a MVCObject then to remove it from a map you need to call setMap(null); and then if you expose a onRemove function that will be called and in that you can clean up all your events.

Is that what you were looking for?

skarE