Search code examples
google-maps-api-3google-fusion-tables

Google Fusion Tables - Event to close infoWindowHtml


Currently using infoWindowHtml to populate the tooltip within an Ajax request. Though, I would like to just remove the thing on an event if possible, that would be fantastic. Any Ideas?

Or do I have to do infowindow.setContent() and then .open?


Solution

  • You can create your own info windows, which allow you control over when they're opened, where they display, what the content is, and when they close. Here are the basic steps:

    • The click event on the layer gives you the lat/lon coordinate of the event - use this to position the info window.
    • Use infoWindowHtml from the event to set the content.
    • Use the open method of the info window the show the window on the map.
    • Finally, use the close method to hide the info window on any event.

    Here's a link to the info window reference for more information:

    http://code.google.com/apis/maps/documentation/javascript/reference.html#InfoWindow