开发者

waypoints pass a custom variable

开发者 https://www.devze.com 2023-01-08 06:21 出处:网络
I need to pass a custom variable through loa开发者_运维百科dFromWaypoints so that i can later use that variable in the GEvent.addListener. Any ideas?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消