The class MarkerClusterLayer has a method _buildMobileTransformStack which calls the following:
_clusterManager.recursivelyFromTopClusterLevel(
_currentZoom, widget.options.disableClusteringAtZoom, recursionBounds,
(MarkerOrClusterNode layer) {
// This is the performance critical hot path recursed on every map event!
// Cull markers/clusters that are not on screen.
if (!widget.mapCamera.pixelBounds.overlaps(
layer.pixelBounds(widget.mapCamera),
)) {
return;
}
if (layer is MarkerNode) {
_addMarkerLayer(layer, layers);
} else if (layer is MarkerClusterNode) {
_addMarkerClusterLayer(layer, layers, spiderfyLayers);
} else {
throw 'Unexpected layer type: ${layer.runtimeType}';
}
});
From my understanding, the call to layer.pixelBounds(widget.mapCamera) has no side effects and returns a Rect which is never used.
Therefor, this method call should be removable.
The class
MarkerClusterLayerhas a method_buildMobileTransformStackwhich calls the following:From my understanding, the call to
layer.pixelBounds(widget.mapCamera)has no side effects and returns aRectwhich is never used.Therefor, this method call should be removable.