Skip to content

fix: re-apply Overture layers after basemap style change#4

Merged
giswqs merged 1 commit into
mainfrom
fix/reapply-overture-layers-on-basemap-change
Jun 7, 2026
Merged

fix: re-apply Overture layers after basemap style change#4
giswqs merged 1 commit into
mainfrom
fix/reapply-overture-layers-on-basemap-change

Conversation

@giswqs

@giswqs giswqs commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Re-add Overture sources and layers on the map's style.load event so visible themes survive a basemap change (map.setStyle() drops all non-base layers).
  • Detach the new style.load handler in the control's teardown and bump the package/plugin version to 0.2.0.

Test plan

  • npm run test (57 tests pass)
  • Manually switch basemaps with Overture themes enabled and confirm the themes remain visible

Summary by CodeRabbit

  • Chores

    • Version bumped to 0.2.0
  • Bug Fixes

    • Fixed an issue where selected map layers would disappear when changing the map basemap or style

Switching basemaps calls map.setStyle(), which wipes every non-base
source and layer, so the visible Overture themes silently disappeared.
Re-add them on the style.load event and bump the version to 0.2.0.
@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bdd8c000-fb3b-4c4d-9eba-74365d220d47

📥 Commits

Reviewing files that changed from the base of the PR and between 392266a and e01883f.

📒 Files selected for processing (4)
  • geolibre-plugin/plugin.json
  • package.json
  • src/geolibre.ts
  • src/lib/core/OvertureMapsControl.ts

📝 Walkthrough

Walkthrough

Version bumped to 0.2.0 across plugin manifest, package manifest, and exported metadata. OvertureMapsControl now persists visible Overture layers after MapLibre basemap style changes by registering and managing a style.load listener during the control lifecycle.

Changes

Version Release and Style Persistence

Layer / File(s) Summary
Version bump to 0.2.0
geolibre-plugin/plugin.json, package.json, src/geolibre.ts
Plugin and package version updated from 0.1.0 to 0.2.0 in plugin manifest, package manifest, and exported plugin metadata.
Style persistence on basemap changes
src/lib/core/OvertureMapsControl.ts
OvertureMapsControl stores and registers a style.load listener during onAdd to re-apply the currently selected Overture layers after MapLibre basemap/style changes, and unregisters the listener during onRemove.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A version bump, a layer saved,
When maps are shuffled, styles are waved—
The Overture sources now persist,
No themes lost within the mist.
🐰 hops with glee

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 're-apply Overture layers after basemap style change' directly and accurately describes the main functional change in the PR—fixing the OvertureMapsControl to restore layers when the map's style is changed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/reapply-overture-layers-on-basemap-change

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

@giswqs giswqs merged commit 6967bb2 into main Jun 7, 2026
1 of 2 checks passed
@giswqs giswqs deleted the fix/reapply-overture-layers-on-basemap-change branch June 7, 2026 23:57
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.

1 participant