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

请更新高德地图更新后安全密钥的用法 #22

Open
guougopeng opened this issue Sep 15, 2022 · 1 comment
Open

请更新高德地图更新后安全密钥的用法 #22

guougopeng opened this issue Sep 15, 2022 · 1 comment

Comments

@guougopeng
Copy link

高德地图更新后需要安全密钥配合key一起使用,参考其他人的建议,在js文件中加入如下语句

window._AMapSecurityConfig = { securityJsCode:'您申请的安全密钥', }

但并没有效果。希望作者能够更新下程序,或者解答下安全密钥的使用方法。

另外吧高德官方使用说明附下供作者参考:

JSAPI key搭配静态安全密钥以明文设置(不安全,建议开发环境用):

引入地图 JSAPI 脚本之前增加设置 JSAPI 安全密钥的脚本标签,并将您的安全密钥「您申请的安全密钥」替换为您的安全密钥;(注意这个设置必须是在 JSAPI 的脚本加载之前进行设置,否则设置无效。)

`<script type="text/javascript">
window._AMapSecurityConfig = {
securityJsCode:'您申请的安全密钥',
}
</script>

<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=您申请的key值"></script> `

https://lbs.amap.com/api/javascript-api/guide/abc/prepare

@sunjunyan
Copy link

same Question

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