Deck.gl: Cursor doesn't change when using MapboxLayers

Created on 5 Sep 2019  路  3Comments  路  Source: visgl/deck.gl

Description

When using MapboxLayers, the cursor stays "grab" and doesn't change to "grabbing" on drag. The cursor style cannot be explicitly modified by map.getCanvas().style.cursor = /* style */, either.

Repro Steps

See https://deck.gl/showcases/gallery/mapbox-layer.

Environment (please complete the following information):

  • Framework Version: deck.gl 7.2.3
  • Browser Version: Chrome 76.0.3809.132, FireFox 69.0, Safari 12.1.2
  • OS: Mac OS X 10.14.6
bug

Most helpful comment

My workaround is to set my own getCursor function after adding a MapboxLayer to the map instance so that is doesn't modify the existing style.

map.__deck.props.getCursor = () => map.getCanvas().style.cursor;

All 3 comments

My workaround is to set my own getCursor function after adding a MapboxLayer to the map instance so that is doesn't modify the existing style.

map.__deck.props.getCursor = () => map.getCanvas().style.cursor;

You can try Use a Layer from an Existing Deck's Layer Stack which will allow you to set Deck props.

Or you can do:

<DeckGL getCursor={() => 'inherit'} />

This will inherit the same cursor as Mapbox.

Was this page helpful?
0 / 5 - 0 ratings