I'm using Vis.js to draw nodes (called 'places' here) in the browser. To be precise, the node gets drawn in the position that the user clicks on. After searching, I found out that I should use event listener to get the position after each click, so I used it in the constructor of the node that gets called when creating a new node by a method named addPlace(). My problem is that when creating 2 nodes and more, all the nodes get drawn on top of each other in the position that the user first clicks on, meanwhile I want to give the hand to the user to click and precise the position of each node, even though I'm removing the EventListener after adding each node.
I think that the problem might be related to having the same EventListener for all the instances of the class even though it's supposed to get removed after adding each node. Image 1: enter image description here
Image2: enter image description here