vue2-leaflet-markercluster icon indicating copy to clipboard operation
vue2-leaflet-markercluster copied to clipboard

ClassName className undefined for some child in iconCreateFunction

Open NicolasGuruphat opened this issue 2 years ago • 0 comments

Hi, I have some issue with the iconCreateFunction option Here is a part of my tempate :

 <v-marker-cluster :options="{ iconCreateFunction: iconCreateClsPrg}">
          <l-marker ....> 
                <l-icon :class-name="programme.display ? 'custom-marker notDisplay' : 'custom-marker display"">

And here is a part of the iconCreateClsPrg method :

iconCreateClsPrg (marker_cluster) {
	    const childs = marker_cluster.getAllChildMarkers();
	     childs.forEach(child => {
			const cssCluster = child.options.icon.options.className;
			if (cssCluster && cssCluster.includes(this.css_marker_selected_simple)) {
				nbSelected++;
			}
              }
             ...
}

My problem is that sometimes my cssCluster const is undefined for no reason. It's not a regular behavior and it happens only at some zoom levels (which are not always the same)

NicolasGuruphat avatar Feb 17 '23 13:02 NicolasGuruphat