Click event inside GoogleMap InfoWindow
I want to display googlemap location details in a info window and a button inside the infowindow, so that after clicking that button, a new QMainwindow will display.
At this point of time I am only able to show开发者_如何学C the default infowindow with close button.
Is it possible to add a clickable event inside the infowindow.
You can set the content of an InfoWindow to be a DOM Node
.
For example, something like this:
var infoWindow = new google.maps.InfoWindow();
var content = document.createElement('button');
google.maps.event.addDomListener(content, 'click', function() {
// open QMainwindow
});
infoWindow.open(map);
精彩评论