Skip to content

Is there a way to just renderer the visible clusters and items? #82

Closed
@coyarzun89

Description

@coyarzun89

Hi,
I don't know if it is the default behavior, but both methods, onBeforeClusterItemRendered and onBeforeClusterRendered, are called every time that I zoom out the map, even when there are not clusters or items visible. Is there a way to just renderer the visible clusters and items?
I have a map with 1000 items, and every item has his own image, so I need to render only the visible elements.
Thanks!


From duplicate issue #82, from @kaads123:

Summary:

ClusterManager draws all the markers/clusters, not only visible ones. It should draw only those that are in visibleRegion. This causes a map with 2000 markers skip frames and ANR (even on new devices) when zooming in/out.

Steps to reproduce:

Add 2000 or more markers and try zooming in and zooming out fast. This can be reproduced in the sample app

Expected behavior:

Draw only those markers/clusters which are in visibleRegion.latLngBounds of the GoogleMap

Observed behavior:

Draws every marker added to ClusterManager

Device and Android version:

Moto G3 with Android 6.0.1
Nexus 6P with Android 7.1.2

Screenshots:

screenshot_20170628-182053

Zoomed out from 20f to 1f quickly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions