Skip to content

Conversation

@andreia-ferreira
Copy link
Collaborator

Fixes #3387

There was an issue when zooming in on map clusters, where the individual items wouldn't render. This happened when the clusters themselves didn't change, but the zoom crossed the threshold where individual items should be displayed.

In order to fix that, a new override was added shouldRender which forces the rerender in this particular case, when the clusters don't change but the rendering type did.

Before fix

Screen_recording_20260107_175849.webm

With fix

Screen_recording_20260107_175947.webm

@shobhitagarwal1612 PTAL?

@auto-assign auto-assign bot requested a review from gino-m January 7, 2026 17:10
@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.01%. Comparing base (1a71657) to head (7afa455).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3430      +/-   ##
============================================
+ Coverage     69.91%   70.01%   +0.09%     
- Complexity     1599     1608       +9     
============================================
  Files           320      320              
  Lines          8590     8600      +10     
  Branches        945      945              
============================================
+ Hits           6006     6021      +15     
+ Misses         2010     2005       -5     
  Partials        574      574              
Files with missing lines Coverage Δ
...roid/ui/map/gms/features/FeatureClusterRenderer.kt 48.38% <100.00%> (+48.38%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

super.shouldRender(oldClusters, newClusters)
}

private fun hasRenderingModeChanged(): Boolean = isClusterMode(oldZoom) != isClusterMode(zoom)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update the value of oldZoom in this method after it has returned true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that value is updated by setZoom, which is called by each onCameraIdle. Then rendering related methods, such as this one, only consume that state to decide whether a re-render is needed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just wondering if there's a way to optimize things by re-rendering the clusters even if the zoom hasn't changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Data collection] Some Predefined sample sites don't render

2 participants