Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Added a getCanvas helper function on deck #7919

Merged
merged 5 commits into from
Sep 23, 2023
Merged

Conversation

akre54
Copy link
Collaborator

@akre54 akre54 commented May 26, 2023

For #7918

Background

Change typescript annotation to make the Deck instance canvas readonly instead of protected. Right now there isn't a way to access the canvas instance as seems to be suggested, as Typescript forbids it. It's possible to cast the deck instance as any before getting the canvas prop but this way provides a formalized accessor.

Change List

  • Added a getCanvas helper function on deck

Change typescript annotation to make the Deck instance canvas readonly instead of protected. Right now there isn't a way to access the canvas instance [as seems to be suggested](visgl#4436 (comment)), as Typescript forbids it. It's possible to cast the deck instance as `any` before getting the canvas prop but this way provides a formalized accessor.
modules/core/src/lib/deck.ts Outdated Show resolved Hide resolved
@coveralls
Copy link

Coverage Status

coverage: 89.828% (-0.003%) from 89.831% when pulling 6248957 on akre54:patch-2 into 98c1677 on visgl:master.

@chrisgervang chrisgervang changed the title Make canvas readonly instead of protected Added a getCanvas helper function on deck Jul 22, 2023
@Pessimistress
Copy link
Collaborator

Add the new method to the documentation page?

@paulleonartcalvo
Copy link

Would love to see this merged! :)

@chrisgervang chrisgervang merged commit a3e09a6 into visgl:master Sep 23, 2023
2 checks passed
@akre54 akre54 deleted the patch-2 branch September 30, 2023 15:21
Pessimistress added a commit that referenced this pull request Oct 4, 2023
Right now there isn't a way to access the canvas instance [as seems to be suggested](#4436 (comment)), as Typescript forbids it.

* add a getCanvas helper

* documentation and MapboxOverlay.getCanvas

---------

Co-authored-by: Chris Gervang <chrisgervang@users.noreply.github.com>
Co-authored-by: Xiaoji Chen <Pessimistress@users.noreply.github.com>
felixpalmer pushed a commit that referenced this pull request Oct 11, 2023
Right now there isn't a way to access the canvas instance [as seems to be suggested](#4436 (comment)), as Typescript forbids it.

* add a getCanvas helper

* documentation and MapboxOverlay.getCanvas

---------

Co-authored-by: Chris Gervang <chrisgervang@users.noreply.github.com>
Co-authored-by: Xiaoji Chen <Pessimistress@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants