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

attribution inclusion and support for folium maps #134

Open
naiyar5j opened this issue Apr 20, 2024 · 0 comments
Open

attribution inclusion and support for folium maps #134

naiyar5j opened this issue Apr 20, 2024 · 0 comments

Comments

@naiyar5j
Copy link

naiyar5j commented Apr 20, 2024

I am unable to add folium map inside tkinter widget but unable to do so. Basically I need to add attribution in the displayed maps which I am unable to do in default map tiles of tkintermapview. Can anyone guide plz.
``
import tkinter
import folium
import tkintermapview

root_tk = tkinter.Tk()
root_tk.geometry(f"{800}x{600}")

public_provider = folium.TileLayer(
tiles='https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
name="Esri World Imagery",
attr='Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
)
m = folium.Map(location=[30.7175, 76.7693], zoom_start=16, tiles=public_provider)

m.save("F:/py2exedata/map.html")

map_widget = tkintermapview.TkinterMapView(root_tk, corner_radius=0)
map_widget.set_tile_server("file:///F:/py2exedata/map.html", max_zoom=22)
map_widget.pack(side="top", fill="both", expand=True)

root_tk.mainloop()
``

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

No branches or pull requests

1 participant