-
By default, point text labels have fixed LatLon coordinates which are constant across zoom levels. However, the ideal placement can depend on the zoom level. I would like to move labels of countries depending on the zoom level. This requires that I can configure the LatLon of a Point depending on the zoom level. Are there any options to do this in Planetiler? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
There isn't a built in way to do this, but you could emit distinct separate features for each zoom level. Something like: for (int z = 1; z <= 14; z++) {
var geom = computePointAtZoom(z);
features.geometry(layer, geom).setZoomRange(z)... setup feature
} Maybe there could be some more succinct way using the z or m coordinate of jts point features, but this approach should work today. |
Beta Was this translation helpful? Give feedback.
-
This sounds like something that a MapLibre stylesheet would have better control over, especially if the map can be rotated and/or tilted or if the font can vary. |
Beta Was this translation helpful? Give feedback.
The geometry needs to already be projected into "world web mercator" coordinates where 0,0=top left, and 1,1=bottom right. There's a
latLonToWorldCoords(geometry)
utility for this, so you could do: