TomSchimansky / TkinterMapView

A python Tkinter widget to display tile based maps like OpenStreetMap or Google Satellite Images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using offline tiles

dede-64 opened this issue · comments

Hello TomSchimansky, just starting with github. So i dont know if this is the right way......
Using your nice Widget with offline tiles, i just found an mistake in offline_loading.py
In procedure save_offline_tiles at updating the section-table in the database, you defines both, position_a and position_b in the
sql-query to point at position_b.

insert loading section in database

    db_cursor.execute(f"INSERT INTO sections (position_a, position_b, zoom_a, zoom_b, server) VALUES (?, ?, ?, ?, ?);",
                      (str(position_b), str(position_b), zoom_a, zoom_b, self.tile_server))
                      ----^

This, i think, has to be corrected to str(position_a), str(position_b)........
Furtheron, as i uses an tile-server on localhost (using python -m http.server) for creation of the offline database,
i have to set the tile-server of the map-widget when using the pre created database to the same tile-server string as for creating.
Otherwise the tiles in the database wont be found, cause of the init of tile-server-string to openstreetmap.

Sorry, gerade erst den Github Account erstellt. Danke auf jeden Fall für das Widget.