Skip to content

Conversation

@giswqs
Copy link
Member

@giswqs giswqs commented Nov 20, 2023

This PR adds the tooltip option for PMTiles. Fix #571

Adapted from jtmiclat/folium-pmtiles#13. Credits to jtmiclat.

import leafmap 

style = {
    "version": 8,
    "sources": {
        "example_source": {
            "type": "vector",
            "url": "pmtiles://" + url,
            "attribution": 'PMTiles',
        }
    },
    "layers": [
        {
            "id": "buildings",
            "source": "example_source",
            "source-layer": "landuse",
            "type": "fill",
            "paint": {"fill-color": "steelblue"},
        },
        {
            "id": "roads",
            "source": "example_source",
            "source-layer": "roads",
            "type": "line",
            "paint": {"line-color": "black"},
        },
    ],
}

leafmap.view_pmtiles(
    url, 
    name='PMTiles', 
    style=style, 
    zoom_to_layer=True, 
    tooltip=True, 
    map_args={'height': 600}
)

image

@jinha This might be of interest to you.

@github-actions
Copy link

@github-actions github-actions bot temporarily deployed to pull request November 20, 2023 22:08 Inactive
@giswqs giswqs merged commit 865fd37 into master Nov 20, 2023
@giswqs giswqs deleted the pmtiles branch November 20, 2023 22:16
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
giswqs added a commit that referenced this pull request Dec 6, 2025
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.

Popups for PMTiles Layers

2 participants