javascript - Leaflet map not loading tiles -
my code:
<!doctype html> <html> <head> <title>openttd map</title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="https://npmcdn.com/leaflet@1.0.0-rc.3/dist/leaflet.css" /> <script src="https://npmcdn.com/leaflet@1.0.0-rc.3/dist/leaflet.js"></script> </head> <body> <div id="map" style="width: 1600px; height: 900px"></div> <script> var tile_url = 'http://dev.ruun.nl/zelf/openttd/tiles/map_{x}_{y}.png'; var map = l.map('map', { maxzoom: 20, minzoom: 20, crs: l.crs.simple }).setview([0, 0], 20); //65409x32839 var southwest = map.unproject([0, 32839], map.getmaxzoom()); var northeast = map.unproject([65409, 0], map.getmaxzoom()); map.setmaxbounds(new l.latlngbounds(southwest, northeast)); l.tilelayer(tile_url, { attribution: 'map data © ieuan\'s openttd world', continuousworld: true, tilesize: 256 }).addto(map); </script> </body> </html>
for reason tiles aren't loading, map showing grey. they're not being downloaded browser , i'm not getting error messages
the tiles 256x256 parts of 65409x32839 screenshot
url view http://dev.ruun.nl/zelf/openttd/
you have explicitly specify tile layer maxzoom
option 20, otherwise default value of 18
, prevents tiles being called @ zoom (20
).
Comments
Post a Comment