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

sprite文件不起作用 #295

Open
pantt opened this issue Jun 27, 2023 · 5 comments
Open

sprite文件不起作用 #295

pantt opened this issue Jun 27, 2023 · 5 comments

Comments

@pantt
Copy link

pantt commented Jun 27, 2023

大佬您好,按照您的文档存放了sprite文件,并且style里面也配置了对应路径,但是地图不显示不起作用,请问是为什么呢?
(我把路由api改成了netMapApi,不影响功能)
image

image
image
image

@jingsam
Copy link
Owner

jingsam commented Jun 27, 2023

你要把devtools打开看看为什么没请求到sprite

@pantt
Copy link
Author

pantt commented Jun 27, 2023

你要把devtools打开看看为什么没请求到sprite
这个文件请求成功了200,但是没有生效 T T

image

@jingsam
Copy link
Owner

jingsam commented Jun 27, 2023

那估计是style里面指定icon-image有问题,或者sprite.json与sprite.png对应不上

@pantt
Copy link
Author

pantt commented Jun 28, 2023

sprite.json与sprite.png

style是按照 (https://juejin.cn/post/6884144929098956813) 这个文档的步骤,把 maptiler-basic-gl-style 中将此项目中的 style.json 文件下载到本地,并修改替换url的;
sprite.json与sprite.png是从在线mapbox里看控制台把图片保存下来,json数据保存下来的

是哪里操作有问题吗?

@jingsam
Copy link
Owner

jingsam commented Jun 28, 2023

给个复现的在线URL

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