Comments (18)
Is this the same issue as with the maxzoom
parameter being ignored for GL JS maps when using a serverless setup? Currently Maplibre keeps requesting tiles from the pmtiles source beyond the maxzoom set in the style when using a serverless source.
from pmtiles.
For GL JS styles it would appear that the maxzoom
needs to be set to 12 for a serverless setup, not 14 as in the example styles available from the pmtiles download. However there are tiles beyond 12 which I can tell from comparing a serverless map to the theme examples.
- Are the tiles served from the theme example page tiled to a higher zoom than 14, or are these the same tiles output from the downloads site?
- If they are the same...any ideas as to why in GL nothing appears after zoom level 13?
from pmtiles.
@reyemtm did you download from https://protomaps.com/downloads/large_map ? if so it's possible your PMTiles archive only goes down to 12, because the total # of tiles in a single export is limited to 10,000. a Smaller area might get you down to 14.
from pmtiles.
from pmtiles.
Confirmed downloading a smaller area fixed the issue.
from pmtiles.
Oh! I see, so tiles beyond z14 are not supported in single-file? See: https://tulsa-crash-map.netlify.app/#13/36.15138/-95.98636 vs https://tulsa-crash-map.netlify.app/#14/36.15138/-95.98636.
Any ideas on workarounds? I suppose a second layer with regular XYZ would do the trick...
Separately, how do zooms beyond 14 work on this map? Or am I missing something?
Note: I'm using the python bin for this. Also, it's possible I'm doing something wrong during the mbtiles step.
from pmtiles.
What source did you get the first one from? It looks like it only contains tiles down to z13, which might have been introduced as a limitation if you downloaded a "large map" (confusing right now, I know)
The client uses overzooming, so when you go beyond 14 in MapLibre, your data source is still the z14 tile, although your zoom-dependent styling can show different features at 15, 16, 17 etc.
Currently the implementations only support one leaf level, so up to z14. In practice, most vector tile applications get enough resolution with z14, but it's worth supporting z15 for the cases that do really need it as well as raster tiles.
from pmtiles.
Thank you for the reply! I've been obsessed with this awesome work for the past few days.
What source did you get the first one from? It looks like it only contains tiles down to z13, which might have been introduced as a limitation if you downloaded a "large map" (confusing right now, I know)
Ah, I see, okay. So, the basemap is a small area map extract. I see what you mean by the maxzoom in the source data.
However, I'm interested in why my red point data (which is generated from pmtiles-convert
command), doesn't appear beyond zoom 13:
Apologies if I'm missing something entirely.
from pmtiles.
Further thinking: I believe maplibre-gl is not over-zooming past the specified maxzoom of this particular set of pmtiles for some reason.
I can confirm this when I view the mbtiles version of the dataset in mapbox-gl, where it does the overzooming beyond the maxzoom.
So it might be:
- maplibre-gl is not overzooming using the ProtocolCache from the pmtiles JavaScript library
- something is wrong with the way I've generated these particular pmtiles
- some combination of both
I'm not sure why it would be explanation 1) because maplibre-gl overzooms beyond the maxzoom with the basemap pmtiles just fine.
I'm going to try a few different things but any observations would help! Thank you! :)
(I realize this discovery moves it outside the intention of this particular issue).
from pmtiles.
OKAY I figured it out. It's because I needed to explicitly specify the maxzoom in my source configuration. I'm sure that's documented somewhere. Sorry, I really went down a rabbit hole there. I'm not sure how mbview works but I wonder if it infers the maxzoom from the metadata? Anyway, thanks for letting me bounce ideas here.
from pmtiles.
@allthesignals yeah, that makes sense. Ideally, the PMTiles maplibre adapter should read the metadata from the archive and then populate maxzoom
correctly, but with the way addProtocol
works right now I don't think that is straightforward to do.
from pmtiles.
Opened #48
from pmtiles.
PMTiles are so cool! Thanks @bdon for all the work you put into this :)
I run into a similar issue with the map disappearing when going to zoom level 13 and more. I generated the tiles with planetiler in https://github.com/wipfli/swiss-map which creates a 239 MB mbtiles and a 329 MB pmtiles file. My workaround there was to limit to zoom 12 in the tiles:
"sources": {
"swissmap": {
"type": "vector",
"tiles": ["pmtiles://output.pmtiles/{z}/{x}/{y}"],
"maxzoom": 12
}
},
But then details will be missing from levels 13, 14.
from pmtiles.
Yeah, unfortunately there is no way through maplibre addProtocol
to auto-detect the max zoom of the archive, you'll need to specify it in the style. However, it definitely should be the case that all the tiles in the source mbtiles end up in the pmtiles result, can you tell me what pmtiles-convert version you are using?
from pmtiles.
I used the command pmtiles-convert data/output.mbtiles output.pmtiles
, here is the version:
➜ swiss-map git:(main) ✗ pip3 show pmtiles
Name: pmtiles
Version: 1.1.0
Summary: Library and utilities to write and read PMTiles files - cloud-optimized archives of map tiles.
Home-page: https://github.com/protomaps/pmtiles
Author: Brandon Liu
Author-email: [email protected]
License: BSD-3-Clause
Location: /home/wipfli/.local/lib/python3.8/site-packages
Requires:
Required-by:
You can download the mbtiles and pmtiles file here:
- https://github.com/wipfli/swiss-map/releases/download/v1.0.0/output.mbtiles
- https://github.com/wipfli/swiss-map/releases/download/v1.0.0/output.pmtiles
from pmtiles.
I installed v1.3.0 and the issue with the missing tiles is gone. Sorry for not checking earlier @bdon...
from pmtiles.
@wipfli ok, thanks for letting me know! btw, for the v3 mbtiles conversion tool I'm considering releasing that as a standalone binary (go version) instead of getting pmtiles-convert
through python, is that better/worse for you in any way?
from pmtiles.
Also long as it is easy to get and run on ubuntu, I think a standalone binary is fine too...
from pmtiles.
Related Issues (20)
- How to use PMTiles with Mapbox HOT 4
- Verify pmtiles crash HOT 4
- Serving to tiles changes the shape of the file HOT 6
- OpenLayers PMTilesVectorSource fires tileloadstart event twice per tile HOT 1
- TypeScript fails to run? "./v2" HOT 3
- Crash while using MapLibre and hosted protomaps version HOT 2
- Failed to fetch error on occasion HOT 2
- pmtiles.js: RangeError: Offset is outside the bounds of the DataView HOT 3
- Possible reference implementation of hilbert tile ID primitives HOT 6
- lambda function not working? HOT 4
- Saving/Caching for offline use? HOT 6
- cannot set fetch options with maplibre protocol HOT 3
- Handling corrupt metadata HOT 2
- Cannot render with magic number error HOT 5
- "pmtiles merge" CLI command? HOT 13
- Allow Customization of OpenLayers Format Parameters HOT 1
- If-Range header causes error HOT 7
- PMTiles JS not working with latest Maplibre GL JS 4.x HOT 4
- Dynamically set overview zoom levels
- Etag being spoofed by ClearURLs extension causes hard to understand errors HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pmtiles.