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

[Bug] Properties "extent" and "minZoom" on a MvtLayer can not be used together #8695

Open
1 of 7 tasks
wahler opened this issue Mar 22, 2024 · 0 comments
Open
1 of 7 tasks
Labels

Comments

@wahler
Copy link

wahler commented Mar 22, 2024

Description

I have a MvtLayer with a lot of datapoints which only makes sense to render starting from a specific zoom level. So I used the minZoom setting of the MvtLayer.
Also the datapoints are all located in a single country. I wanted to stop tile requests for areas, that are outside of this country. For that I tried to add the "extent" property.

The combination of these two properties showed some unexpected behavior. For example my inittial zoom level is 5, minZoom of the layer is 10. As soon as I add the extent property, the layer starts to show already on zoom level 5. But it is not using the tile size for zoom level 5. It actually used the tile size that would be used on zoom level 10. That means it fires a lot of requests against the vector tile API.

Flavors

  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CartoLayer
  • ArcGIS

Expected Behavior

minZomm and extent on a MvtLayer can be used in combination. vector tile requests are limuted to the box configured with the extent property. Tile requests and rendering starts not before the minZoom level is reached.

Steps to Reproduce

I prepared a CodeSandbox for this. The only thing that needs to be added would be a Mapbox token to make the example runnable: https://codesandbox.io/p/sandbox/vigilant-merkle-pd82h2

And the extent property needs to be uncommented.

Environment

  • Framework version: 8.9.35
  • Browser: Chrome v123
  • OS: macOS 14.4

Logs

No response

@wahler wahler added the bug label Mar 22, 2024
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

1 participant