Search code examples
deck.gl

deck.gl - is it possible to increase the on click radius?


I want to add actions for when the user clicks on an object from a Paths layers. I notice that I really need to click in the middle of each path for this to happen. Is it somehow possible to increase that radius so when the user clicks even just a bit near that object the on-click action would trigger? Couldn't find such property for any layer.


Solution

  • I think you are looking for pickingRadius, check this out.

    You should be able to apply that on Deck instance.

    With React:

    <DeckGL
      ...otherProps
      pickingRadius={10}
    >
    

    With vanilla JS:

    const deckgl = new Deck({
      ...otherProps,
      pickingRadius: 10
    });