Skip to content

[Bug] TileLayer minZoom uses rounding instead of Math.floor #9806

@rory-orennia

Description

@rory-orennia

Description

The minZoom is a little off because it rounds the current zoom rather than using the floor to compare against the minZoom prop that has Math.ceil on it

Flavors

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

Expected Behavior

If your zoom is less than minZoom, It should not render

Steps to Reproduce

https://codepen.io/dk710/pen/bNEBLME?editors=0011
Zoom in and out, The console logs the current zoom.
Notice that it shows the tiles at zoom 9.5, hides at 9.49999. It shouldn't show until you hit >= 10.0

Environment

  • Framework version: 9.1.4
  • Browser: Doesn't matter
  • OS: Doesn't matter

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions