Closing Google v3 API InfoWindow, using FusionTables Layer
We are generating a map with Markers/Infowindows via FusionTables.
The map is being presented via a FusionTables Layer, and I am using the InfoBox plugin in order to create my own custom style of InfoWindow.
This is all fine and dandy. My window appears as I expected.
However, since I'm using our FusionTables setup, all the Markers/InfoWindows are generated. At no point have I manually declared them.
Because of this, I'm getting two InfoWindows. The google default, and my new InfoBox version. I'm creating the Infobox through this listener:
google.maps.event.addListener(layer, 'click', function(e) {
var text = e.infoWindowHtml;
infoBox.setContent(text);
infoBox.setPosition(e.latLng);
infoBox.open(map);
});
At this point, the e results in the following when I log it:
Object
infoWindowHtml: "My Code Is In Here"
latLng: P
pixelOffset: U
row: Object
__proto__: Object
I'm looking for a method to prevent the original InfoWindow from displaying. At the very least, a method to hide/close the InfoWindow on InfoBox o开发者_StackOverflow中文版pen.
It looks like google updated the API docs today http://code.google.com/apis/maps/documentation/javascript/reference.html#FusionTablesLayerOptions
Setting suppressInfoWindows to true will stop the built in info windows from appearing.
精彩评论