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 additional parameters for folium layer #5

Merged
merged 3 commits into from
Sep 22, 2023

Conversation

giswqs
Copy link
Contributor

@giswqs giswqs commented Sep 20, 2023

I am excited for find this package! Nice work. This PR adds kwargs to the __init__ so that it can accept other folium layer paramters, such as overlay. Putting overlay in options has not effect.

BTW, the PMTiles has a large gray background on the top of other layers. Can it be made transprant?

import folium
from folium_pmtiles.vector import PMTilesVectorBaseMap

m = folium.Map(location=[43.7798, 11.24148], zoom_start=12)
pmtiles_layer = PMTilesVectorBaseMap(
    "https://pmtiles.jtmiclat.me/protomaps(vector)ODbL_firenze.pmtiles",
    "PMtiles",
    options={
        "attribution": """<a href="https://protomaps.com">Protomaps</a> © <a href="https://openstreetmap.org/copyright">OpenStreetMap</a>'"""
    },
    overlay=True,
)
m.add_child(pmtiles_layer)
folium.LayerControl().add_to(m)
m

image

Copy link
Owner

@jtmiclat jtmiclat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Pushed a small commit that runs black formatter on the files.

@jtmiclat jtmiclat merged commit c1db23c into jtmiclat:master Sep 22, 2023
@giswqs giswqs deleted the params branch September 22, 2023 14:28
@jtmiclat
Copy link
Owner

@giswqs Published 0.2.1 which contains your changes https://pypi.org/project/folium-pmtiles/0.2.1/ . Thanks for your PR!

@giswqs
Copy link
Contributor Author

giswqs commented Sep 22, 2023

Awesome! Thank you. It would be a game changer if we can also add support for ipyleaflet. Your contributions would be greatly appreciated.
jupyter-widgets/ipyleaflet#1138

@jtmiclat
Copy link
Owner

I'm not to familiar with ipyleaflet but I can take a look in the next couple of weeks!

@giswqs
Copy link
Contributor Author

giswqs commented Sep 22, 2023

That would be great. Thank you.

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.

2 participants