From cbc4a946c63bc04fcb920f866f858013a87c1c8b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 12 Feb 2021 23:43:20 +0100 Subject: [PATCH] Info: rename mipmap "info" key to "bounds" --- src/Info.cpp | 2 +- viewer/MinedMap.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Info.cpp b/src/Info.cpp index 913c0f2..55c1156 100644 --- a/src/Info.cpp +++ b/src/Info.cpp @@ -54,7 +54,7 @@ void Info::writeJSON(const char *filename) const { std::tie(minX, maxX, minZ, maxZ) = getBounds(level); std::fprintf(f, "{"); - std::fprintf(f, "\"info\":{"); + std::fprintf(f, "\"bounds\":{"); std::fprintf(f, "\"minX\":%i,", minX); std::fprintf(f, "\"maxX\":%i,", maxX); std::fprintf(f, "\"minZ\":%i,", minZ); diff --git a/viewer/MinedMap.js b/viewer/MinedMap.js index 8eb4b1f..0ced720 100644 --- a/viewer/MinedMap.js +++ b/viewer/MinedMap.js @@ -60,8 +60,8 @@ var MinedMapLayer = L.GridLayer.extend({ var mipmap = this.mipmaps[z]; - if (coords.x >= mipmap.info.minX && coords.x <= mipmap.info.maxX && - coords.y >= mipmap.info.minZ && coords.y <= mipmap.info.maxZ && + if (coords.x >= mipmap.bounds.minX && coords.x <= mipmap.bounds.maxX && + coords.y >= mipmap.bounds.minZ && coords.y <= mipmap.bounds.maxZ && contains(mipmap.regions[coords.y] || [], coords.x)) tile.src = 'data/'+this.layer+'/'+z+'/r.'+coords.x+'.'+coords.y+'.png'; @@ -190,8 +190,8 @@ window.createMap = function () { maxZoom: 3, crs: L.CRS.Simple, maxBounds: [ - [-512*(mipmaps[0].info.maxZ+1), 512*mipmaps[0].info.minX], - [-512*mipmaps[0].info.minZ, 512*(mipmaps[0].info.maxX+1)], + [-512*(mipmaps[0].bounds.maxZ+1), 512*mipmaps[0].bounds.minX], + [-512*mipmaps[0].bounds.minZ, 512*(mipmaps[0].bounds.maxX+1)], ], });