Shopify Free Trial Apply
Shopify 60天试用
Shopify 14天试用

百度地图API支持HTTPS

Mixed Content: The page at ‘https://www.c*******8.com/public/admin/index/index.html 
’ was loaded over HTTPS, but requested an insecure script ‘http://api.map.baidu.com/api?v=1.4 
‘. This request has been blocked; the content must be served over HTTPS. 
VM255 addshopview.html:381 Uncaught ReferenceError: BMap is not defined. 
搜索一下接口文档才知道——,JavaScript API首家支持Https,已全面开放,无需申请Https服务可直接使用。 
如您需要更高配额,请您认证企业信息,成为企业认证用户后,获得更高的服务配额。 
注意:仅JavaScript API V2.0 版本支持https,其他JavaScript API版本均不支持。使用https服务,请先检查您的版本。文档链接百度地图api 
配置 
1. 如果使用JavaScript API ,需要加一个特殊字段 (s=1): 
https://api.map.baidu.com/api?v=2.0&ak=你的密钥&s=1; 
2. 对于Web API 无需加特殊字段,直接使用 HTTPS协议访问即可,如Geocoding: 
https://api.map.baidu.com/geocoder/v2/?ak=你的秘钥&callback=renderReverse&location=39.983424,116.322987&output=xml&pois=1 
1
2018-10-17

1 个评论

感谢分享。

要回复文章请先登录注册