HTTPS中调用百度地图API

现象

报错:
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>
原文地址:https://www.cnblogs.com/yanjiez/p/10334623.html