-
Notifications
You must be signed in to change notification settings - Fork 633
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
new GaodeMap的style: "dark"不生效 #1942
Comments
hi @howcodes, welcome! |
新版的高德地图 API 需要设置key(token) 和密钥,出现说的问题大概率没设置密钥,设置密钥有三种方式: |
感谢回复,就是这个问题导致的呢,但是L7官网似乎是没有对这块有说明是吗? |
mark |
通过研究发现L7官方本身没有提供解决方案,我根据查看源码分析得出一个比较另类的解决方法,参考如下: 重点就是要通过在window下注入高德官方密钥,来实现主题数据请求成功 |
问题描述
在过去,我一直没有加入token测试的时候,dark模式一直是生效的,虽然控制台有警告信息
您正在使用 Demo 测试 Token, 生产环境务必自行注册 Token 确保服务稳定 高德地图申请地址 https://lbs.amap.com/api/javascript-api/guide/abc/prepare Mapbox地图申请地址 https://docs.mapbox.com/help/glossary/access-token/!
,但这并不妨碍dark模式的生效直到有一天,由于token一直没加,导致地图页面直接加载不出来,控制台提示
<AMap JSAPI> KEY异常,错误信息:USER_KEY_RECYCLED
,于是我去申请了新的token,然后加入token后发现dark模式失效了,不管怎样都不生效,想问问这是什么原因导致的版本说明
使用的L7版本是
使用的Vue版本是
重现步骤
最后补充
尝试了很久都没能把dark模式使用起来有点沮丧,但是我查看了官网给出vue的demo,地址是:
https://codesandbox.io/s/infallible-ace-m3z9f4?file=/package.json:0-992
,我居然发现里面的案例是dark模式修改后是生效的,于是我把其中的dependencies都修改成和它保持一致结果还是无法生效
于是我整个项目都和它保持一致,很遗憾,还是无法复现dark模式!!!!!
The text was updated successfully, but these errors were encountered: