You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Images are placed with their top-left corner at the provided location
// within the canvas but we expect icons to be centered and above it.
// Substract half of the images width from the x-coordinate to center
// the image in relation to the provided location
letxCoordinate=pixelCoords[0]-imageWidth/2;
// Substract the images height from the y-coordinate to place it above
// the provided location
letyCoordinate=pixelCoords[1]-imageHeight;
// Since image placement is dependent on the size offsets have to be
// scaled as well. Additionally offsets are provided as either positive or
// negative values so we always add them
if(marker.offsetX){
xCoordinate=xCoordinate+marker.offsetX*scale;
}
if(marker.offsetY){
yCoordinate=yCoordinate+marker.offsetY*scale;
}
return{
x: xCoordinate,
y: yCoordinate,
};
};
Basically what I believe is happening is that if the height of the requested image is too large, the map will hit it's max zoom and stop zooming for lower zoom levels, ie notice that the map at zoom level 1 is the exact same as the map at zoom level 1.8 if you request an 1000x1000 image. Because of this, I believe the mercator projection is still expecting the map to be furthered zoomed out, while the zoom of the image is the same and thus causing a mismatch. Not sure what the fix is though.
Issue
Low zoom levels using markers are broken (ie the marker doesn't appear in the correct location), for latitude
Working Zoom Level (marker on Zurich)
Zoom Level Broken
Config used looks something like this
Thoughts on why this is happening
I did some investigating. Below is the code that I think needs to be fixed.
tileserver-gl/src/serve_rendered.js
Lines 338 to 380 in 2a441a0
Basically what I believe is happening is that if the height of the requested image is too large, the map will hit it's max zoom and stop zooming for lower zoom levels, ie notice that the map at zoom level
1
is the exact same as the map at zoom level1.8
if you request an1000x1000
image. Because of this, I believe the mercator projection is still expecting the map to be furthered zoomed out, while the zoom of the image is the same and thus causing a mismatch. Not sure what the fix is though.Curl 1
Curl 1.8
About
Macos: 13.5.1
Docker: 4.24.0
TileserverGL: 4.5.2
The text was updated successfully, but these errors were encountered: