{"id":15887926,"url":"https://github.com/iwpnd/folium-vectorgrid","last_synced_at":"2025-03-20T09:30:32.321Z","repository":{"id":40413280,"uuid":"462891072","full_name":"iwpnd/folium-vectorgrid","owner":"iwpnd","description":"L.VectorGrid.protobuf plugin for folium to allow vector tile layers to be added to your map.","archived":false,"fork":false,"pushed_at":"2025-03-12T08:29:12.000Z","size":541,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-15T15:39:39.415Z","etag":null,"topics":["folium","folium-python","mvt","vector-tiles"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iwpnd.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-23T20:13:53.000Z","updated_at":"2025-03-12T08:28:10.000Z","dependencies_parsed_at":"2023-02-16T17:31:49.238Z","dependency_job_id":"cd069b68-837c-4304-aaa9-7f3d731aa68b","html_url":"https://github.com/iwpnd/folium-vectorgrid","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwpnd%2Ffolium-vectorgrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwpnd%2Ffolium-vectorgrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwpnd%2Ffolium-vectorgrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwpnd%2Ffolium-vectorgrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iwpnd","download_url":"https://codeload.github.com/iwpnd/folium-vectorgrid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244585582,"owners_count":20476762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["folium","folium-python","mvt","vector-tiles"],"created_at":"2024-10-06T06:05:43.484Z","updated_at":"2025-03-20T09:30:31.983Z","avatar_url":"https://github.com/iwpnd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ch3 align=\"center\"\u003eFolium-VectorGrid\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    VectorGrid.protobuf plugin for Folium\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/iwpnd/folium-vector/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/iwpnd/folium-vector/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003e\u003ch2 style=\"display: inline-block\"\u003eTable of Contents\u003c/h2\u003e\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n\n## About The Project\n\nNow part of folium plugins as of [v0.13.0](https://github.com/python-visualization/folium/releases/tag/v0.13.0).\n\nThis library fills a hole in foliums plugin eco-system. Wrapping [Leaflet.VectorGrid](https://github.com/Leaflet/Leaflet.VectorGrid/) into a folium plugin, users can now add vector tile layers (e.g. Mapbox, OpenMapTiles) to their folium maps.\n\n### Built With\n\n-   [folium](https://github.com/python-visualization/folium)\n-   [Leaflet.VectorGrid](https://github.com/Leaflet/Leaflet.VectorGrid)\n\n\u003c!-- GETTING STARTED --\u003e\n\n## Getting Started\n\n### Prerequisite\n\nInstall [Poetry](https://python-poetry.org/docs/#installation).\n\n### Installation\n\n#### as dependency\n\n```\npoetry add git+https://github.com/iwpnd/folium-vectorgrid.git\n```\n\n```\npip install folium-vectorgrid\n```\n\n#### local development\n\n1. Clone and install\n    ```sh\n    git clone https://github.com/iwpnd/folium-vectorgrid.git\n    poetry install\n    ```\n2. Test it!\n    ```sh\n    poe test  # or poetry run pytest .\n    ```\n\n## Usage\n\n```python\nfrom folium_vectorgrid import VectorGridProtobuf\nimport folium\n\nurl = \"https://free-{s}.tilehosting.com/data/v3/{z}/{x}/{y}.pbf?token={token}\"\n\nm = folium.Map()\noptions = {\n    \"subdomain\": \"my_subdomain\",\n    \"token\": \"my_token\",\n    \"vectorTileLayerStyles\": {\n        \"my_layer\":{\n            \"fill\": True,\n            \"weight\": 1,\n            \"fillColor\": 'green',\n            \"color\": 'black',\n            \"fillOpacity\":0.6,\n            \"opacity\":0.6\n        },\n    }\n}\n\nvc = VectorGridProtobuf(url, \"folium_layer_name\", options)\nm.add_child(vc)\nm\n```\n\nOr with conditional styling\n\n```python\nimport folium\nfrom folium_vectorgrid import VectorGridProtobuf\n\nm = folium.Map()\nurl = \"https://free-{s}.tilehosting.com/data/v3/{z}/{x}/{y}.pbf?token={token}\"\n\noptions = '''{\n  \"subdomain\": \"tilehosting\",\n  \"token\": \"af6P2G9dztAt1F75x7KYt0Hx2DJR052G\",\n  \"vectorTileLayerStyles\": {\n    \"my_layer\": function(f) {\n      if (f.type === 'parks') {\n        return {\n          \"fill\": true,\n          \"weight\": 1,\n          \"fillColor\": 'green',\n          \"color\": 'black',\n          \"fillOpacity\":0.6,\n          \"opacity\":0.6\n        };\n      }\n\n      if (f.type === 'water') {\n        return {\n          \"fill\": true,\n          \"weight\": 1,\n          \"fillColor\": 'purple',\n          \"color\": 'black',\n          \"fillOpacity\":0.6,\n          \"opacity\":0.6\n        };\n      }\n    }\n  }\n}'''\n\nVectorGridProtobuf(url,\"layer_name\",options).add_to(m)\nm\n```\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n## Contact\n\nBenjamin Ramser - [@imwithpanda](https://twitter.com/imwithpanda) - ahoi@iwpnd.pw  \nProject Link: [https://github.com/iwpnd/folium-vector](https://github.com/iwpnd/folium-vectorgrid)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwpnd%2Ffolium-vectorgrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiwpnd%2Ffolium-vectorgrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwpnd%2Ffolium-vectorgrid/lists"}