Mapbox-gl-native: POI disappears unnecessarily when zooming in or rotating

Created on 4 Jun 2015  Â·  9Comments  Â·  Source: mapbox/mapbox-gl-native

The “Restaurant Tsugaru” POI in the first screenshot disappears as soon as you zoom in to the next level, even though there doesn’t appear to be anything that would collide with it that wasn’t in the previous zoom level:

out

in

When rotating, I see this POI possibly avoiding collisions with a nearby one (“Shinmori Optometry”), but at certain angles, neither POI shows up, probably because of each other:

food

nothing

sight

In mapbox-gl-js, the same POIs also blink in and out when zooming and rotating, though the thresholds are slightly different.

bug

Most helpful comment

Seems like there should be an option to force individual markers to always render no matter if they are overlapping other markers or labels or whatever. Sometimes you want to show all markers no matter what. Does it look crowded? Yeah probably. But let the user decide what they want instead of forcing this on them.

All 9 comments

Not the best gif, but Tsugaru Restaurant disappears at max zoom and the surrounding collision boxes become red.

ezgif com-gif-maker

Still happens.

This is expected right now

The label that disappears is blocked by other labels that will show up later in the zoom level (when you zoom in a bit more). It's implemented this way to reduce labels popping in and out all the time while zooming.

I agree that it would be better if the label didn't disappear but I'm going to treat this as an enhancement, not a bug.

I don't see us doing a major revision of the labelling algorithm anytime soon but I'm keeping track of all the algorithm suggestions in a separate master ticket. They all impact each other so I think it makes sense to close the individual issues and keep the ideas in one spot: https://github.com/mapbox/mapbox-gl/issues/14

@ansis Is this a regression due to overscaling changes? Previously when placement was done for multiple zoom levels, it used to enforce the invariant that if a symbol appeared it would continue to show for current zoom level and next (or until forever when placement was done for source maxzoom). It would be a nice invariant to have for symbol placement.

@ansis Is this a regression due to overscaling changes? Previously when placement was done for multiple zoom levels, it used to enforce the invariant that if a symbol appeared it would continue to show for current zoom level and next (or until forever when placement was done for source maxzoom). It would be a nice invariant to have for symbol placement.

Yes and no. Before we started reparsing tiles at every zoom level it would use the same parsed data at every zoom level above the maximum zoom level. After the source's maximum zoom level labels would never disappear when zooming in. The could disappear at lower zoom levels though. Switching to reparsed tiles had many benefits including better performance and denser labels. I don't think we'll switch back

@ansis Is the following an accurate description(or not) of the expected behavior for cases where only the zoomlevel is changing (rotation and tilt remains same)?

1.) If the zoom starts at a level < maxzoom, symbols can disappear when data from a new tile gets loaded?
2.) If zoom starts at maxzoom, symbol will not disappear (if rotation and tilt remains same).

@mb12
1) yes
2) often, but not always. For example:

there are labels A and B and the maxzoom is 14. A is placed before B and is blocked by some other label. A can only be shown at z16.3. If the tile placement is calculated at z14 or z15 then A will not show up anywhere within that tile's zoom level so it will be ignored completely. If the tile is placed at z16 then A is not ignored and it might block B. It's possible that B is visible for z14-15.99, neither is visible for z16-16.3, and A is visible for z16.3+.

It's a tradeoff between consistency and density.

@ansis Thank you very much for the detailed explanation.

Seems like there should be an option to force individual markers to always render no matter if they are overlapping other markers or labels or whatever. Sometimes you want to show all markers no matter what. Does it look crowded? Yeah probably. But let the user decide what they want instead of forcing this on them.

Was this page helpful?
0 / 5 - 0 ratings