On Oct 13, 4:39 pm, Mike Williams <[EMAIL PROTECTED]> wrote:
> Use a createMarker() function to create your markers. Use that function
> to hold Function Closure on any variables that you might want to use in
> the callback function.
>
> function createMarker(point, foo) {
>   var thismarker = new GMarker(point);
>   var bar = ...;
>   GEvent.addListener(thismarker, "click", function() {
>     change_row_style(thismarker, foo, bar, point);
>   });
>
> }
>
> var marker37 = createMarker(new GLatLng(...), "baz");
>
> Any local variables of the createMarker() function [like "thismarker"
> and "bar"] and its parameters [like "point" and "foo"] are held with
> Function Closure and can be passed to change_row_style().
>
> More information than you probably want to know about Function Closure
> here:http://econym.org.uk/gmap/closure.htm
>
> --http://econym.org.uk/gmap
> The Blackpool Community Church Javascript Team

Hi Mike. That's a great suggestion. I'm rolling it around in my head
now, figuring out what will need to be changed in my models,
controllers and views to implement this.

Does this mean that it's not possible to accomplish what I want by
adding a listener to my map?
Do you have any idea why an error occurs when I add a listener to my
map?

Thanks,
Nick
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to