我一直在试图动态地添加数据点到这里使用addDataPoints()
和addDataPoint()
方法(我仍然不明白你为什么需要两种不同的方法.. )。addDataPoints在这里地图不工作
当我尝试使用他们,我得到这个错误:
Error: this.tb.push is not a function
[email protected]://js.api.here.com/v3/3.0/mapsjs-core.js line 47 > eval:2:734
[email protected]://js.api.here.com/v3/3.0/mapsjs-core.js line 47 > eval:24:52
[email protected]://js.api.here.com/v3/3.0/mapsjs-core.js line 47 > eval:27:209
[email protected]://localhost:3000/scripts/panel/controller.js:208:3
populateCluster()
是谁调用addDataPoints()
函数,定义如下:
clusterProvider = new H.clustering.Provider({});
var poisFormattedAsDataPoint = poiManager.pois[category].map(function(poi){
var tmpPoi = new H.clustering.DataPoint(poi.position[0], poi.position[1], null, poi);
return tmpPoi;
});
clusterProvider.addDataPoints(poisFormattedAsDataPoint);
var clusteringLayer = new H.map.layer.ObjectLayer(clusterProvider);
map.addLayer(clusteringLayer);
如果我添加的DataPoints
在同一阵列提供者定义一切工作正常(我相信证明我使用的数据格式良好),但由于我必须动态添加点,所以这不是一个选项。
有没有人有这两个功能的工作示例?
非常感谢。