问题描述
我正尝试从(https://tcs.ext.here.com/examples/v3.1/fleet_telematics_api )进入我的应用程序,但是身份验证需要app_id和app_code,我只有一个api_key.我希望能够创建truckOverlayProvider来显示和隐藏卡车限制.我需要什么,如何实现呢?该主题是否有逐步的教程?
I'm trying to replicate the examples from the fleet telematics examples at (https://tcs.ext.here.com/examples/v3.1/fleet_telematics_api) into my app, but the authentication need app_id and app_code, I have only an api_key.I want to be able to create the truckOverlayProvider to show and hide the truck restrictions.What do I need and how can I achieve that, is there any tutorial step by step for this subject?
推荐答案
查看您共享的示例的代码,这是他们如何呼吁使用卡车覆盖的方法:
Looking at the code for the example that you shared, here's how they are making the call for truck overlay:
var truckOverlayProvider = new H.map.provider.ImageTileProvider({
label: "Tile Info Overlay",
descr: "",
min: 12,
max: 20,
getURL: function(col, row, level) {
server_rr++;
if (server_rr > 4) server_rr = 1;
return ["https://",
server_rr,
".base.maps.api.here.com/maptile/2.1/truckonlytile/newest/normal.day/",
level,
"/",
col,
"/",
row,
"/256/png8",
"?style=fleet",
"&app_code=",
app_code,
"&app_id=",
app_id
].join("");
}
});
var truckOverlayLayer = new H.map.layer.TileLayer(truckOverlayProvider);
map.addLayer(truckOverlayLayer);
更仔细地看电话:
https://1.base.maps.ls.hereapi.com/maptile/2.1/info?xnlp=CL_JSMv3.1.22.0&apikey=API_KEY&output=json
此处的更多资源获取地图瓷砖卡车信息叠加层上的信息
Here's more resources on getting map tiles truck information overlay
这篇关于HERE-API-如何创建app_id,app_code和api_key的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!