网页中嵌入百度地图报错:The request has been blocked,the content must served over Https

原文链接: http://www.cnblogs.com/taiyanghua0522/p/7028012.html

网页中嵌入百度地图

1.进入百度地图开发平台:http://lbsyun.baidu.com/index.php?title=jspopular

2.获取密钥:http://lbsyun.baidu.com/apiconsole/key

3.页面上引入js :

4.调用:

 

问题:在本地运行的时候没有任何的问题,地图能正常的显示,但部署到线上,地图不显示,报错:The request has been blocked,the content must served over Https 

解决问题:http://lbsyun.baidu.com/index.php?title=jspopular/guide/introduction

    JavaScript API首家支持Https,已全面开放,无需申请Https服务可直接使用

    改成这个就可以了,https://api.map.baidu.com/api?v=2.0&ak=你的密钥&s=1;

拓展:怎么拾取当前位置的坐标?

  打开http://api.map.baidu.com/lbsapi/getpoint/index.html

  搜索当前位置的坐标:网页中嵌入百度地图报错:The request has been blocked,the content must served over Https_第1张图片

  就可以找到当前坐标了。

 

转载于:https://www.cnblogs.com/taiyanghua0522/p/7028012.html

你可能感兴趣的:(网页中嵌入百度地图报错:The request has been blocked,the content must served over Https)