问题
I am trying to implement the Baidu Map on my website, everything is done well but the close button ( on right top ) for the infowindw doesn't appear.
Here is my JS code:
var map = new BMap.Map("baidu_map"),
point = new BMap.Point(-77.0763679, 38.8901401),
baiduMapZoom = 12,
marker = new BMap.Marker(point, {icon: new BMap.Symbol(BMap_Symbol_SHAPE_POINT, {scale:1, fillColor:"red",fillOpacity:0.8})});
map.addOverlay( marker );
map.centerAndZoom(point, baiduMapZoom);
var opts = {
width : 180,
height: 95,
title : 'Rates Property',
enableMessage:true
},
infoWindow = new BMap.InfoWindow('1325 North Pierce Street Arlington VA 22209', opts);
marker.addEventListener("click", function(){
map.openInfoWindow( infoWindow, point );
});
// Add a map type control
map.addControl(new BMap.MapTypeControl({
mapTypes:[
BMAP_NORMAL_MAP,
BMAP_HYBRID_MAP
]}));
map.addControl(new BMap.NavigationControl());
Please help with what I am missing.
Note: Ref. used from this link but there is no such specific code for showing infowindow, still that map has infowindow with the close button on the right top.
来源:https://stackoverflow.com/questions/58185062/why-close-button-is-not-displayed-for-info-window-opened-on-baidu-map