GoogleMap InfoWindow 内的点击事件 [英] Click event inside GoogleMap InfoWindow
本文介绍了GoogleMap InfoWindow 内的点击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在信息窗口和信息窗口内的按钮中显示 googlemap 位置详细信息,以便在单击该按钮后,将显示一个新的 QMainwindow.
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 the default infowindow with close button.
是否可以在信息窗口内添加可点击事件.
Is it possible to add a clickable event inside the infowindow.
推荐答案
您可以将 InfoWindow 的内容设置为 DOM Node
.
You can set the content of an InfoWindow to be a DOM Node
.
例如,像这样:
var infoWindow = new google.maps.InfoWindow();
var content = document.createElement('button');
google.maps.event.addDomListener(content, 'click', function() {
// open QMainwindow
});
infoWindow.open(map);
这篇关于GoogleMap InfoWindow 内的点击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文