diff --git a/content/maps/minecraft/mc-rsninja-dev.md b/content/maps/minecraft/mc-rsninja-dev.md new file mode 100644 index 0000000..46a6279 --- /dev/null +++ b/content/maps/minecraft/mc-rsninja-dev.md @@ -0,0 +1,8 @@ +--- +title: "Minecraft Map Archive: mc.rsninja.dev" +template: map.html +extra: + bg_color: black +--- + + \ No newline at end of file diff --git a/content/maps/minecraft/mc-sdf-org.md b/content/maps/minecraft/mc-sdf-org.md new file mode 100644 index 0000000..220fdc6 --- /dev/null +++ b/content/maps/minecraft/mc-sdf-org.md @@ -0,0 +1,8 @@ +--- +title: "Minecraft Map Archive: mc.sdf.org" +template: map.html +extra: + bg_color: black +--- + + \ No newline at end of file diff --git a/static/map-data/minecraft/mc-rsninja-dev/generate_tile_list.py b/static/map-data/minecraft/mc-rsninja-dev/generate_tile_list.py new file mode 100644 index 0000000..2c6da94 --- /dev/null +++ b/static/map-data/minecraft/mc-rsninja-dev/generate_tile_list.py @@ -0,0 +1,27 @@ +import re +import json +from pathlib import Path + +TILES_DIR = Path(__file__).parent / "tiles" +tiles = list(TILES_DIR.glob("*.png")) + +TILE_PARTS_RE = re.compile(r"([\d\-]+)_([\d\-]+)_x([\d\-]+)_z([\d\-]+).png") + +for tile in tiles: + tile_name = tile.name + match = TILE_PARTS_RE.match(tile_name) + + if match: + chunk_x, chunk_z, x, z = match.groups() + + print( + json.dumps( + { + "chunk_x": int(chunk_x), + "chunk_z": int(chunk_z), + "x": int(x), + "z": int(z), + "image": tile_name + } + ) + "," + ) \ No newline at end of file diff --git a/static/map-data/minecraft/mc-rsninja-dev/map.js b/static/map-data/minecraft/mc-rsninja-dev/map.js new file mode 100644 index 0000000..d7367da --- /dev/null +++ b/static/map-data/minecraft/mc-rsninja-dev/map.js @@ -0,0 +1,80 @@ + +const TILE_SIZE = 1024; +const TILES = [ + { "chunk_x": 0, "chunk_z": 965, "x": -14848, "z": -21504, "image": "0_965_x-14848_z-21504.png" }, + { "chunk_x": 0, "chunk_z": 966, "x": -14848, "z": -20480, "image": "0_966_x-14848_z-20480.png" }, + { "chunk_x": 5, "chunk_z": 992, "x": -9728, "z": 6144, "image": "5_992_x-9728_z6144.png" }, + { "chunk_x": 12, "chunk_z": 985, "x": -2560, "z": -1024, "image": "12_985_x-2560_z-1024.png" }, + { "chunk_x": 12, "chunk_z": 986, "x": -2560, "z": 0, "image": "12_986_x-2560_z0.png" }, + { "chunk_x": 13, "chunk_z": 982, "x": -1536, "z": -4096, "image": "13_982_x-1536_z-4096.png" }, + { "chunk_x": 13, "chunk_z": 983, "x": -1536, "z": -3072, "image": "13_983_x-1536_z-3072.png" }, + { "chunk_x": 13, "chunk_z": 984, "x": -1536, "z": -2048, "image": "13_984_x-1536_z-2048.png" }, + { "chunk_x": 13, "chunk_z": 985, "x": -1536, "z": -1024, "image": "13_985_x-1536_z-1024.png" }, + { "chunk_x": 13, "chunk_z": 986, "x": -1536, "z": 0, "image": "13_986_x-1536_z0.png" }, + { "chunk_x": 13, "chunk_z": 987, "x": -1536, "z": 1024, "image": "13_987_x-1536_z1024.png" }, + { "chunk_x": 13, "chunk_z": 988, "x": -1536, "z": 2048, "image": "13_988_x-1536_z2048.png" }, + { "chunk_x": 13, "chunk_z": 990, "x": -1536, "z": 4096, "image": "13_990_x-1536_z4096.png" }, + { "chunk_x": 14, "chunk_z": 982, "x": -512, "z": -4096, "image": "14_982_x-512_z-4096.png" }, + { "chunk_x": 14, "chunk_z": 983, "x": -512, "z": -3072, "image": "14_983_x-512_z-3072.png" }, + { "chunk_x": 14, "chunk_z": 984, "x": -512, "z": -2048, "image": "14_984_x-512_z-2048.png" }, + { "chunk_x": 14, "chunk_z": 985, "x": -512, "z": -1024, "image": "14_985_x-512_z-1024.png" }, + { "chunk_x": 14, "chunk_z": 986, "x": -512, "z": 0, "image": "14_986_x-512_z0.png" }, + { "chunk_x": 14, "chunk_z": 987, "x": -512, "z": 1024, "image": "14_987_x-512_z1024.png" }, + { "chunk_x": 14, "chunk_z": 988, "x": -512, "z": 2048, "image": "14_988_x-512_z2048.png" }, + { "chunk_x": 14, "chunk_z": 990, "x": -512, "z": 4096, "image": "14_990_x-512_z4096.png" }, + { "chunk_x": 15, "chunk_z": 985, "x": 512, "z": -1024, "image": "15_985_x512_z-1024.png" }, + { "chunk_x": 15, "chunk_z": 986, "x": 512, "z": 0, "image": "15_986_x512_z0.png" }, + { "chunk_x": 15, "chunk_z": 988, "x": 512, "z": 2048, "image": "15_988_x512_z2048.png" }, + { "chunk_x": 17, "chunk_z": 983, "x": 2560, "z": -3072, "image": "17_983_x2560_z-3072.png" }, + { "chunk_x": 23, "chunk_z": 991, "x": 8704, "z": 5120, "image": "23_991_x8704_z5120.png" }, + { "chunk_x": 24, "chunk_z": 991, "x": 9728, "z": 5120, "image": "24_991_x9728_z5120.png" }, + { "chunk_x": 24, "chunk_z": 992, "x": 9728, "z": 6144, "image": "24_992_x9728_z6144.png" }, + { "chunk_x": 24, "chunk_z": 993, "x": 9728, "z": 7168, "image": "24_993_x9728_z7168.png" }, + { "chunk_x": 25, "chunk_z": 993, "x": 10752, "z": 7168, "image": "25_993_x10752_z7168.png" }, + { "chunk_x": 28, "chunk_z": 986, "x": 13824, "z": 0, "image": "28_986_x13824_z0.png" } +] + +// Set up the map +var map = L.map('map', { + crs: L.CRS.Simple, + minZoom: -3, + maxZoom: 3, + backgroundColor: '#000000', +}); + +// Create two empty layers +var base_layer = L.layerGroup(); +var chunked_layer = L.layerGroup(); + +// Add each tile to the map +TILES.forEach(tile => { + var bounds = [[tile.z * -1, tile.x], [(tile.z + TILE_SIZE) * -1, tile.x + TILE_SIZE]]; + var image = L.imageOverlay(`/map-data/minecraft/mc-rsninja-dev/tiles/${tile.image}`, bounds).addTo(chunked_layer); +}); + +// Add the old export to the base layer +var base_offset = [-4887, -2651]; +var bounds = [[0 + base_offset[0], 0 + base_offset[1]], [8983 + base_offset[0], 6205 + base_offset[1]]]; +var image = L.imageOverlay(`/map-data/minecraft/mc-rsninja-dev/world.png`, bounds).addTo(base_layer); + +map.fitBounds(bounds); + +// Add the layers to the map +base_layer.addTo(map); +chunked_layer.addTo(map); + +// Add a control to toggle the layers (allow both to be on at the same time) +L.control.layers({}, { + "Base Layer": base_layer, + "Chunked Layer": chunked_layer +}).addTo(map); + +// Add a CSS rule to pixelate the image only when zoomed in +map.on('zoomend', function (e) { + if (map.getZoom() >= 2) { + if (document.querySelector('#leaflet-pixelator')) return; + document.head.insertAdjacentHTML('beforeend', ''); + } else { + document.querySelector('#leaflet-pixelator').remove(); + } +}); \ No newline at end of file diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/0_965_x-14848_z-21504.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/0_965_x-14848_z-21504.png new file mode 100644 index 0000000..e90f4ca Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/0_965_x-14848_z-21504.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/0_966_x-14848_z-20480.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/0_966_x-14848_z-20480.png new file mode 100644 index 0000000..2f49df4 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/0_966_x-14848_z-20480.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/12_985_x-2560_z-1024.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/12_985_x-2560_z-1024.png new file mode 100644 index 0000000..23f19dc Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/12_985_x-2560_z-1024.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/12_986_x-2560_z0.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/12_986_x-2560_z0.png new file mode 100644 index 0000000..e8c9c01 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/12_986_x-2560_z0.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/13_982_x-1536_z-4096.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_982_x-1536_z-4096.png new file mode 100644 index 0000000..c0c9b1c Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_982_x-1536_z-4096.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/13_983_x-1536_z-3072.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_983_x-1536_z-3072.png new file mode 100644 index 0000000..47d5783 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_983_x-1536_z-3072.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/13_984_x-1536_z-2048.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_984_x-1536_z-2048.png new file mode 100644 index 0000000..db31c33 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_984_x-1536_z-2048.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/13_985_x-1536_z-1024.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_985_x-1536_z-1024.png new file mode 100644 index 0000000..7c07c39 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_985_x-1536_z-1024.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/13_986_x-1536_z0.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_986_x-1536_z0.png new file mode 100644 index 0000000..4ca5abd Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_986_x-1536_z0.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/13_987_x-1536_z1024.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_987_x-1536_z1024.png new file mode 100644 index 0000000..a382cf3 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_987_x-1536_z1024.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/13_988_x-1536_z2048.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_988_x-1536_z2048.png new file mode 100644 index 0000000..b042dbb Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_988_x-1536_z2048.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/13_990_x-1536_z4096.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_990_x-1536_z4096.png new file mode 100644 index 0000000..6c85830 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/13_990_x-1536_z4096.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/14_982_x-512_z-4096.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_982_x-512_z-4096.png new file mode 100644 index 0000000..d418492 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_982_x-512_z-4096.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/14_983_x-512_z-3072.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_983_x-512_z-3072.png new file mode 100644 index 0000000..a777e98 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_983_x-512_z-3072.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/14_984_x-512_z-2048.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_984_x-512_z-2048.png new file mode 100644 index 0000000..1f391dc Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_984_x-512_z-2048.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/14_985_x-512_z-1024.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_985_x-512_z-1024.png new file mode 100644 index 0000000..7c68fcc Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_985_x-512_z-1024.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/14_986_x-512_z0.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_986_x-512_z0.png new file mode 100644 index 0000000..27c21cc Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_986_x-512_z0.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/14_987_x-512_z1024.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_987_x-512_z1024.png new file mode 100644 index 0000000..e9c624c Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_987_x-512_z1024.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/14_988_x-512_z2048.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_988_x-512_z2048.png new file mode 100644 index 0000000..21bfa9e Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_988_x-512_z2048.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/14_990_x-512_z4096.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_990_x-512_z4096.png new file mode 100644 index 0000000..c646c43 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/14_990_x-512_z4096.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/15_985_x512_z-1024.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/15_985_x512_z-1024.png new file mode 100644 index 0000000..e8de520 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/15_985_x512_z-1024.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/15_986_x512_z0.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/15_986_x512_z0.png new file mode 100644 index 0000000..8b064b1 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/15_986_x512_z0.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/15_988_x512_z2048.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/15_988_x512_z2048.png new file mode 100644 index 0000000..ebb9869 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/15_988_x512_z2048.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/17_983_x2560_z-3072.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/17_983_x2560_z-3072.png new file mode 100644 index 0000000..24d9062 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/17_983_x2560_z-3072.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/23_991_x8704_z5120.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/23_991_x8704_z5120.png new file mode 100644 index 0000000..1184c91 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/23_991_x8704_z5120.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/24_991_x9728_z5120.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/24_991_x9728_z5120.png new file mode 100644 index 0000000..c0494ea Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/24_991_x9728_z5120.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/24_992_x9728_z6144.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/24_992_x9728_z6144.png new file mode 100644 index 0000000..15275f0 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/24_992_x9728_z6144.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/24_993_x9728_z7168.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/24_993_x9728_z7168.png new file mode 100644 index 0000000..bfb9242 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/24_993_x9728_z7168.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/25_993_x10752_z7168.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/25_993_x10752_z7168.png new file mode 100644 index 0000000..98ee5c8 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/25_993_x10752_z7168.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/28_986_x13824_z0.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/28_986_x13824_z0.png new file mode 100644 index 0000000..8ab5b80 Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/28_986_x13824_z0.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/tiles/5_992_x-9728_z6144.png b/static/map-data/minecraft/mc-rsninja-dev/tiles/5_992_x-9728_z6144.png new file mode 100644 index 0000000..10b99ff Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/tiles/5_992_x-9728_z6144.png differ diff --git a/static/map-data/minecraft/mc-rsninja-dev/world.png b/static/map-data/minecraft/mc-rsninja-dev/world.png new file mode 100644 index 0000000..82b674c Binary files /dev/null and b/static/map-data/minecraft/mc-rsninja-dev/world.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/generate_tile_list.py b/static/map-data/minecraft/mc-sdf-org/generate_tile_list.py new file mode 100644 index 0000000..2c6da94 --- /dev/null +++ b/static/map-data/minecraft/mc-sdf-org/generate_tile_list.py @@ -0,0 +1,27 @@ +import re +import json +from pathlib import Path + +TILES_DIR = Path(__file__).parent / "tiles" +tiles = list(TILES_DIR.glob("*.png")) + +TILE_PARTS_RE = re.compile(r"([\d\-]+)_([\d\-]+)_x([\d\-]+)_z([\d\-]+).png") + +for tile in tiles: + tile_name = tile.name + match = TILE_PARTS_RE.match(tile_name) + + if match: + chunk_x, chunk_z, x, z = match.groups() + + print( + json.dumps( + { + "chunk_x": int(chunk_x), + "chunk_z": int(chunk_z), + "x": int(x), + "z": int(z), + "image": tile_name + } + ) + "," + ) \ No newline at end of file diff --git a/static/map-data/minecraft/mc-sdf-org/map.js b/static/map-data/minecraft/mc-sdf-org/map.js new file mode 100644 index 0000000..f196f13 --- /dev/null +++ b/static/map-data/minecraft/mc-sdf-org/map.js @@ -0,0 +1,62 @@ + +const TILE_SIZE = 1024; +const TILES = [ + { "chunk_x": 0, "chunk_z": 4, "x": -4096, "z": -512, "image": "0_4_x-4096_z-512.png" }, + { "chunk_x": 1, "chunk_z": 1, "x": -3072, "z": -3584, "image": "1_1_x-3072_z-3584.png" }, + { "chunk_x": 1, "chunk_z": 2, "x": -3072, "z": -2560, "image": "1_2_x-3072_z-2560.png" }, + { "chunk_x": 1, "chunk_z": 3, "x": -3072, "z": -1536, "image": "1_3_x-3072_z-1536.png" }, + { "chunk_x": 1, "chunk_z": 4, "x": -3072, "z": -512, "image": "1_4_x-3072_z-512.png" }, + { "chunk_x": 2, "chunk_z": 0, "x": -2048, "z": -4608, "image": "2_0_x-2048_z-4608.png" }, + { "chunk_x": 2, "chunk_z": 1, "x": -2048, "z": -3584, "image": "2_1_x-2048_z-3584.png" }, + { "chunk_x": 2, "chunk_z": 2, "x": -2048, "z": -2560, "image": "2_2_x-2048_z-2560.png" }, + { "chunk_x": 2, "chunk_z": 3, "x": -2048, "z": -1536, "image": "2_3_x-2048_z-1536.png" }, + { "chunk_x": 2, "chunk_z": 4, "x": -2048, "z": -512, "image": "2_4_x-2048_z-512.png" }, + { "chunk_x": 2, "chunk_z": 5, "x": -2048, "z": 512, "image": "2_5_x-2048_z512.png" }, + { "chunk_x": 3, "chunk_z": 0, "x": -1024, "z": -4608, "image": "3_0_x-1024_z-4608.png" }, + { "chunk_x": 3, "chunk_z": 1, "x": -1024, "z": -3584, "image": "3_1_x-1024_z-3584.png" }, + { "chunk_x": 3, "chunk_z": 2, "x": -1024, "z": -2560, "image": "3_2_x-1024_z-2560.png" }, + { "chunk_x": 3, "chunk_z": 3, "x": -1024, "z": -1536, "image": "3_3_x-1024_z-1536.png" }, + { "chunk_x": 3, "chunk_z": 4, "x": -1024, "z": -512, "image": "3_4_x-1024_z-512.png" }, + { "chunk_x": 3, "chunk_z": 5, "x": -1024, "z": 512, "image": "3_5_x-1024_z512.png" }, + { "chunk_x": 4, "chunk_z": 2, "x": 0, "z": -2560, "image": "4_2_x0_z-2560.png" }, + { "chunk_x": 4, "chunk_z": 3, "x": 0, "z": -1536, "image": "4_3_x0_z-1536.png" }, + { "chunk_x": 4, "chunk_z": 4, "x": 0, "z": -512, "image": "4_4_x0_z-512.png" }, + { "chunk_x": 4, "chunk_z": 5, "x": 0, "z": 512, "image": "4_5_x0_z512.png" }, + { "chunk_x": 5, "chunk_z": 4, "x": 1024, "z": -512, "image": "5_4_x1024_z-512.png" }, + { "chunk_x": 5, "chunk_z": 5, "x": 1024, "z": 512, "image": "5_5_x1024_z512.png" } +] + +// Set up the map +var map = L.map('map', { + crs: L.CRS.Simple, + minZoom: -3, + maxZoom: 3, + backgroundColor: '#000000', +}); + +// Add each tile to the map +TILES.forEach(tile => { + var bounds = [[tile.z * -1, tile.x], [(tile.z + TILE_SIZE) * -1, tile.x + TILE_SIZE]]; + var image = L.imageOverlay(`/map-data/minecraft/mc-sdf-org/tiles/${tile.image}`, bounds).addTo(map); +}); + +// Find the top left and bottom right of the map +var min_x = Math.min.apply(null, TILES.map(tile => tile.x)); +var max_x = Math.max.apply(null, TILES.map(tile => tile.x)); +var min_z = Math.min.apply(null, TILES.map(tile => tile.z)); +var max_z = Math.max.apply(null, TILES.map(tile => tile.z)); + +map.fitBounds([ + [min_z, min_x], + [max_z + TILE_SIZE, max_x + TILE_SIZE] +]); + +// Add a CSS rule to pixelate the image only when zoomed in +map.on('zoomend', function (e) { + if (map.getZoom() >= 2) { + if (document.querySelector('#leaflet-pixelator')) return; + document.head.insertAdjacentHTML('beforeend', ''); + } else { + document.querySelector('#leaflet-pixelator').remove(); + } +}); \ No newline at end of file diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/0_4_x-4096_z-512.png b/static/map-data/minecraft/mc-sdf-org/tiles/0_4_x-4096_z-512.png new file mode 100644 index 0000000..9770dd6 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/0_4_x-4096_z-512.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/1_1_x-3072_z-3584.png b/static/map-data/minecraft/mc-sdf-org/tiles/1_1_x-3072_z-3584.png new file mode 100644 index 0000000..aeb22a0 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/1_1_x-3072_z-3584.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/1_2_x-3072_z-2560.png b/static/map-data/minecraft/mc-sdf-org/tiles/1_2_x-3072_z-2560.png new file mode 100644 index 0000000..71905c0 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/1_2_x-3072_z-2560.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/1_3_x-3072_z-1536.png b/static/map-data/minecraft/mc-sdf-org/tiles/1_3_x-3072_z-1536.png new file mode 100644 index 0000000..636d577 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/1_3_x-3072_z-1536.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/1_4_x-3072_z-512.png b/static/map-data/minecraft/mc-sdf-org/tiles/1_4_x-3072_z-512.png new file mode 100644 index 0000000..e04879c Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/1_4_x-3072_z-512.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/2_0_x-2048_z-4608.png b/static/map-data/minecraft/mc-sdf-org/tiles/2_0_x-2048_z-4608.png new file mode 100644 index 0000000..e75cc8c Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/2_0_x-2048_z-4608.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/2_1_x-2048_z-3584.png b/static/map-data/minecraft/mc-sdf-org/tiles/2_1_x-2048_z-3584.png new file mode 100644 index 0000000..6bc46c5 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/2_1_x-2048_z-3584.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/2_2_x-2048_z-2560.png b/static/map-data/minecraft/mc-sdf-org/tiles/2_2_x-2048_z-2560.png new file mode 100644 index 0000000..2cd6c19 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/2_2_x-2048_z-2560.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/2_3_x-2048_z-1536.png b/static/map-data/minecraft/mc-sdf-org/tiles/2_3_x-2048_z-1536.png new file mode 100644 index 0000000..ed7ffb1 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/2_3_x-2048_z-1536.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/2_4_x-2048_z-512.png b/static/map-data/minecraft/mc-sdf-org/tiles/2_4_x-2048_z-512.png new file mode 100644 index 0000000..b8ec8cb Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/2_4_x-2048_z-512.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/2_5_x-2048_z512.png b/static/map-data/minecraft/mc-sdf-org/tiles/2_5_x-2048_z512.png new file mode 100644 index 0000000..b5278c7 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/2_5_x-2048_z512.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/3_0_x-1024_z-4608.png b/static/map-data/minecraft/mc-sdf-org/tiles/3_0_x-1024_z-4608.png new file mode 100644 index 0000000..3386bd5 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/3_0_x-1024_z-4608.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/3_1_x-1024_z-3584.png b/static/map-data/minecraft/mc-sdf-org/tiles/3_1_x-1024_z-3584.png new file mode 100644 index 0000000..3acad3c Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/3_1_x-1024_z-3584.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/3_2_x-1024_z-2560.png b/static/map-data/minecraft/mc-sdf-org/tiles/3_2_x-1024_z-2560.png new file mode 100644 index 0000000..05cf2a3 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/3_2_x-1024_z-2560.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/3_3_x-1024_z-1536.png b/static/map-data/minecraft/mc-sdf-org/tiles/3_3_x-1024_z-1536.png new file mode 100644 index 0000000..491d56d Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/3_3_x-1024_z-1536.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/3_4_x-1024_z-512.png b/static/map-data/minecraft/mc-sdf-org/tiles/3_4_x-1024_z-512.png new file mode 100644 index 0000000..d719db9 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/3_4_x-1024_z-512.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/3_5_x-1024_z512.png b/static/map-data/minecraft/mc-sdf-org/tiles/3_5_x-1024_z512.png new file mode 100644 index 0000000..c79ec5c Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/3_5_x-1024_z512.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/4_2_x0_z-2560.png b/static/map-data/minecraft/mc-sdf-org/tiles/4_2_x0_z-2560.png new file mode 100644 index 0000000..42329dd Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/4_2_x0_z-2560.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/4_3_x0_z-1536.png b/static/map-data/minecraft/mc-sdf-org/tiles/4_3_x0_z-1536.png new file mode 100644 index 0000000..ac44b47 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/4_3_x0_z-1536.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/4_4_x0_z-512.png b/static/map-data/minecraft/mc-sdf-org/tiles/4_4_x0_z-512.png new file mode 100644 index 0000000..4ef2486 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/4_4_x0_z-512.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/4_5_x0_z512.png b/static/map-data/minecraft/mc-sdf-org/tiles/4_5_x0_z512.png new file mode 100644 index 0000000..35ce2f1 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/4_5_x0_z512.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/5_4_x1024_z-512.png b/static/map-data/minecraft/mc-sdf-org/tiles/5_4_x1024_z-512.png new file mode 100644 index 0000000..0fe22d0 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/5_4_x1024_z-512.png differ diff --git a/static/map-data/minecraft/mc-sdf-org/tiles/5_5_x1024_z512.png b/static/map-data/minecraft/mc-sdf-org/tiles/5_5_x1024_z512.png new file mode 100644 index 0000000..b096be0 Binary files /dev/null and b/static/map-data/minecraft/mc-sdf-org/tiles/5_5_x1024_z512.png differ diff --git a/templates/map.html b/templates/map.html new file mode 100644 index 0000000..da5f84b --- /dev/null +++ b/templates/map.html @@ -0,0 +1,50 @@ + + + + + + + + {{page.title}} | {{config.title}} + + + {% if current_url %}{% endif %} + + {# OpenGraph #} + + + + + + + + + + + + + + + + {# Page Content #} +
+
+ + {{page.content | safe}} +
+ + {# A bit of a hack to get VSCode to format this document correctly #} + {% if page.extra.bg_color %} + + {% endif %} + + {# Goatcounter #} + + + + + \ No newline at end of file