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>
posted @ 2019-01-29 16:22  YanjieZ  阅读(11048)  评论(0编辑  收藏  举报
Yanjie Z 的一些学习、踩坑、研究的记录,若有问题欢迎指正