|
@@ -1344,20 +1344,28 @@
|
|
|
}
|
|
|
if (centerList.length > 0) {
|
|
|
for (const cl of centerList) {
|
|
|
+ // const opts = {
|
|
|
+ // position : cl.map, // 指定文本标注所在的地理位置
|
|
|
+ // offset : new BMapGL.Size(5, 5) //设置文本偏移量
|
|
|
+ // }
|
|
|
+ // const label = new BMapGL.Label(cl.tips, opts); // 创建文本标注对象
|
|
|
+ // label.setStyle({
|
|
|
+ // color : cl.color,
|
|
|
+ // fontSize : '10px',
|
|
|
+ // height : '18px',
|
|
|
+ // lineHeight : '18px',
|
|
|
+ // fontFamily: '微软雅黑',
|
|
|
+ // border: '1px solid ' + cl.color,
|
|
|
+ // });
|
|
|
+ // map.addOverlay(label);
|
|
|
const opts = {
|
|
|
- position : cl.map, // 指定文本标注所在的地理位置
|
|
|
- offset : new BMapGL.Size(5, 5) //设置文本偏移量
|
|
|
- }
|
|
|
- const label = new BMapGL.Label(cl.tips, opts); // 创建文本标注对象
|
|
|
- label.setStyle({
|
|
|
- color : cl.color,
|
|
|
- fontSize : '10px',
|
|
|
- height : '18px',
|
|
|
- lineHeight : '18px',
|
|
|
- fontFamily: '微软雅黑',
|
|
|
- border: '1px solid ' + cl.color,
|
|
|
- });
|
|
|
- map.addOverlay(label);
|
|
|
+ width: 0,
|
|
|
+ height: 0,
|
|
|
+ maxwidth: 220,
|
|
|
+ title: '路线标注:',
|
|
|
+ };
|
|
|
+ const infoWindow = new BMapGL.InfoWindow(cl.tips, opts);
|
|
|
+ map.openInfoWindow(infoWindow, cl.map);
|
|
|
}
|
|
|
}
|
|
|
})
|