SDTD_Projection = { project: function (latlng) { return new L.Point(latlng.lng / 16, latlng.lat / 16); }, unproject: function (point) { return new L.LatLng(point.y * 16, point.x * 16); } }; SDTD_CRS = L.extend({}, L.CRS.Simple, { projection: SDTD_Projection, transformation: new L.Transformation(1, 0, -1, 0), scale: function (zoom) { return Math.pow(2, zoom); } }); var map = L.map('map', { zoomControl: true, attributionControl: false, crs: SDTD_CRS }).setView([0, 0], 0); L.tileLayer('../../map/{z}/{x}/{y}.png?t={time}', { maxZoom: 5, minZoom: 0, maxNativeZoom: 4, tileSize: 128, continuousWorld: true, tms: true, unloadInvisibleTiles: true, time: function() { return new Date().getTime(); } }).addTo(map); map.on('mousemove', function(e) { L.DomUtil.get('pos').textContent = "MouseCoord: " + Math.abs(e.latlng.lng) + (e.latlng.lng>=0 ? " E" : " W") + " / " + Math.abs(e.latlng.lat)+ (e.latlng.lat>=0 ? " N" : " S"); });