Skip to content

Zoom in not showing the imagery. #2379

Open

Description

@napgeoAnalyst

Title

Esri World Imagery tiles do not display when switching layers at zoom level 15

Problem description

I am building an interactive GIS dashboard using Python, Folium, and Leaflet.

My map uses Esri World Dark Gray as the default basemap. I want Esri World Imagery to automatically appear when the user zooms to level 15 or closer, and return to the dark grayscale basemap when zooming out below level 15.

The dark grayscale basemap displays correctly. However, when the map reaches zoom level 15, the satellite imagery layer is added but the map displays gray tiles with the message "Map data not yet available" instead of satellite imagery.

I tested the Esri World Imagery REST service directly in my browser, and an individual tile successfully returned satellite imagery. This suggests the imagery service is reachable, but I may be implementing the automatic layer switching incorrectly.

Expected behavior

  • Zoom levels 13–14: Display Esri World Dark Gray.
  • Zoom level 15 and closer: Automatically display Esri World Imagery.
  • Zoom back below level 15: Remove satellite imagery and restore Esri World Dark Gray.
  • Preserve existing GIS layers, markers, city boundaries, and map title.

Current implementation

I am using a Folium TileLayer for the dark grayscale basemap and a Leaflet JavaScript MacroElement with:

  • L.tileLayer()
  • map.on('zoomend')
  • map.addLayer()
  • map.removeLayer()

The imagery URL is:

https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}

Environment

  • Python
  • Folium
  • Branca MacroElement
  • Jinja2
  • Leaflet
  • Esri World Imagery REST service
  • Windows 11

Help requested

Could someone help identify why the imagery tiles are not rendering when the layer is dynamically added at zoom level 15?

I would appreciate a working example of automatically switching between these two basemaps based on zoom level while preserving the existing Folium map layers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions