Skip to content

fix(google-maps): use noDraw flag in AdvancedMarkerElement clusterer operations#653

Merged
harlan-zw merged 1 commit intomainfrom
fix/marker-clusterer-nodraw
Mar 19, 2026
Merged

fix(google-maps): use noDraw flag in AdvancedMarkerElement clusterer operations#653
harlan-zw merged 1 commit intomainfrom
fix/marker-clusterer-nodraw

Conversation

@harlan-zw
Copy link
Collaborator

🔗 Linked issue

Resolves #652

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

ScriptGoogleMapsAdvancedMarkerElement was calling addMarker/removeMarker on the MarkerClusterer without the noDraw: true flag, causing a full re-clustering cycle on every single marker addition. With ~2k markers this produced ~4k clusteringbegin/clusteringend event emissions and ~10s load times. Now uses noDraw: true + requestRerender() to batch into a single render — matching the existing pattern in ScriptGoogleMapsMarker.

…operations

Without noDraw:true, each addMarker/removeMarker call triggered a full
re-clustering cycle. With ~2k markers this caused ~10s load times and
console warning spam from clusteringbegin/clusteringend events.

Resolves #652
@vercel
Copy link
Contributor

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scripts-playground Ready Ready Preview, Comment Mar 19, 2026 11:06am

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 19, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/scripts@653

commit: 18e603e

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 76243966-515f-4d41-9f72-2cf595daf986

📥 Commits

Reviewing files that changed from the base of the PR and between 65980ce and 18e603e.

📒 Files selected for processing (1)
  • src/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue

📝 Walkthrough

Walkthrough

The change modifies ScriptGoogleMapsAdvancedMarkerElement.vue to improve marker clusterer integration. When an AdvancedMarkerElement is managed by a marker clusterer, marker addition and removal operations now pass an extra boolean argument to the clusterer's addMarker and removeMarker methods. Additionally, markerClustererContext.requestRerender() is explicitly called after both adding and removing markers in the clusterer path to trigger a rerender. The non-clusterer code path remains unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: using the noDraw flag in AdvancedMarkerElement clusterer operations to fix performance issues.
Description check ✅ Passed The PR description includes all required sections: linked issue (#652), type of change (bug fix), and detailed description explaining the problem and solution.
Linked Issues check ✅ Passed The code changes directly address issue #652 by implementing the noDraw flag pattern to batch marker operations and prevent repeated re-clustering cycles that caused ~10s load times and event spam.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the MarkerClusterer performance issue in ScriptGoogleMapsAdvancedMarkerElement; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/marker-clusterer-nodraw
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@harlan-zw harlan-zw merged commit d25917e into main Mar 19, 2026
10 checks passed
@harlan-zw harlan-zw deleted the fix/marker-clusterer-nodraw branch March 19, 2026 11:08
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.

Google Maps MarkerClusterer stuck loading with emitted event warnings

1 participant