Wasn't it pohvak who wrote:
>
>the problem is....
>i have a button inside the tab, i need... on the click event of the
>button i need to change the html of the tab and put a report (which is
>in another file)

Rather than attempt to modify an existing infowindow, it's much easier
to recreate the whole thing and display a new infowindow with new
contents in the same place.

I tend to use a custom event for this purpose. Let's call it
"buttonclick".

One problem is that the onclick code in your button can only access
global variables and functions, and the reference back to your marker is
normally a local variable held by function closure, which is not
available in global context. The fix for that is to copy the local
reference into a global variable, call it "lastmarker".

var lastmarker; // global variable

GEvent.addListener(marker,"click", function() {
  lastmarker = marker; // save a global reference
  var html = '... <button
onclick="GEvent.trigger(lastmarker,\"buttonclick\")" ... ';
  marker.openInfoWindoTabsHtml(...);
});

[Note: watch out for those nested quotes]

GEvent.addListener(marker,"buttonclick", function() {
  // this executes when the user clicks the button
  // calculate the URL of the file
  GDownloadUrl(url, function(data) {
    // use that data to construct GInfoWindowTabs
    marker.openInfoWindoTabsHtml(...);
  });
});

-- 
http://econym.googlepages.com/index.htm
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to