0
我忙着试图让我的地图上的信息窗口内容在谷歌地图上的标记我用JQuery的移动和我发现我不能让infowindow自动打开。Jquery移动和谷歌地图openinfowidow加载,而不是点击
目前,它会通过单击事件打开,但加载事件不起作用。
我当前的代码工作如下。
$('#map_canvas').gmap({
'center': '-26.083478,28.092296',
'zoom': 15,
'disableDefaultUI': true
}).bind('init', function (ev, map) {
$('#map_canvas').gmap('addMarker', {
'position': '-26.083478,28.092296',
'icon': 'images/map_logo.png',
'bounds': false
}).click(function() {
$('#map_canvas').gmap('openInfoWindow', {
'content': '<div id="siteNotice">' +
'</div>' +
'<h1 id="firstHeading" class="firstHeading">Lemon Decor</h1>' +
'<div id="bodyContent">' +
'<p>Unit 17, Olympia Gardens<br />' +
'Olympia Street <br />' +
'Marlboro</p>' +
'<p> Tel: 011 262 4116<br />' +
'Fax: 086 697 4110<br />' +
'Email: <a href="mailto:[email protected]">[email protected]</a></p>' +
'</div>' +
'</div>'
}, this);
});
});
如果我我的代码更改为
$('#map_canvas').gmap({
'center': '-26.083478,28.092296',
'zoom': 15,
'disableDefaultUI': true
}).bind('init', function (ev, map) {
$('#map_canvas').gmap('addMarker', {
'position': '-26.083478,28.092296',
'icon': 'images/map_logo.png',
'bounds': false
}).load(function() {
$('#map_canvas').gmap('openInfoWindow', {
'content': '<div id="siteNotice">' +
'</div>' +
'<h1 id="firstHeading" class="firstHeading">Lemon Decor</h1>' +
'<div id="bodyContent">' +
'<p>Unit 17, Olympia Gardens<br />' +
'Olympia Street <br />' +
'Marlboro</p>' +
'<p> Tel: 011 262 4116<br />' +
'Fax: 086 697 4110<br />' +
'Email: <a href="mailto:[email protected]">[email protected]</a></p>' +
'</div>' +
'</div>'
}, this);
});
});
负载事件有没有影响。对此有何想法?