The bottom line is that unless I have a JS alert in my code a JS global variable gmarkers[] is 'undefined' in some functions where I nood to access it. I need some -"you idiot youve forgotten this ... " direction please as my head hurts after all the testing and web searching. Not looking for someone to debug but direction pointers/ known bugs etc. It not a straight forward scoping thing
This can be seen at these two sites IGNORE towns,attractions etc for which there is no data. I have used the range of available "standard" techniques to build a sample map show beach locations. The map allows a collapsible sidebar. The core is an global JS variable gmarkers[] that contains all the marker information. (note these DONOT currently work with IE ) http://www.mymenorca.info/beachesmapwithALERT.php http://www.mymenorca.info/beachesmapnoALERT.php what should happen is that the markers are drawn first. Then the sidebar is created by cycling through the gmarkers array and building up HTML for the sidebar. Clicking on Serviced/Virgin beach "filter" check boxes (top left) will show/hide the respective markers and re- draw the sidebar My alert is place immediately before the cycling loop eg alert("in side bar gmarkers.length " +gmarkers.length); for (var i=0; i<gmarkers.length; i++) { from http://www.mymenorca.info/beachesmapwithALERT.php you can see that my FIREFOX browser believes the length of gmarkers is ZERO, YET will after the alert is clicked away sees that gmarkers.length is now 'defined' and draws the sidebar correctly. Also from then on the show/ hide check box logic works okay. It just seems to be Javascript behavior the no alert version will not draw the INITIAL l sidebar because it thinks gmarkers.length is you so will not cycle thru the markers. I will work thugh if you show/hide the beach categoris with the checkboxes. Apologies if this is bable. Finally ( and the significance is not lost on me ) but neither of these sies will work with IE- I cannot get that to work full stop or trace which thing generates the IE Error --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
