Thanks Larry I moved the GEvent.trigger(gmarkers[ChosenIndex],"click"); into the bottom of readmap() and it works perfectly now.
Cheers Sam On Mar 23, 3:36 pm, "[email protected]" <[email protected]> wrote: > On Mar 23, 7:22 am, ERG Web <[email protected]> wrote: > > > > > Hi, > > > We are developing an air quality website for Sussex, UK. This shows > > air quality monitoring sites in the area in the map control. > > > As a standard the Googlemap parses the XML which has come from SQL > > Server and then creates the markers as per the code from Mike > > Williams. > > > We needed to add offsets as some sites are directly on top of each > > other (same lat/lng) - the zoom function changes this offset as you > > zoom in/out. The more zoomed out the higher the offset. > > > The lat/lngs are convertted from OS grid ref so we cant just manualy > > change the lat/lng in practice. > > > The problem is when trapping the zoom event the info windows > > dissapears only on Firefox - IE 7 is fine. The zoom event calls the > > readMap function to again draw the markers from XML, but the > > ChosenIndex variable is lost when again calling the click event which > > opens infowindow. If I add an alert the variable is kept and works ok? > > > Any ideas? > > > The site is here: > > >http://pc146-56.erg.kcl.ac.uk/SussexAir/Default.aspx > > > (the sites are only test data for now until we go live) > > > // after reload select site again by passing in ChosenIndex > > // FIREFOX - IF WE ALERT VARIABLE THE WINDOWS STAYS > > OK? > > //alert(site); > > if (site != "" ) > > { > > //alert(ChosenIndex); > > // need to act as if we have selected the site to > > keep bubble > > GEvent.trigger(gmarkers[ChosenIndex],"click"); > > } > > It seems to have the same problem in IE6 also, just not on every > zoom. I think you have a race condition between when the > GEvent.trigger is happening and when your readMap is completing. You > should call the GEvent.trigger inside the callback for the readMap. > > -- Larry --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
