Search code examples
locationgoogle-fusion-tablesfixedinfowindow

Fixed location of info windows


I am making a (very straightforward) map in Google Fusion Tables, with a lot of polygones close to eachother. If one opens the infowindow, it overlaps a large part of the map, which is not convenient. Therefore, I am looking for a way to open the infowindows at a fixed location, for example in the top right corner of the map.

I am new to the code behind the maps and not very familiair to Javascript, but if I understand the documentation right, it is possible to move the info window by calling setPosition() on the info window. It would be nice to get some suggestions for the implementation.


Solution

  • I would use a real fixed element instead of an infoWindow, e.g. a custom control

    Suppress the built-in infoWindow via the suppressInfoWindows-option of the layer.

    Then observe the click-event of the layer and assign the infoWindowHtml-property of the event to the innerHTML of the control.

    Demo: http://jsfiddle.net/doktormolle/eG23U/