Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can't properly interact with overlay via dragbox #307

Closed
Athdemond opened this issue Mar 6, 2024 · 1 comment
Closed

Can't properly interact with overlay via dragbox #307

Athdemond opened this issue Mar 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Athdemond
Copy link
Contributor

Describe the bug
When dragbox is used to select features on the map, the overlay does not work correctly (buttons in the overlay do not trigger actions). After disabling dragbox everything works ok.
The main problem with the buttons not responding to clicks is that the map intercepts the left click action for drawing square.

To Reproduce
Steps to reproduce the behavior:

  1. Have any overlay with buttons within
  2. Set dragbox mode for map
onMounted(() => {
  const dragBox = new DragBox({
    condition: () => dragboxEnabled.value,
  });

  dragBox.on('boxend', (event) => {
    overlay.value = {
      coordinates: event.coordinate,
      show: true,
    };
  });

  map.value.map.addInteraction(dragBox);
});
  1. Draw square on map for overlay appears
  2. Try to click on button inside overlay

Expected behavior
Button fires its action

Environment:

  • Node: 20.11.1
  • Browser Opera
  • Vite: 5.1.4
@Athdemond Athdemond added the bug Something isn't working label Mar 6, 2024
@Athdemond
Copy link
Contributor Author

On map builded with native openlayers it works without this problem

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant