HTTPS中调用百度地图API - BMap is not defined


现象

报错:
Mixed Content: The page at 'https://xxxxxxx' was loaded over HTTPS, but requested an insecure script 'http://api.map.baidu.com/api?v=2.0&ak=mybaiduak'. This request has been blocked; the content must be served over HTTPS.

Uncaught ReferenceError: BMap is not defined

解决

在调用百度地图API的URL中加&s=1

<script src="https://api.map.baidu.com/api?v=2.0&ak=my-baidu-ak&s=1" type="text/javascript"></script>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM