Skip to content

Vector tile does not render when zoom level greater than 14 #1715

@giswqs

Description

@giswqs

Describe the bug
The vector tile layer does not render when zoom level is great than 14.
@iwpnd

To Reproduce
https://nbviewer.org/github/python-visualization/folium/blob/main/examples/plugin-vector-tiles.ipynb

import folium
from folium.plugins import VectorGridProtobuf
url = "https://vectortiles3.geo.admin.ch/tiles/ch.swisstopo.leichte-basiskarte.vt/v1.0.0/{z}/{x}/{y}.pbf"
m = folium.Map(location=[46.8, 8.2], zoom_start=14)

options = {'maxNativeZoom': 20, 'maxZoom': 20}
# options = {'max_native_zoom': 20, 'max_zoom': 20} #not working either

vc = VectorGridProtobuf(url, "vector tile", options)
m.add_child(vc)
m

Peek 2023-01-27 09-38

Expected behavior
The vector tile layer should render in a zoom level much larger than 14 so that we can see the details of vector data.

Environment (please complete the following information):

  • Python version: 3.9
  • folium version: 0.13.0

Possible solutions
The leaflet VectorGrid.Protobuf example appears to have the maxNativeZoom parameter. I am not sure if the folium plugin can pass the maxNativeZoom and maxZoom parameters to VectorGrid.Protobuf.

https://leaflet.github.io/Leaflet.VectorGrid/vectorgrid-api-docs.html

L.vectorGrid.protobuf("https://free-{s}.tilehosting.com/data/v3/{z}/{x}/{y}.pbf.pict?key={key}", {
    vectorTileLayerStyles: { ... },
    subdomains: "0123",
    key: 'abcdefghi01234567890',
    maxNativeZoom: 14
}).addTo(map);

Relevant issues
microsoft/PlanetaryComputer#175 @TomAugspurger

Metadata

Metadata

Assignees

No one assigned

    Labels

    pluginThis issue/PR is about an existing or new plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions