foursquare / fsq-studio-sdk-examples

Foursquare Studio is a platform to visualize, unify, enrich, and analyze spatial data on a planetary scale.
https://studio.foursquare.com
MIT License
18 stars 12 forks source link

Prevent map move on "keydown" #74

Open svetoslavmishev opened 6 months ago

svetoslavmishev commented 6 months ago

Unable to prevent map move, when press keyboard arrow keys.

  1. Click on the map
  2. Press keyboard arrow keys (left, right, up or down)

How can I prevent this map movement, but keep dragpan behavior?

abstractalgo commented 6 months ago

Under the hood, there's a deck.gl instance that appends <div> with id="default-deckgl-overlay-wrapper" that has keyup and keydown handlers that actually handle navigation via arrow keys, and removing those event listeners achieves what you're looking for. However, that is wrapped in a Shadow DOM component that doesn't let you interact with its content directly. We could try exposing toggles for this so that you could configure the behavior more granularly.