Scaling icons, labels, lines on panning/zooming backgrounds #9712
joergplewe
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear admired developers,
I'm looking for a solution for - as I think - quite common problem.
Imagine having kind of a zoomable/panable map in the background, with some objects on that map represented by icon, maybe accompanied by a label.
Now, as icons and labels are children of the map container so they scale together with the map when zooming, they change their position (on screen, they should), but also change their sizes. They shouldn't.
Same holds e.g. for lines that make up the map, where line-width should not change while zooming.
Is there a preferred way to do that?
(What I do: whenever the
scale
of the map changed while zooming, I notify each and every object on the map and counter-scale it by1/scale
. And repaint the all lines with an adapted line width. This is difficult to code and costs quite an amount of performance if there are many objects; tens of thousands in my case. Is there a better way??)Beta Was this translation helpful? Give feedback.
All reactions