Open axelerate opened 7 years ago
Hello, looking at the changelog the pane
attribute is a new feature of Leaflet 1.0.
The main problem I see is the lack of a setPane
method in the new API. PruneCluster recycles the markers for performances reasons, so if you plan to have markers on different layers, that will probably not be possible easily.
If you just want to have all markers on the same pane, a quick workaround would be to override BuildLeafletMarker
(and maybe BuildLeafletCluster
) to something like this:
leafletView.BuildLeafletMarker = function(marker, position) {
var m = new L.Marker(position, { pane: "paneId" } );
PruneClusterForLeaflet.prototype.PrepareLeafletMarker.call(this,
m, marker.data, marker.category);
return m;
};
I hope it helps.
Without PruneCluster I would specify my marker creation as follows:
Note I was able to dictate what pane to add the marker to, but I no longer can provide options when initializing a marker (the markers are being automatically dumped into leaflet-marker-parse). Is there a workaround to this?