On Nov 26, 10:28 am, Joost van der Steen <[email protected]> wrote: > Okay but what to do. The example you gave is V2. > Don't understand how to set up the helper funtion?
Options: 1. read and understand about function closure (it is a javascript concept that will apply regardless of the API version) Javascript Concepts - Part 3 Function Closure http://econym.org.uk/gmap/closure.htm 2. post a link to your map that exhibits the problem as requested in the posting guidelines: http://groups.google.com/group/Google-Maps-API/web/suggested-posting-guidelines http://groups.google.com/group/google-maps-api/web/why-including-a-link-is-critical 3. move this conversation over to the v3 group, since it is now about v3 (but a link would still help) -- Larry > > On 26 nov, 14:58, Andrew Leach <[email protected]> wrote: > > > > > > > > > On Nov 26, 1:48 pm, Joost van der Steen <[email protected]> > > wrote: > > > > But all markers use the last Id that's taken from the array. So for > > > example I have 2 markers. One with id=1 one with id=2. > > > Both markers call the javascript with id=2? > > > What can I do about this? > > > That's Pitfall Number Three:http://econym.org.uk/gmap/basic1.htm > > > You need to pass your data into a helper function which creates the > > marker. This binds all the data to the individual marker which is > > created, instead of using whatever "koffie[5]" contains when that > > event-handler is run. -- You received this message because you are subscribed to the Google Groups "Google Maps API V2" 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.
