Skip to content

Conversation

@suzit-10
Copy link
Contributor

@suzit-10 suzit-10 commented Oct 7, 2025

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Related Issue

Describe this PR

This PR refactors the base map switching mechanism.
Previously, the implementation relied on map.setStyle(style)to switch base layers. This caused the map to fully reinitialize each time the base layer was changed, resulting in loss of drawn or uploaded features (e.g., AOIs).

The new approach loads both base raster layers during map initialization and toggles their visibility dynamically using setLayoutProperty(). This makes base layer switching a fully independent operation, enabling seamless transitions between base maps without resetting the map state and ensuring that all other layers, sources, and user interactions remain unaffected.

Checklist before requesting a review

…revents reloading the entire style and re-adding overalays
…` event which allows to load all base layers and toggle switch using its visibility property

It helps to avoid the re-adding map style entirely so it prevents all custom layers, sources, controls, and event bindings lost
@suzit-10 suzit-10 force-pushed the fix/7030-changing-basemap-kills-project-boundary branch from f97b8a0 to 13ded51 Compare October 29, 2025 04:11
suzit-10 added a commit to naxa-developers/tasking-manager that referenced this pull request Nov 3, 2025
add base layers before draw
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 3, 2025

@ramyaragupathy ramyaragupathy merged commit 4edbf08 into develop Nov 4, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants