开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜