Skip to content

Commit d6c8ae3

Browse files
committed
fix leaflet矢量瓦片默认字体粗体的bug
1 parent 9decafc commit d6c8ae3

File tree

7 files changed

+103
-20
lines changed

7 files changed

+103
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
- 修复客户端专题图无法加载 `L.Polygon` 的问题
4444
- 修改 `L.superMap.imageMapLayer` 的出图方式为整张image出图
45+
- 修改矢量瓦片字体默认粗体的问题
4546

4647
### for OpenLayers
4748

dist/iclient9-leaflet.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-leaflet.js

Lines changed: 93 additions & 11 deletions
Large diffs are not rendered by default.

dist/iclient9-leaflet.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-leaflet.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/css/header.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@
9797
transform-origin: 50% 0;
9898
-webkit-transform-origin: 50% 0;
9999
-moz-transform-origin: 50% 0;
100-
transition: all .5s linear;
101-
-webkit-transition: all .5s linear;
102-
-moz-transition: all .5s linear;
100+
transition: all .5s ease-out 0.2s;
101+
-webkit-transition: all .5s ease-out 0.2s;
102+
-moz-transition: all .5s ease-out 0.2s;
103103
}
104104

105105
.lang-option {

src/leaflet/overlay/vectortile/TextSymbolizer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export var TextSymbolizer = L.Path.extend({
3030
stroke: true,
3131
fontFamily: "Arial Unicode MS Regular",
3232
fontSize: 14,
33-
fontWeight: 'bold',
33+
fontWeight: 'normal',
3434
textAlign: 'center',
3535
offsetX: 1,
3636
offsetY: 1
@@ -140,7 +140,7 @@ CanvasRenderer.include({
140140

141141
ctx.fillRect(0, 0, size.x, size.y);
142142
ctx.font = [
143-
options.fontWeight ? options.fontWeight : "bold",
143+
options.fontWeight ? options.fontWeight : "normal",
144144
options.fontSize ? options.fontSize : "14px",
145145
options.fontFamily ? options.fontFamily : "Arial Unicode MS Regular,Microsoft Yahei"
146146
].join(" ");
@@ -195,7 +195,7 @@ SVGRenderer.include({
195195
path.setAttribute('text-anchor', options.textAlign === 'center' ? 'middle' : options.textAlign);
196196
path.style.fontSize = options.fontSize;
197197
path.style.fontFamily = options.fontFamily;
198-
path.style.fontWeight = options.fontWeight || "bold";
198+
path.style.fontWeight = options.fontWeight || "normal";
199199
path.style.glyphOrientationVertical = options.rotation||'';
200200
if (options.stroke) {
201201
path.setAttribute('stroke', options.color);

0 commit comments

Comments
 (0)