Wasn't it nicknickoli who wrote:
>
>I'm trying some canned google code to get info windows on my markers
>but they always appear centered on the map? The coordinates are correct
>and I can see the different lat/ long for each but, when anyone is
>clicked, the info window is always in the center of the map. Panning
>around and clicking pulls the map back to a popup at the map's center.
>Any advise on how to remedy this is appreciated.
>
>http://strans.org/hotspot-goog/
>
>
>On my markers array objects, I see "Object ka=(46.850483, -114.039436)
>jg=(412, 536) Na=0". jg is the same for each marker? Thanks!!
>
>hs.createMarker = function(point, group, html)
>{
> var letteredIcon = new GIcon(G_DEFAULT_ICON);
> letteredIcon.image = 'markers/marker' + group + '.png';
>
> marker = new GMarker(point, { icon:letteredIcon });
If you change that line to
var marker = new GMarker(point, { icon:letteredIcon });
then your createMArker function() will hold Function Closure on it.
With your existing code, you don't get Function Closure, so "marker" is
a reference to the last marker in the loop at the time that the click
occurs.
--
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---