deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

Avoid picking in overlays before deck is initialized

Open JannikGM opened this issue 1 year ago • 1 comments

Background

I've originally reported a bug on Slack: https://deckgl.slack.com/archives/C34AC5MSQ/p1676629109034669 The picking functions were used by the mapbox event handlers before deck was fully initialized (which will be fixed by #7723).

Also, while looking into it, I noticed that the explicit picking support provided by the overlays also isn't guarded against incorrect use before deck is initialized. Because the user of the overlay doesn't have direct deck access either, I proposed to forward isInitialized.

I've also added an assert in case this._deck doesn't exist yet to the picking functions and made comments more consistent.

Change List

  • Add isInitialized to Mapbox- and GoogleMapsOverlay
  • Add types to GoogleMapsOverlay picker
  • Consistent picker comments in Mapbox- and GoogleMapsOverlay

None of this was tested I'm not sure how to run automated tests for the deck.gl codebase. yarn bootstrap fails with gyp not able to find python (which should be python3 on this macOS machine). yarn test failed during linter step in untouched code. All my deck.gl projects use another private library which has hardcoded dependency on a specific deck.gl version, so manual testing would be cumbersome.

JannikGM avatar Feb 20 '23 15:02 JannikGM