mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 08:17:30 +02:00
Make tileCenter return the point actually at the tile center
Then use css to adjust the position of the debug div
This commit is contained in:
@@ -2484,6 +2484,7 @@ img.tile {
|
||||
}
|
||||
|
||||
.tile-label-debug {
|
||||
font-size: 10px;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
@@ -2491,6 +2492,8 @@ img.tile {
|
||||
padding: 5px;
|
||||
border-radius: 3px;
|
||||
z-index: 2;
|
||||
margin-left: -50px;
|
||||
margin-top: -20px;
|
||||
|
||||
transform-origin:0 0;
|
||||
-ms-transform-origin:0 0;
|
||||
|
||||
@@ -151,11 +151,9 @@ export function rendererTileLayer(context) {
|
||||
function tileCenter(d) {
|
||||
var _ts = tileSize * Math.pow(2, z - d[2]);
|
||||
var scale = tileSizeAtZoom(d, z);
|
||||
// FIXME: this scale * tileSize/number stuff is hacky, and more for displaying the debug text.
|
||||
// It's not really the center of the tile, but it is guaranteed to be somewhere in the tile.
|
||||
return [
|
||||
((d[0] * _ts) - tileOrigin[0] + pixelOffset[0] + scale * (tileSize / 4)),
|
||||
((d[1] * _ts) - tileOrigin[1] + pixelOffset[1] + scale * (tileSize / 2))
|
||||
((d[0] * _ts) - tileOrigin[0] + pixelOffset[0] + (_ts / 2)),
|
||||
((d[1] * _ts) - tileOrigin[1] + pixelOffset[1] + (_ts / 2))
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user