Skip to content

Unused function #244

@YukiAttano

Description

@YukiAttano

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions