【发布时间】:2016-10-20 06:40:41
【问题描述】:
如何在我的标记信息窗口中删除我的“X”按钮?
[ "美人鱼奥布里卡 (nee: Aubry Alexis)", 36.8618, -76.203, 5、 “迈克欧文/乔治亚梅森”, “USAVE汽车租赁”, “弗吉尼亚海滩大道上的弗吉尼亚汽车租赁”, “资产/图像/1.jpg”, “成立” ] ]
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 12,
// center: new google.maps.LatLng(-33.92, 151.25),
center: new google.maps.LatLng(36.8857, -76.2599),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
google.maps.event.addListener(marker, 'mouseover', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker, this);
marker.addListener('click', function() {
map.setCenter(marker.getPosition());
document.getElementById("map").style.width = "50%";
google.maps.event.trigger(map, 'resize')
map.setCenter(marker.getPosition());
document.getElementById("data").style.display = "inline";
document.getElementById("data").innerHTML = locations[i][0] + "<br />" + locations[i][4] + "<br />" + locations[i][5] + "<br />" + locations[i][6] + "<br />" + '<div class="row"><div class="col-md-4"><img class="img-responsive" src="' + locations[i][7] + '" /></div></div>';
document.getElementById("button").style.display = "block";
});
}
})(marker, i, infowindow));
google.maps.event.addListener(marker, 'mouseout', function() {
infowindow.close();
});
}
【问题讨论】:
标签: javascript jquery html google-maps-api-3 google-maps-markers