-
Notifications
You must be signed in to change notification settings - Fork 26
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
PMTiles format support #21
Conversation
Looks interesting! Thanks for this contribution. |
Following 1e0e89e, overlay is now a map attribue |
Apparently this is not done if the map is not displayed, so I hid the maps by default.
Done. My current hosting for the maps is quite slow (not supporting http/2), but that'll have to do. Ready for review. |
Thanks! This is a great new feature.
|
Correct, when map is "hidden" then the tile provider is not created. |
Yes I am owning the hosting, and plan on maintaining it (which may include moving to a faster provider if I can keep costs in check. in that case I would PR before :))
Good point. I am indeed not using Vector tiles, but is is supported by the lib, through integration with maplibre-gl, done in pmtiles.js addProtocol. A sample is here: <script src="https://unpkg.com/maplibre-gl@1.14.1-rc.2/dist/maplibre-gl.js" crossorigin="anonymous"></script>
<script>
pmtiles.addProtocol(maplibregl)
var map = new maplibregl.Map({ ... }) Integration with leaflet seems available, so we'd need to tie all this together. By the way, what is your stance on when to load such dependencies from the external world eg unpkg vs copying in |
As such, I believe it fits well with WTracks serverless frontend :-)
I may also work on COGeo support in the future, but PMTiles is much lighter.
One issue with this simple integration is that a single HEAD request is made at each page load, because of wtracks.js#L2042 calling into pmtiles.js#L48.
A current limitation is that PMTiles (or WMTS) can't be added as overlays. Do you see an issue with separating
type: "overlay"
into it ownoverlay: true
field in the future?