Hi guys, I have a Problem. I created a module called Marker. It contains a class and extends from Layer. Now i want handle a click on it self.No clicks on a single Marker will recognized. What can I do? The file is located in ./app/modules
Ah, good old scoping issues. Once the event gets called, this isn't the Marker instance anymore. You can fix it with a "fat arrow": http://webapplog.com/understanding-fat-arrows-in-coffeescript/
hmm cant fiddle it out I get the error: Uncaught TypeError: Marker.on is not a function. I change it to this.on Events.Click => print "marker clicked" or this.on Events.Click, => print "marker clicked". Maybe its not allowed to use the "on"
Let me make you an example. I can't really use your code because it's missing indentation, but I think it will be clear.
Wait no, multiple things might be going wrong. Could you share your code with the "Share" button?
sry I dont use mac. https://github.com/cschaf/tourist-app
http://cschaf.github.io/tourist-app/ live example
Ah, you need to call super before you use the .on function :-/
Thank you very much <3
Bonus tip: you can make your options optional by doing:
`options.width ?= 50`
That way they will only get set if you don't pass it yourself.
Hi Christian Schaf can you attach your project? Cut and paste is tough with facebook and coffescript since whitespace matters and facebook doesn't honor it