You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, having a problem with how custom cluster icons are showing.
For the most part it works perfectly as expected except that when stopping displaying a cluster group that has no pins/data, the last cluster group added takes on the icon properties of the one removed. The files are removed by altering the fileList variable.
A very condensed code snippet bellow:
<template>
<l-map ...>
<div v-for="(fileNumber, index) in fileList"
<Vue2LeafletMarkerCluster :options="options(fileNumber)">
<l-marker ...>
</l-marker>
</Vue2LeafletMarkerCluster>
</div>
</l-map>
</template>
<script>
options(index) {
console.log(index);
return {
iconCreateFunction: function(cluster) {
var childCount = cluster.getChildCount();
var c= " marker-cluster-";
if (childCount < 10) {
c += "small";
} else if (childCount < 100) {
c += "medium";
} else {
c += "large";
}
console.log(index);
return new L.DivIcon({
html: `<div><span>${childCount}</span></div>`,
className: `marker-cluster ${c} marker-cluster-index-${index}`,
iconSize: new L.Point(40, 40)
});
}
};
},
</script>
The first console log always outputs the correct value however, when the bug occurs, the second outputs the value of the empty file.
Steps to recreate:
have one file with geodata in and one without
load the file without the data
load the file with data
unload the file without data
OBSERVE cluster has the icon properties of the unloaded data (class of the remaining data has been overwritten with that of the empty data file)
The text was updated successfully, but these errors were encountered:
Chris-McQuiggan
changed the title
dynamic cluster icons with v-for
Dynamic cluster icons with v-for
Jan 31, 2020
Hi, having a problem with how custom cluster icons are showing.
For the most part it works perfectly as expected except that when stopping displaying a cluster group that has no pins/data, the last cluster group added takes on the icon properties of the one removed. The files are removed by altering the fileList variable.
A very condensed code snippet bellow:
The first console log always outputs the correct value however, when the bug occurs, the second outputs the value of the empty file.
Steps to recreate:
The text was updated successfully, but these errors were encountered: