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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to