这里Maps Javascript API [英] HERE Maps Javascript API
本文介绍了这里Maps Javascript API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
刚开始使用示例javascript即可简单地显示基于纬度和经度坐标的地图.我在第一行就收到了javascript ReferenceError!
Just getting started using the sample javascript to simply display a map based on latitude and longitude coordinates. I get a javascript ReferenceError on the very first line!
代码段:
<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>
var platform = new H.service.Platform({
'app_id': 'xxxxxxxxxxxxxxxxxxxx',
'app_code': 'zzzzzzzzzzzzzzzzzzzzzzz'
});
// Obtain the default map types from the platform object
var maptypes = platform.createDefaultLayers();
// Instantiate (and display) a map object:
var map = new H.Map(document.getElementById('bodydiv'), maptypes.normal.map, {
zoom: 10, center: { lng: <%=longitude%>, lat: <%=latitude%>}
});
浏览器控制台中的实际错误: ReferenceError:未定义H-发生在var platform = ...
Actual error in browser console: ReferenceError: H is not defined - happens on var platform=...
有什么想法吗?
推荐答案
尝试包括示例中提到的所有JS文件以及CSS文件 https://developer.here.com/api-explorer
Try including all the JS files mentioned in the example and also the css file https://developer.here.com/api-explorer
这篇关于这里Maps Javascript API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文