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

Minimal pmtiles http support #370

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

acalcutt
Copy link

@acalcutt acalcutt commented Jan 2, 2025

This adds minimal pmtiles support to the web plugin as requested in #212 . It is a lite version of the changes I made in https://github.com/acalcutt/maplibre-contour-pmtiles/ without the local pmtiles support.

-Changes-
Adds support for pmtiles:// urls, so these are valid urls now

https://url/of/dem/source/{z}/{x}/{y}.png
pmtiles://https://url/of/dem/source.pmtiles

In #359 support was added to add a GetTile function, but this function only was passing url, which made it hard to use for things that needed the zxy values, since you had to split them out of the url. I have modified this a bit some it now passes

(
    z: number,
    x: number,
    y: number,
    demUrlPattern: string,
    abortController: AbortController,
    pmtiles?: PMTiles | null,
  )

Tests have keen updated to use the new "cacheKey" value instead of url. The GetTile mock function also had to be changed since different values are now passed.

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.

1 participant