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

maxZoom?: number instead of maxZoom?: number | null #109

Open
Volper212 opened this issue Aug 23, 2024 · 2 comments
Open

maxZoom?: number instead of maxZoom?: number | null #109

Volper212 opened this issue Aug 23, 2024 · 2 comments

Comments

@Volper212
Copy link

Volper212 commented Aug 23, 2024

In the docs it says that maxZoom can be null for infinite scaling. However, the type of maxZoom when one hovers over it is number | undefined, not number | null | undefined.

(property) maxZoom?: number | undefined
@Volper212 Volper212 changed the title maxZoom - number | undefined instead of number | null | undefined maxZoom?: number instead of maxZoom?: number | null Aug 23, 2024
@elliottkember
Copy link
Collaborator

I think the docs just need updating, then. Sounds as though it used to take null but no longer requires the prop. Would you mind making a PR for this change?

@Volper212
Copy link
Author

Volper212 commented Aug 29, 2024

null actually works as the docs say (it just does not pass the type check with TypeScript's strict mode):

if (maxZoom !== null && newZoomLevel > maxZoom) {

So not the docs but the types need to be updated. Alternatively, one could get rid the option of passing null altogether and just use maxZoom={Infinity} for infinite zoom. There are two options then.

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

No branches or pull requests

2 participants