-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ZoomLimiter to LabelLayer (#504) #544
Conversation
It's not only about labels / symbols at tile edges. |
|
||
static final Logger log = LoggerFactory.getLogger(LabelLayer.class); | ||
|
||
static final String LABEL_DATA = LabelLayer.class.getName(); | ||
|
||
private static final long MAX_RELABEL_DELAY = 100; | ||
|
||
/* Set to maximum "zoom-min" value for labels in render themes */ | ||
public static final int ZOOM_LIMIT = 18; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course have to make it private
or remove final
;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ZOOM_LIMIT
shouldn't be large or else rendering is similar like now. A sane default could be 17
.
Nevertheless a side effect is that if set in themes zoom-min
> ZOOM_LIMIT
then the labels / symbols are not rendered!
We somehow need to not break themes functionality here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added in my tests an extra constructor with also the zoom limit.
Yeah that's a good reason; for other areas, too. Unfortunately the zoom limit has to be 18, otherwise it is bothered by render themes. |
I merged it for now in issue_544 branch with mentioned improvements. Will need more work there to not break themes |
I didn't work with theme logic so far. I'll have a look at it next week when I have enough time (or can try to solve yourself, if you want) |
I'm afraid. I don't see a proper way to implement that. In Main problem is that tiles are independent of Layers, and call information only of its zoom level. So we only could use zoom limits, when nothing in zooms or themes changes in their layers, so it uses exactly what we expect. Tiles can't differ the layers and individually pass information for their needs. I would suggest, to use zoom limit at 18, where nothing in theme's changes. So symbols and captions aren't divided in 19 and 20. Sorry for that, if you have more ideas, let me know. |
Default implementation should probably be without zoom limit on themes, that's what users expect.
I already did that in mapsforge/mapsforge#1061. 🙂 |
@Gustl22 thanks for double checking it! |
So we could set
Very nice. Does it make sense for other polygons/areas, too? Or we individually can check while testing, and change from time to time. |
Something like that. In issue_544 branch this default value is private and can control the label layer via a new constructor.
What do you mean? |
I only meant if it's necessary to change |
That would be useful, feel free to see what other closed ways - which host labels or symbols - can use the I only added it in buildings as the most relevant example for testing. |
Thanks! |
I don't really know if zoom limiter is necessary in
LabelLayer
. Maybe it's good to have. But since usingTileSeparator
the labels aren't displayed twice at tile borders.And don't know if these few labels, which aren't processed multiple times (at borders) have better performance economization compared to loading the zoom limit tiles of
LabelLayer
(here zoom 18).Anyway I made
LabelLayer.ZOOM_LIMIT = 18
public, so if set this toViewport.MAX_ZOOM_LEVEL
all works similar to before.