Skip to content

[Bug] Map drag state should be preserved if changed after terra-draw instantiation #687

@jiacona

Description

@jiacona

Describe the bug

Changes in #504 mean that the state of dragPan and dragRotate at adapter instantiation time is respected when terra-draw manages map draggability. However, if you change map draggability outside of terra-draw after the adapter is instantiated, it does not respect that updated value.

Terra Draw npm version

Using terra-draw 1.16.1 and terra-draw-maplibre-gl-adapter 1.1.1

To Reproduce

We let users change between an "edit" and "navigate" mode by controlling the state of dragPan and dragRotate on the map. We start in "navigate" mode, so at terra-draw instantiation time the map is draggable. If you change to edit mode (the map is made non-draggable), then perform any drag interaction (regardless of if it is on a terra-draw object or not), terra-draw will revert the map to being draggable.

Expected behavior

Whenever terra-draw modifies the draggability of the map during it's interactions, it should revert the map to whatever state it was in before the interaction started, not the state of the map when terra-draw was initialised.

Desktop (please complete the following information):

  • OS: macOS 15.6.1
  • Browser: Chrome
  • Version 140.0.7339.185

Additional context

We are maintaining our own fork and I have implemented a fix for this issue here. I don't know if it is the best approach, but if you have any guidance I would be happy to put together a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    MapLibreGLRelated to the MapLibreGL JS AdapterbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions