tags:

views:

10

answers:

1

Hi,

I need to pass a custom variable through loadFromWaypoints so that i can later use that variable in the GEvent.addListener. Any ideas?

Thanks!

A: 

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.

CrazyEnigma