Fist Push

This commit is contained in:
troispoils 2024-05-07 18:01:11 +02:00
parent dd63653413
commit cab9de1e90
118 changed files with 364726 additions and 0 deletions

33
public/scripts/map.js Normal file
View file

@ -0,0 +1,33 @@
// Constantes
const TILE_SIZE = 255;
const CENTER_LAT = -127.5;
const CENTER_LON = 127.5;
const ZOOM_LEVEL = 4;
const BOUNDS_MAX = [
[-255, 0],
[0, 255],
];
// Variables
export var map = {};
// Fonction pour initialiser la carte
export default function InitialisationMap() {
map = L.map("map", {
crs: L.CRS.Simple,
minZoom: 1,
maxZoom: 8,
}).setView([CENTER_LAT, CENTER_LON], ZOOM_LEVEL);
addTileLayer();
}
// Fonction pour ajouter la couche de tuiles
function addTileLayer() {
L.tileLayer("/tiles/{z}/{x}/{y}.jpg", {
tileSize: TILE_SIZE,
noWrap: true,
bounds: BOUNDS_MAX,
attribution: "© Asheron's call 2 maps",
}).addTo(map);
}