Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文字标记数字和汉字错位 #64

Open
zx3236114 opened this issue Mar 13, 2020 · 1 comment
Open

文字标记数字和汉字错位 #64

zx3236114 opened this issue Mar 13, 2020 · 1 comment

Comments

@zx3236114
Copy link

zx3236114 commented Mar 13, 2020

做地图文字标记的时候,数字和汉字错位了,有什么办法能让他们对齐?

我遇到的问题截图

这是我的代码
map.addLayer({
"id": "nonghumarkers",
"type": "symbol",
"source": "nonghulayer",
"layout": {},
"layout": {
"text-field":"{name}"+ "{area}"+"亩",
"text-font": ["Arial Regular"],
// "text-letter-spacing":0.2,
// "text-pitch-alignment":"map",
"text-line-height":1,
"text-size": 33

        },
        "paint": {
            "text-color": '#FFFFFF',
         
        },
    });

这个是截图
0EDE7803-EAC0-4AB3-BA24-DEB95DA1A17F

另外我尝试了在Mapboxstudio上做文字标注,然后在本地请求查看也是这样
这个是Mapboxstudio上的
C75D86C2-C931-49F1-98D3-EFF129115642
然后这个是我放本地看的情况
DD412085-884B-4DE1-9E92-E62C19660A09

该问题的类别

Web

@jingsam
Copy link

jingsam commented Mar 17, 2020

中英文字体的基线不一致,你需要用最新版本的fontnik重新生成一遍字体,并将mapbox-gl更新到最新版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants