How do I know what info box I have clicked based say if I have three on he screen at the same time?
Thanks Neil Peddie, County Staff Officer - Operational Support St John Ambulance, 34 St John's Street, Bedford, Bedfordshire, MK42 0DH T 01234 216200 F 01234 353163 P please don't print this e-mail unless you really need to -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of warden [Andrew Leach - Maps API Guru] Sent: 29 December 2008 10:52 To: Google Maps API Subject: Re: Charity Site Help - InfoWindows On Dec 29, 10:29 am, "[email protected]" <[email protected]> wrote: > I have posted this question in the past but due to the volume to > communications passing through the site I did not see the response if > any. > > I have a site with a number of custom markers and when you click on > the page a listener opens up a pop-up window and I can pass static > information into the pop-up window but I can not pass dynamic > information e.g. each bubble to have the information about an chanrity > vehicle. First, ensure that the infoWindow module is loaded (to eliminate timing problems later on): var iw=map.getInfoWindow(); You need never use that variable again. Then, create a div element inside your infoWindow to receive the dynamic information. In this example I'm passing the location and some static information including a "codenum" parameter which might identify the marker. Once the click handler has opened the infoWindow, populate that div element with dynamic data. This trivial example simply puts a random number in it, but you could use GDownloadUrl with the marker identifier to download XML data instead. function createMarker(point, name, address, codenum) { var marker = new GMarker(point); var html = "<b>" + name + "</b> <br/>" + address + "<div id='IWinfo'></div>"; GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(html); document.getElementById("IWinfo").innerHTML=Math.random(); }); return marker; } > I can share the code with anyone who is willing to help out my charity > but please can you reply back directly to be and not via the blog > forum as the messages are seen as Spam on the company server. http://www.catb.org/%7Eesr/faqs/smart-questions.html#noprivate If this answer doesn't help, please post a link. If your server doesn't like Group email, you will need to use the web forum. Andrew No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.0/1866 - Release Date: 28/12/2008 14:23 ------------------------ This email and any attachments are confidential and intended for the named addressee(s) only. Unless expressly stated, opinions in this email are those of the individual sender and not of St John Ambulance. St John Ambulance, a company limited by guarantee. Registered office: St John's Gate, Clerkenwell, London, EC1M 4DA Registered in England no. 3866129 - Registered charity no. 1077265 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
