leaflet.TileLayer.WMTS icon indicating copy to clipboard operation
leaflet.TileLayer.WMTS copied to clipboard

tilerow = -Math.round((nw.y - Y0) / tilewidth) computes wrong value for what should result in tilerow=0

Open zigacernigoj opened this issue 6 years ago • 1 comments

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.

zigacernigoj avatar Jul 10 '18 13:07 zigacernigoj

+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);

NickSavin avatar Oct 04 '21 13:10 NickSavin