PMTiles
PMTiles copied to clipboard
noWrap option not working on pmTiles
Hi In leaflet it's possible to set a noWrap option to not repeat the tileset when zooming out.
const tiles = L.tileLayer("output_dir/{z}/{x}/{y}.png", {
noWrap: true,
attribution:
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
.addTo(map);
This does not work on pmTiles. Is it not implemented or is it done in some other way?
Are you using it in conjunction with bounds?
pmtiles.leafletRasterLayer(p, {
noWrap: true,
bounds: L.latLngBounds(L.latLng(-85,-180), L.latLng(85, 180)),
...
Without bounds Leaflet will request unwrapped tile coordinates such as z=0 x=1 y=0 which many ZXY endpoints will fail for.
Since PMTiles only supports tile pyramids where Z=0 has 1 tile, etc, we could add our own coordinate wrapping, but for now the behavior remains the same as plain tileLayer.
See answer on https://stackoverflow.com/a/47482145 on how to use noWrap in conjunction with bounds.