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 tooltip for PMTiles #613

Merged
merged 1 commit into from
Nov 20, 2023
Merged

Add tooltip for PMTiles #613

merged 1 commit into from
Nov 20, 2023

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.

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
12 checks passed
@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
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
1 participant