Open zigacernigoj opened 6 years ago
+1 changed
var tilecol = Math.floor((nw.x - X0) / tilewidth);
var tilerow = -Math.floor((nw.y - Y0) / tilewidth);
to
var tilecol = Math.round((nw.x - X0) / tilewidth);
var tilerow = -Math.round((nw.y - Y0) / tilewidth);
When computing tilerow number for the first row, the result of
let tilerow = -Math.round((nw.y - Y0) / tilewidth);
is 1 instead of 0 if using too "big" precision for latlng;I fixed it with using
Math.round();
instead.