TomSchimansky / TkinterMapView

A python Tkinter widget to display tile based maps like OpenStreetMap or Google Satellite Images.
Creative Commons Zero v1.0 Universal
615 stars 86 forks source link

Tiled map not showing overylay #104

Closed SurafelTesfaye closed 10 months ago

SurafelTesfaye commented 1 year ago

Hi, I having been using TkinterMapView for a while and it works like charm. I just want to ask this question --

I am working on a project that needs an overlay map. I have seen the example code and I created a tiled map and hosted it on a server. When I open my map on a browser ti works fine. However when I am using my the tiled map inside my code it doesnt show the overlay map. I have tried changing the zoom level but it doesnt help at all. The map is just gray

these are the two maps hosted on github pages --

https://surafeltesfaye.github.io/vfr_1/ https://surafeltesfaye.github.io/sectional1_LA/

I am happy to provide any details too and any kind of help is appreciated

Thanks

SurafelTesfaye commented 1 year ago

Here is my function to toggle the overlay;

it works fine with the basemap the issue is with the overlay

def change_map(self):
    if self.radio_var.get() == 1:
        self.map_widget.set_tile_server("https://a.tile.openstreetmap.org/{z}/{x}/{y}.png", max_zoom=22)
        self.map_widget.set_overlay_tile_server("https://surafeltesfaye.github.io/vfr_1/{z}/{x}/{y}.png")
    elif self.radio_var.get() == 2:
       self.map_widget.set_tile_server("https://mt0.google.com/vt/lyrs=m&hl=en&x={x}&y={y}&z={z}&s=Ga", max_zoom=22)
hanselmoovita commented 11 months ago

May I request if you can provide the functions for:

self.map_widget.set_tile_server self.map_widget.set_overlay_tile_server Any "init" dependencies

I'm working on a similar project as you do, except that I'm using slippy map tiles of map loaded from local PC.....

SurafelTesfaye commented 10 months ago

Hi @hanselmoovita I was not able to get help so I had to use leaflet with flask its much better and well documented