Need help with upgrading from 0.7.7

12 views
Skip to first unread message

Christian Voigt

unread,
Nov 19, 2017, 7:22:14 AM11/19/17
to Leaflet
Hi there.
I am losing my mind over this, been trying for two days now to understand this :)

I've got an online game which stores it's maps on a server, ready to be displayed by leaflet and similar tools, stored in /Z/X/Y, circular world, center is 0,0.
I based my work on some examples on the net and slimmed them down as far as I could. I realized too late that they are all based on 07.7. 

The map shows perfectly in 0.7.7 and pretty much breaks with any newer version. Playing around with settings I've gotten all sorts of result, from a working lower half, complete globe with garbled y-axis and broken zoom...

the code is simple enough : (perfect result in 0.7.7)

//sdtdCRS = L.extend({}, L.CRS.Simple, {});

map = L.map('map', {
// crs: sdtdCRS,
attributionControl: false,
zoomControl: false,
});

tileSize: 128, // helps with the min-zoom for some reason
maxNativeZoom: 4,
tms: true, // makes it sorted right on the y-axis
continuousWorld: true, // doesn't show at all without this
});

map.setView([0, 0], 0);
tileLayer.addTo(map);

(for some reason the sdtdCRS centers the map, not important for this, commented out)

You can check it out on https://panel.chrani.net/map.php (0.7.7) and map2.php (1.2.0)

This is my very first try at leaflet and I haven't seen JavaScript in years, so please be patient with me :)

Can anyone send me some pointers? i can't find any obvious change-logs that would explain why nothing is working right after the upgrade, but well, there were a lot of changes :)
Reply all
Reply to author
Forward
0 new messages