
Product
Socket Now Protects the Chrome Extension Ecosystem
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
VectorGrid.protobuf plugin for Folium
Report Bug
·
Request Feature
Now part of folium plugins as of v0.13.0.
This library fills a hole in foliums plugin eco-system. Wrapping Leaflet.VectorGrid into a folium plugin, users can now add vector tile layers (e.g. Mapbox, OpenMapTiles) to their folium maps.
Install Poetry.
poetry add git+https://github.com/iwpnd/folium-vectorgrid.git
pip install folium-vectorgrid
git clone https://github.com/iwpnd/folium-vectorgrid.git
poetry install
poe test # or poetry run pytest .
from folium_vectorgrid import VectorGridProtobuf
import folium
url = "https://free-{s}.tilehosting.com/data/v3/{z}/{x}/{y}.pbf?token={token}"
m = folium.Map()
options = {
"subdomain": "my_subdomain",
"token": "my_token",
"vectorTileLayerStyles": {
"my_layer":{
"fill": True,
"weight": 1,
"fillColor": 'green',
"color": 'black',
"fillOpacity":0.6,
"opacity":0.6
},
}
}
vc = VectorGridProtobuf(url, "folium_layer_name", options)
m.add_child(vc)
m
Or with conditional styling
import folium
from folium_vectorgrid import VectorGridProtobuf
m = folium.Map()
url = "https://free-{s}.tilehosting.com/data/v3/{z}/{x}/{y}.pbf?token={token}"
options = '''{
"subdomain": "tilehosting",
"token": "af6P2G9dztAt1F75x7KYt0Hx2DJR052G",
"vectorTileLayerStyles": {
"my_layer": function(f) {
if (f.type === 'parks') {
return {
"fill": true,
"weight": 1,
"fillColor": 'green',
"color": 'black',
"fillOpacity":0.6,
"opacity":0.6
};
}
if (f.type === 'water') {
return {
"fill": true,
"weight": 1,
"fillColor": 'purple',
"color": 'black',
"fillOpacity":0.6,
"opacity":0.6
};
}
}
}
}'''
VectorGridProtobuf(url,"layer_name",options).add_to(m)
m
Distributed under the MIT License. See LICENSE
for more information.
Benjamin Ramser - @imwithpanda - ahoi@iwpnd.pw
Project Link: https://github.com/iwpnd/folium-vector
FAQs
VectorGrid plugin for folium
We found that folium-vectorgrid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.