osmeditor4android icon indicating copy to clipboard operation
osmeditor4android copied to clipboard

Render labels for "all" GeoJson objects

Open simonpoole opened this issue 1 year ago • 2 comments
trafficstars

Currently we only render labels for Point and Multipoint objects.

See https://github.com/MarcusWolschon/osmeditor4android/issues/2489

simonpoole avatar Feb 15 '24 06:02 simonpoole

@simonpoole I am trying to work on this issue (as a part of my participation for Gsoc 2024), could you elaborate a bit on which algorithm do you see fit to render the rectangular canvases for labeling a line. The aim as I see is to render the canvas rectangle such as depending on the zoom level and how much the area the whole line entity takes in the Viewbox, more or less of these labels should be shown along the lines. (Just like one renders the name on a way.) Thus I wanted to know what you think will be the best approach here so that i can implement it.

Additionally if you could also point something out relating to the sluggishness while rendering these labels and what to keep an eye out to minimize this latency that would be helpful.

aarewhyan avatar Apr 01 '24 11:04 aarewhyan

For line labelling you typically would a) determine the length of the label, b) render it on/near segments of the line that are visible and longer than the length of the label, potentially repeating on longer lines. IMHO that is a bit overkill for this use case, so I would suggest just rendering once on the visible portion.

For polygons I would simply use the centroid of the visible part.

simonpoole avatar Apr 04 '24 08:04 simonpoole