desc: 地图绘制显示车站公里标,

This commit is contained in:
zyy 2019-08-30 17:58:15 +08:00
parent abf1afcdf2
commit 741af50a2a

View File

@ -38,29 +38,29 @@ export default class Station extends Group {
textFill: model.nameFontColor
});
this.add(this.stationText);
}
if (style.Station.kmPostShow) {
const path = window.location.href;
if (style.Station.kmPostShow || path.includes('/map/draw')) {
// 公里标是否显示
let direction = 1;
if (this.style.Station.kilometerPosition == 'up') {
direction = -1;
let direction = 1;
if (this.style.Station.kilometerPosition == 'up') {
direction = -1;
}
this.mileageText = new ETextName({
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
x: model.position.x,
y: model.position.y + ((parseInt(model.nameFont) + 2) * direction),
fontWeight: model.fontWeight,
fontSize: model.kmPostFont || 18,
fontFamily: style.fontFamily,
text: model.kmPost,
textAlign: 'middle',
textVerticalAlign: 'top',
textFill: model.kmPostFontColor
});
this.add(this.mileageText);
}
this.mileageText = new ETextName({
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
x: model.position.x,
y: model.position.y + ((parseInt(model.nameFont) + 2) * direction),
fontWeight: model.fontWeight,
fontSize: model.kmPostFont || 18,
fontFamily: style.fontFamily,
text: model.kmPost,
textAlign: 'middle',
textVerticalAlign: 'top',
textFill: model.kmPostFontColor
});
this.add(this.mileageText);
}
}