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

点图层pointLayer 使用自定义字体 #1808

Closed
ivan0827 opened this issue Aug 30, 2023 · 3 comments
Closed

点图层pointLayer 使用自定义字体 #1808

ivan0827 opened this issue Aug 30, 2023 · 3 comments

Comments

@ivan0827
Copy link

L7地图的点图层中有一个API:addFontFace(fontFamily: string, fontPath: string): void 添加字体文件;

let fontPath =
  '//at.alicdn.com/t/font_2534097_iiet9d3nekn.woff2?t=1620444089776';
scene.addFontFace(fontFamily, fontPath)

其中fontPath为导入的文件地址,疑惑的是下载到本地的字体文件如何在这里使用?

@lzxue
Copy link
Contributor

lzxue commented Aug 30, 2023

本地路径,打包时候拷贝到本地静态路径,或者上传cdn

@ivan0827
Copy link
Author

本地路径,打包时候拷贝到本地静态路径,或者上传cdn

本地路径这样用吗? let fontPath = ‘@/assets/font_2534097_iiet9d3nekn.woff2';还是需要import 或者 require ;

另外再插一嘴,如果想用自己切的图片是不是还是marker好扩展一点。

@lzxue
Copy link
Contributor

lzxue commented Aug 31, 2023

let fontPath = ‘@/assets/font_2534097_iiet9d3nekn.woff2'; 这一种确保你的路径能访问的,这个是前端问题。

数据量不大,自定义强调使用marker 好

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