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

Inspect datasets array instead of using kwargs #39

Merged
merged 2 commits into from
Dec 11, 2021

Conversation

katamartin
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented Dec 10, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/carbonplan/maps/B9NhrVn6EUnDEutx5y5PzG6Kz7cN
✅ Preview: https://maps-git-katamartin-remove-kwargs-dependency-carbonplan.vercel.app

src/utils.js Outdated
.fill()
.map((_, i) => i)
const tileSize = kwargs.pixels_per_tile
const datasets = metadata.metadata['.zattrs'].multiscales[0].datasets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider throwing a helpful error if multiscales doesn't exist

const datasets = metadata.metadata['.zattrs'].multiscales[0].datasets
const levels = datasets.map((dataset) => Number(dataset.path))
const maxZoom = Math.max(...levels)
const tileSize = datasets[0].pixels_per_tile
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also consider an error here if not defined

@katamartin katamartin force-pushed the katamartin/remove-kwargs-dependency branch from 6d50535 to 686012f Compare December 11, 2021 00:53
@katamartin katamartin merged commit a3cab7c into main Dec 11, 2021
@katamartin katamartin deleted the katamartin/remove-kwargs-dependency branch December 11, 2021 00:54
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.

2 participants