Skip to content
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

Circle Layer disappears after certain zoom level #4954

Closed
yatiac opened this issue Jul 7, 2017 · 8 comments
Closed

Circle Layer disappears after certain zoom level #4954

yatiac opened this issue Jul 7, 2017 · 8 comments
Labels

Comments

@yatiac
Copy link

yatiac commented Jul 7, 2017

mapbox-gl-js version: 0.38.0

Steps to Trigger Behavior

  1. Add a circle Layer
  2. Zoom-in (a lot) in the circle

I made this fiddle where you can reproduce it: http://jsfiddle.net/0mv5nhkv/

Expected Behavior

The circle remains at all zoom levels

Actual Behavior

The circle disappears after a certain zoom level (it seems after changing from z11 to z12)

@mourner
Copy link
Member

mourner commented Jul 7, 2017

This might have been fixed (or at least improved) by #4934, can you check with the master version?

@kkaefer
Copy link
Member

kkaefer commented Jul 7, 2017

With data-driven styling, you can make the circle size depend on a value in the vector tile. This means that you could be zoomed in to one location, and a circle in another area of the world would be so big that it covered the current viewport as well. We don't, however, have a way to anticipate those values in all vector tiles, and we don't have a way to compute the maximum permissible value, since it depends on data in the vector tiles.

For this reason, we do not recommend making circles that will be displayed larger than roughly one tile. If you need circles that are bigger than that, please generate the vector geometry (polygons) and use the GeoJSON source, or a vector tile source, to display it.

@kkaefer kkaefer closed this as completed Jul 7, 2017
@yatiac
Copy link
Author

yatiac commented Jul 7, 2017

I think I understand what you said @kkaefer.

If you try this fiddle: http://jsfiddle.net/n0Lerf2s/ and uses the buttons (go to zoom 22 and reset zoom) the circle doesn't disappears even at max zoom level (22).

I still haven't tried @mourner 's suggestion, I will do that and come back.

@yatiac
Copy link
Author

yatiac commented Jul 7, 2017

@mourner I have tried with the master version but is still not working.

@pathmapper
Copy link
Contributor

pathmapper commented Jul 8, 2017

It could be that this has something to do with the panning of the map.
When only using zoom controls for zooming, the circle is visible for all zoom levels:
http://jsfiddle.net/n0Lerf2s/4/
When panning the map, the issue occurs again.
Using the mousewheel for zooming, there will be most of the time some kind of panning, because you are not pointing over the center of the map with the mouse pointer.

@mourner
Copy link
Member

mourner commented Jul 8, 2017

Yeah, I was wrong — the real problem here was described by @kkaefer above. If you zoom in with the circle exactly in the center, it will stay in the current tile, but if you zoom in an area a few tiles away from the center of the circle, it will disappear because relevant tile won't be loaded.

@ericjames
Copy link

ericjames commented Mar 30, 2018

@kkaefer Information like this would be very helpful if immediately added to the documentation because it is highly unexpected behavior! I spent much time making sure my rules were not the issue only to randomly Google to find this answer. Issues like this cause the developer to question whether they are implementing code wrong, only to find that the underlying software actually does not support this behavior.

For this reason, we do not recommend making circles that will be displayed larger than roughly one tile. If you need circles that are bigger than that, please generate the vector geometry (polygons) and use the GeoJSON source, or a vector tile source, to display it.

@enersis-pst
Copy link
Contributor

There is really no way? Sounds really strange that big circles are not possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants