1 var marker = new BMap.Marker(point, { 2 icon: new BMap.Icon('', new BMap.Size(16, 16), { 3 anchor: new BMap.Size(9, 9) 4 }) 5 }) 6 7 var content = '<span>'+xxxxx+'</span> 8 9 var label = new BMap.Label(content, { 10 offset: new BMap.Size(0, 0) 11 }) 12 label.setStyle({ 13 border: '1px solid rgba(204, 204, 204, 0)', 14 color: 'rgb(0, 255, 255)', 15 borderRadius: '10px', 16 padding: '5px', 17 background: 'rgba(21, 21, 21, 0.5)', 18 display: 'none' 19 }) 20 21 marker.setLabel(label) 22 marker.addEventListener('mouseover', function () { 23 marker.getLabel().setStyle({display: 'block'}) 24 }) 25 marker.addEventListener('mouseout', function () { 26 marker.getLabel().setStyle({display: 'none'}) 27 }) 28 29 map.addOverlay(marker)