如何将jQuery UI对象声明为addListener Google Map事件? [英] How to declare jQuery UI object into addListener Google Map event?
问题描述
我的街景被嵌入到一个infowindow框中。在infowindow domready 之后加载全景图,并带有addListener事件。
My streetview is embedded into an infowindow box. The panorama is loaded after the infowindow is domready, with addListener event.
我想修改 event.addListener(infowindow,'domready',function()
和将它替换为点击标记时打开的jQuery UI对话框对象 $('#dialogStreetview')
我试着用 event.addListener( $('#dialogStreetview'),'domready',function()
和其他东西,但是当对话框已经准备就绪时,什么也不会触发。
I would like to modify the object in event.addListener(infowindow, 'domready', function()
and replace it with the jQuery UI Dialog object $('#dialogStreetview')
that is open when the marker is clicked. I try with event.addListener($('#dialogStreetview'), 'domready', function()
and other things but nothing is trigger when the dialog is domready.
如何指向这个jQuery对话框对象(jQuery UI事件,其他jQuery或JS动作)?
谢谢。
How to point to this jQuery dialog object (jQuery UI event, other jQuery or JS action) ? Thank you.
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
$( "#dialogStreetview" ).dialog();
});
var pano = null;
//INFOWINDOW
google.maps.event.addListener(infowindow, 'domready', function() {
if (pano != null) {
pano.unbind("position");
pano.setVisible(false);
}
var pano = new google.maps.StreetViewPanorama(document.getElementById("content"), {
navigationControl: true,
enableCloseButton: false,
addressControl: false,
visible: true,
linksControl: false
});
推荐答案
您可以使用对话框打开
对话框的事件:
You could use the dialogopen
event of the dialog :
$("#dialogStreetview").on("dialogopen", function(event, ui) {
而不是
instead of
google.maps.event.addListener(infowindow, 'domready', function() {
在打开jQuery UI对话框时触发 dialogopen
事件.... docs here
The dialogopen
event is triggered when the jQuery UI Dialog is opened .... docs here
这篇关于如何将jQuery UI对象声明为addListener Google Map事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!