Metadata-Version: 2.1
Name: folium-pmtiles
Version: 0.4.0
Summary: Folium Plugin to Support PMTiles
Home-page: https://github.com/jtmiclat/folium-pmtiles
License: MIT
Author: Jt Miclat
Author-email: jtmiclat@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Dist: folium (>=0.14.0,<0.15.0)
Project-URL: Repository, https://github.com/jtmiclat/folium-pmtiles
Description-Content-Type: text/markdown

# 🗺️ Folium Plugin to support PMTiles

## Basic usage

### Installation

```
pip install folium folium-pmtiles
```

### Usage

The recommend way is to use `PMTilesVector`. This converts a simple mapbox style to a appropriate leaflet/protomaps styles.
If you need more complex styling, you can use `PMTilesMapLibreLayer`

A simple folium example is as follows:

```python
import folium

from folium_pmtiles.vector import PMTilesVector

m = folium.Map(location=[43.7798, 11.24148], zoom_start=12)
pmtiles_layer = PMTilesVector(
    "https://pmtiles.jtmiclat.me/protomaps(vector)ODbL_firenze.pmtiles",
    "folium_layer_name",
    style={
        "layers": [
            {
                "source-layer": "landuse",
                "type": "fill",
                "paint": {"fill-color": "steelblue"},
            },
            {
                "source-layer": "roads",
                "type": "line",
                "paint": {"line-color": "black"},
            },
        ],
    },
    options={
        "attribution": """<a href="https://protomaps.com">Protomaps</a> © <a href="https://openstreetmap.org/copyright">OpenStreetMap</a>'"""
    },
)
m.add_child(pmtiles_layer)
```

See [example/](example/) to see more examples and live demos via google collab or github.dev.

## Dev Setup

```
poetry install --with dev
poetry run pre-commit install
```

