1
0
Fork 0

Hack uploader

master
marko 2022-02-16 21:32:39 -05:00
parent 5514ed8ea0
commit 4a1e101fa8
1 changed files with 7 additions and 7 deletions

View File

@ -186,10 +186,10 @@ TODO:
var canvas = document.getElementById("maptiles");
canvas.style.display="";
var ctx = canvas.getContext('2d');
canvas.width = OSMTILESIZE*2;
canvas.height = OSMTILESIZE*2;
for (var i = 0; i < 3; i++) {
for (var j = 0; j < 3; j++) {
canvas.width = 912;//OSMTILESIZE*2;
canvas.height = 912;//OSMTILESIZE*2;
for (var i = 0; i < 0; i++) {
for (var j = 0; j < 0; j++) {
(function(i,j){
var coords = new L.Point(center.x+i-1, center.y+j-1);
coords.z = zoom;
@ -197,7 +197,7 @@ TODO:
img.crossOrigin = "Anonymous";
tileGetters.push(new Promise(function(resolve,reject) {
img.onload = function(){
ctx.drawImage(img,i*OSMTILESIZE - ox, j*OSMTILESIZE - oy);
ctx.drawImage(img, 0, 0);//i*OSMTILESIZE - ox, j*OSMTILESIZE - oy);
/*if (testPt) {
ctx.fillStyle="green";
ctx.fillRect(testPt.x-1, testPt.y-5, 3,10);
@ -207,7 +207,7 @@ TODO:
};
}));
bangleTileLayer._tileZoom = previewTileLayer._tileZoom;
img.src = bangleTileLayer.getTileUrl(coords);
img.src = 'http://sandshore.duckdns.org:2552/boca_ciega_cr.png';
})(i,j);
}
}
@ -216,7 +216,7 @@ TODO:
Promise.all(tileGetters).then(() => {
document.getElementById("uploadbuttons").style.display="";
mapFiles = tilesLoaded(ctx, canvas.width, canvas.height);
mapFiles.unshift({name:"seachart.json",content:JSON.stringify({
mapFiles.unshift({name:"openseachart.json",content:JSON.stringify({
imgx : canvas.width,
imgy : canvas.height,
tilesize : TILESIZE,