百度地图自定义头像
一、功能需求
地图上添加水滴背景的用户头像,并附带点击功能。效果如下:

二、代码模块
- 自定义覆盖物的构造函数
//自定义覆盖物
function CircleImgOverlay(point, headerImg, {
width = 57, height = 64 }) {
this._point = point;
this._headerImg = headerImg;
this._width = width;
this._height = height;
}
- 继承覆盖物的抽象基类
CircleImgOverlay.prototype = new BMap.Overlay();
- 调用initialize抽象方法,初始化覆盖物
CircleImgOverlay.prototype.initialize =

最低0.47元/天 解锁文章
2285

被折叠的 条评论
为什么被折叠?



