17 vector tile layer
In [1]:
Copied!
# !pip install leafmap
# !pip install leafmap
This notebook example requires the ipyleaflet plotting backend. Folium is not supported.
In [2]:
Copied!
from leafmap import leafmap
from leafmap import leafmap
Create an interactive map.
In [3]:
Copied!
m = leafmap.Map()
m = leafmap.Map()
The URL to the vector tile.
In [4]:
Copied!
url = 'https://tile.nextzen.org/tilezen/vector/v1/512/all/{z}/{x}/{y}.mvt?api_key=gCZXZglvRQa6sB2z7JzL1w'
url = 'https://tile.nextzen.org/tilezen/vector/v1/512/all/{z}/{x}/{y}.mvt?api_key=gCZXZglvRQa6sB2z7JzL1w'
Attribution of the vector tile.
In [5]:
Copied!
attribution = "Nextzen"
attribution = "Nextzen"
One can customize the vector tile layer style if needed. More info can be found at https://ipyleaflet.readthedocs.io/en/latest/api_reference/vector_tile.html
In [6]:
Copied!
vector_tile_layer_styles = {}
vector_tile_layer_styles = {}
Add the vector tile layer to the map.
In [7]:
Copied!
m.add_vector_tile_layer(url, attribution, vector_tile_layer_styles)
m
m.add_vector_tile_layer(url, attribution, vector_tile_layer_styles)
m
Last update:
2022-03-14