|
@@ -1344,28 +1344,30 @@
|
|
|
}
|
|
|
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 = {
|
|
|
- width: 0,
|
|
|
- height: 0,
|
|
|
- maxwidth: 220,
|
|
|
- title: '路线标注:',
|
|
|
- };
|
|
|
- const infoWindow = new BMapGL.InfoWindow(cl.tips, opts);
|
|
|
- map.openInfoWindow(infoWindow, cl.map);
|
|
|
+ position : cl.map, // 指定文本标注所在的地理位置
|
|
|
+ offset : new BMapGL.Size(5, 0) //设置文本偏移量
|
|
|
+ }
|
|
|
+ const label = new BMapGL.Label(cl.tips, opts); // 创建文本标注对象
|
|
|
+ label.setStyle({
|
|
|
+ color : cl.color,
|
|
|
+ borderRadius: '5px',
|
|
|
+ borderColor: cl.color,
|
|
|
+ padding: '0px 5px',
|
|
|
+ fontSize : '12px',
|
|
|
+ height: '18px',
|
|
|
+ lineHeight : '18px',
|
|
|
+ // fontFamily: '微软雅黑',
|
|
|
+ });
|
|
|
+ map.addOverlay(label);
|
|
|
+ // const opts = {
|
|
|
+ // width: 0,
|
|
|
+ // height: 0,
|
|
|
+ // maxwidth: 220,
|
|
|
+ // title: '路线标注:',
|
|
|
+ // };
|
|
|
+ // const infoWindow = new BMapGL.InfoWindow(cl.tips, opts);
|
|
|
+ // map.openInfoWindow(infoWindow, cl.map);
|
|
|
}
|
|
|
}
|
|
|
})
|