Skip to content

Commit f6b1fbb

Browse files
committed
[bug] 线面数据,标签布局,沿线标注,超出线面范围不显示,加一个参数overflow
review by zhaoq
1 parent 108db78 commit f6b1fbb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/openlayers/mapping/WebMap.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2618,14 +2618,18 @@ export class WebMap extends Observable {
26182618
font: `${fontSize} ${fontFamily}`,
26192619
placement,
26202620
textBaseline,
2621-
textAlign,
26222621
fill: new FillStyle({ color: fill }),
26232622
backgroundFill: new FillStyle({ color: backgroundFill }),
26242623
padding: [3, 3, 3, 3],
26252624
offsetX: layerInfo.featureType === 'POINT' ? offsetX : 0,
26262625
offsetY: layerInfo.featureType === 'POINT' ? offsetY : 0,
2626+
overflow: true,
26272627
maxAngle: 0
26282628
};
2629+
if(layerInfo.featureType === 'POINT') {
2630+
//线面不需要此参数,否则超出线面overflow:true,也不会显示标签
2631+
option.textAlign = textAlign;
2632+
}
26292633
if (outlineWidth > 0) {
26302634
option.stroke = new StrokeStyle({
26312635
color: outlineColor,

0 commit comments

Comments
 (0)