I got a problem. I am making a map where u can add markers, polylines and polygons using "tools". Like MS Paint and tools there. U click on tool, and then do whatever u want on map. The thing is, i am adding markers without any listeners, so i cant click them - cuz i want that tool just to put marker in chosed place.
And my problem is to create a tool, which would let me to delete these markers. But to do that, my tool would need to add click event listener to markers.. and they were created some time ago. Is that possible? Cuz when i try just to make addeventlistener (marker, 'click, xxx()) i get the error that marker is not defined.
I wont post whole code here, cuz its a lot of it, but if you need any part, just ask, i will post it asap