I use GoogleMap v3 AutoComplete and I need to completely remove it and unbind all event listeners. My code for initializing and binding to events looks like the following:
var autocomplete = new google.maps.places.Autocomplete($("input").get(0), {
types: ["geocode"]
});
google.maps.event.addListener(autocomplete, 'place_changed', function () {
// handle events
});
I don't find official way to correctly remove autocomplete and unbind all events. Please point me the right way.
Thanks.
clearInstanceListeners
,clearListeners
andremoveListener
. Should I use all of them or I using ofclearInstanceListeners
is enough? – Kanazawa