Markers Are Missing Suddenly While Rendering On Here Maps 2.5.3
I have developed an application where it displays collection of markeres on the navteq map.when i was working with navteq maps 2.2.3 everything was working fine, but as Navteq maps
Solution 1:
I use the Display Ready Event, before starting the Clustering:
map.addListener("displayready", function()
{
mapContainer.style.display = 'block';
// load the photos as cluster data
url = "http://developer.here.com/apiexplorer/examples/res/clustering/photos.js";
script = document.createElement("script");
script.src = url;
document.body.appendChild(script);
});
onDataReceive = function(data)
{
displayAllPoints(data);
}
functiondisplayAllPoints(arrLightPointCoordinates)
{ {
varMyTheme1 = function (){};
MyTheme1.prototype.getNoisePresentation = function (dataPoint) {
var markerLightPoint = new nokia.maps.map.Marker(dataPoint, {
icon: new nokia.maps.gfx.BitmapImage("/res/marker_red.png"),
anchor: {
x: 12,
y: 12
}
});
return markerLightPoint;
};
MyTheme1.prototype.getClusterPresentation = function (data) {
var markerLightPoint = new nokia.maps.map.StandardMarker(data.getBounds().getCenter(), {
icon: new nokia.maps.gfx.BitmapImage("/res/marker_green.png", null, 66, 65),
text: data.getSize(),
zIndex: 2,
anchor: {
x: 12,
y: 12
}
});
return markerLightPoint;
};
/*
var indexes = new nokia.maps.clustering.Index();
var lightpointsDataSet1 = new Array();
for (var i = 0; i < totalLightPoints; i++) {
lightpointsDataSet1[i] = { latitude: arrLightPointCoordinats[i][0],
longitude: arrLightPointCoordinats[i][1], title: 'LightPoint ' + (i + 1) };
indexes.add([arrLightPointCoordinats[i][0], arrLightPointCoordinats[i][1]]);
}
*/varClusterProvider = nokia.maps.clustering.ClusterProvider,
theme = newMyTheme1(),
clusterProvider = newClusterProvider(map, {
eps: 0.00000000001,
minPts: 1000000,
strategy: nokia.maps.clustering.ClusterProvider.STRATEGY_DENSITY_BASED,
// index: indexes,theme: theme,
dataPoints: []
});
clusterProvider.addAll(arrLightPointCoordinates);
clusterProvider.cluster();
map.update(-1, 0);
//set zoom level here// setCenterAndZoom(13, arrSegmentControllerIds[0]);
}
Hope that helps. Also you can check out the newest version 2.5.4.
Best,
Dom
Post a Comment for "Markers Are Missing Suddenly While Rendering On Here Maps 2.5.3"