@@ -1187,7 +1187,7 @@ export class StyleUtils {
11871187 strokeColorArray && strokeColorArray.push(strokeOpacity);
11881188 var stroke = new Style({
11891189 stroke: new StrokeStyle({
1190- width: strokeWidth,
1190+ width: strokeWidth || ZERO ,
11911191 color: strokeColorArray,
11921192 lineCap: lineCap || 'round',
11931193 lineDash: [0]
@@ -1198,9 +1198,10 @@ export class StyleUtils {
11981198 let outlineColorArray = this.hexToRgb(outlineColor);
11991199 // opacity使用style的透明度。保持两根线透明度一致
12001200 outlineColorArray && outlineColorArray.push(strokeOpacity);
1201+ let outlineWidth = strokeWidth === 0 ? ZERO : strokeWidth + 2; //外部宽度=内部样式宽度 + 2
12011202 var outlineStroke = new Style({
12021203 stroke: new StrokeStyle({
1203- width: strokeWidth + 2 , //外部宽度=内部样式宽度 + 2
1204+ width: outlineWidth , //外部宽度=内部样式宽度 + 2
12041205 color: outlineColorArray,
12051206 lineCap: lineCap || 'round',
12061207 lineDash: [0]
@@ -1222,7 +1223,7 @@ export class StyleUtils {
12221223 strokeColorArray && strokeColorArray.push(strokeOpacity);
12231224 var stroke = new Style({
12241225 stroke: new StrokeStyle({
1225- width: strokeWidth,
1226+ width: strokeWidth*0.5 || ZERO ,
12261227 color: strokeColorArray,
12271228 lineCap,
12281229 lineDash
@@ -1235,11 +1236,9 @@ export class StyleUtils {
12351236 outlineColorArray && outlineColorArray.push(strokeOpacity);
12361237 var outlineStroke = new Style({
12371238 stroke: new StrokeStyle({
1238- width: strokeWidth,
1239+ width: strokeWidth || ZERO ,
12391240 color: outlineColorArray,
1240- lineCap,
1241- lineDash,
1242- lineDashOffset: (lineDash[0] + lineDash[1]) / 2
1241+ lineCap
12431242 })
12441243 });
12451244 return [outlineStroke, stroke];
0 commit comments