Open TZAdvantage opened 5 years ago
hi, here is how i do it :
$.each( data, function( key, val ) {
var marker = new PruneCluster.Marker(
val.latLng[0],val.latLng[1] ,
{
id: key,
cat: 'site',
name : val.name
}
);
sitesCluster.RegisterMarker(marker);
});
map.addLayer(sitesCluster);
according to https://github.com/SINTEF-9012/PruneCluster#add-custom-data-to-marker-object hope it helps
hmm, by "marker" do you mean the JS marker object (my first thought) or the icon on the map ?? if it is the second choice then my previous answer is not relevant...
You can try this approach too..
const marker = new PruneCluster.Marker(lat, lng, { popup: somePopup, icon: someIcon }); marker.data.id = key;
I tried to find how to do it but could not find a solution.
I got my particular use working by adding an id property in the icon options.
and adding this to the code in ProcessView:
Am i overlooking something?