I need to pass a custom variable through loa开发者_运维百科dFromWaypoints
so that i can later use that variable in the GEvent.addListener
. Any ideas?
Thanks!
You can use a createDelegate to manage your arguments. And "arguments" is also an unspoken variable to access the function's arguments, even though you didn't assign a parameter to it.
Create Delegate
Although this is in the Sencha.EXTJS framework, most frameworks have a similar method.
GEvent.addListener(marker, "click", myMethod.createDelegate(map, marker, true));
marker will be appended to the list of parameters. I hope this gives you some ideas as to how this might work.
精彩评论