wrappingCrs = {
const simple = L.CRS.Simple;
const wrappingCrs = L.extend({}, simple, {
wrapLng: [0, mapSize.width],
infinite: true,
projection: {
project: function(latLng) {
const latLng2 = L.latLng(mapSize.height - latLng.lat, latLng.lng);
return simple.projection.project.call(this, latLng2);
},
unproject: function(point) {
const latLng = simple.projection.unproject.call(this, point);
return L.latLng(mapSize.height - latLng.lat, latLng.lng);
},
bounds: {
min: { x: 0, y: 0 },
max: { x: mapSize.width, y: mapSize.height }
}
}
})
return wrappingCrs;
}