Leaflet tries to get negative value images or images that don't exist
See original GitHub issueHere is my Leaflet config:
function init() {
var mapMinZoom = 2;
var mapMaxZoom = 5;
var map = L.map('map', {
maxZoom: mapMaxZoom,
minZoom: mapMinZoom,
crs: L.CRS.Simple
}).setView([0, 0], mapMaxZoom);
var mapBounds = new L.LatLngBounds(
map.unproject([0, 4352], mapMaxZoom),
map.unproject([2048, 0], mapMaxZoom));
map.fitBounds(mapBounds);
L.tileLayer('/assets/themes/sec/img/tiles/{z}/{x}/{y}.png', {
minZoom: mapMinZoom,
maxZoom: mapMaxZoom,
bounds: mapBounds,
noWrap: true,
continuousWorld: true
}).addTo(map);
var store_marker = L.marker([0, 0]).addTo(map);
}
Everything works, but I get a lot of “resource not found” in my console whenever I zoom or pan:
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (0.png, line 0)
http://localhost:3000/assets/themes/sec/img/tiles/2/-1/0.png
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (0.png, line 0)
http://localhost:3000/assets/themes/sec/img/tiles/2/1/0.png
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (1.png, line 0)
http://localhost:3000/assets/themes/sec/img/tiles/2/-1/1.png
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (1.png, line 0)
http://localhost:3000/assets/themes/sec/img/tiles/2/1/1.png
I have no negative numbered tiles. The files referenced here don’t exist. Yet everything looks fine on the map. I used MapTiler to build the map. Anything I can do to fix this?
Issue Analytics
- State:
- Created 9 years ago
- Comments:22 (10 by maintainers)
Top Results From Across the Web
Prevent Leaflet from requesting non-existing custom tiles
It works fine. But for every zoomlevel change leaflet makes a number of(around 20 -30) requests to non existing tiles resulting in "NetworkError ......
Read more >Is Leaflet a good tool for non-map images? - Stack Overflow
Note that I tried the solution described above, and got all sorts of crazy tiling issues (not merely swapped tiles, but requests for...
Read more >Documentation - a JavaScript library for interactive maps
Runs the given function fn when the map gets initialized with a view (center and zoom) and at least one layer, or immediately...
Read more >Information Leaflet on the Care, Handling, and Storage of ...
Cataloging and access tools can support preservation by minimizing the need for researchers to handle original photographs or one-of-a-kind images, including ...
Read more >50 powerful examples of visual propaganda and the ... - Canva
Try the Blue Photo Hiring Poster template. ... This message implies that if you don't support the war financially, harm could come to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@josephrocca If you specify the
noWrapoption, and not theboundsoption for the tilelayer, then this is behaviour as expected.i downloaded the latest: Leaflet 1.0.3 and i still see this 404 when i zoom out of map with noWrap because of 0 and negative numbers in the x y z. anyone knows how to solve this?