如何通过 HTTPS 调用 HERE map ?
我在我的服务器上使用 HTTPS,所以当我调用它时:
<script src="http://js.api.here.com/v3/3.0/mapsjs-core.js" type="text/javascript" charset="utf-8"></script>
<script src="http://js.api.here.com/v3/3.0/mapsjs-service.js" type="text/javascript" charset="utf-8"></script>
由于“混合内容”,浏览器阻止了请求,因此没有显示 map ...
我试图在脚本源上将“http”更改为“https”,但我遇到了同样的问题,因为两个 javascript 的代码中都有“http”调用。
顺便说一句,后端是用 Grails 编写的, channel 是使用 Spring Security Core 插件保护的。
最佳答案
您需要从 https 加载 API,另外您需要设置:
// Create a platform object to communicate with the HERE REST APIs
var platform = new H.service.Platform({
useCIT: true,
app_id: app_id,
app_code: app_code,
useHTTPS: true
});
技巧是 useHTTPS: true,如文档中所述:HERE Developers Guide
关于javascript - 如何使用 HTTPS 调用 HERE Maps API v3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27556648/