Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ipyleaflet support for PMTiles #575

Merged
merged 1 commit into from
Oct 16, 2023
Merged

Add ipyleaflet support for PMTiles #575

merged 1 commit into from
Oct 16, 2023

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Oct 16, 2023

This feature is not officially supported by ipyleaflet yet. Wait until this PR jupyter-widgets/ipyleaflet#1138 is merged. For now, install it with the following command:

pip install git+https://github.com/giswqs/ipyleaflet.git@pmtiles
from ipyleaflet import Map, basemaps, PMTilesLayer

m = Map(center=[52.963529, 4.776306], zoom=7, basemap=basemaps.CartoDB.DarkMatter, scroll_wheel_zoom=True)
m.layout.height = '600px'

vl = PMTilesLayer(url="https://storage.googleapis.com/ahp-research/overture/pmtiles/overture.pmtiles", 
    style = {
        "layers": [
            {
                "id": "admins",
                "source": "example_source",
                "source-layer": "admins",
                "type": "fill",
                "paint": {"fill-color": "#BDD3C7", "fill-opacity": 0.1},
            },
            {
                "id": "buildings",
                "source": "example_source",
                "source-layer": "buildings",
                "type": "fill",
                "paint": {"fill-color": "#FFFFB3", "fill-opacity": 0.5},
            },
            {
                "id": "places",
                "source": "example_source",
                "source-layer": "places",
                "type": "fill",
                "paint": {"fill-color": "#BEBADA", "fill-opacity": 0.5},
            },
            {
                "id": "roads",
                "source": "example_source",
                "source-layer": "roads",
                "type": "line",
                "paint": {"line-color": "#FB8072"},
            },
        ],
    })
m.add(vl)
m
Peek.2023-10-15.00-10.mp4

@github-actions
Copy link

@github-actions github-actions bot temporarily deployed to pull request October 16, 2023 13:12 Inactive
@giswqs giswqs merged commit 5d9cd0f into master Oct 16, 2023
12 checks passed
@giswqs giswqs deleted the pmtiles branch October 16, 2023 14:01
sthagen pushed a commit to sthagen/giswqs-leafmap that referenced this pull request Jul 10, 2024
kuzja111 pushed a commit to kuzja111/leafmap that referenced this pull request Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant