1***@163.com
1***@163.com
  • 发布:2018-11-28 10:10
  • 更新:2018-11-28 10:10
  • 阅读:896

百度地图的bubble无法换行,使用canvas也不管用

分类:HTML5+
function addMarker(){  
                var c = document.createElement('canvas')  
                c.width = 100  
                c.height = 100  
                var ctx = c.getContext('2d')  
                ctx.font="30px Arial"  
                ctx.fillText('hello', 10, 50)  
                console.log(c.toDataURL())  
                mui.each(list, function(index, value){  
                    var marker = new plus.maps.Marker(new plus.maps.Point(value.longitude, value.latitude))  
                    marker.setIcon('../../img/marker.png')  
                    marker.setLabel(value.name)  
                    var bubble = new plus.maps.Bubble('default')  
                    bubble.loadImageDataURL(c.toDataURL())  
                    marker.setBubble(bubble)  
                    map.addOverlay(marker)  
                })  
            }
2018-11-28 10:10 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复