[Vuejs]-Clear and add markers again using marker.remove()

0👍

Probably a this context scope issue:

setTimeout (this.drawMarker.bind(this), 500)

See also Leaflet- marker click event works fine but methods of the class are undefined in the callback function

This is a classic JavaScript mistake.

this in JavaScript does not necessarily refer to your class instance object. It is the context of the function when it is called.

Leave a comment