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