pythontkintertkintermapview

TKintermapview image size adjustment


I'm working on a Python code that displays the position of a train on a map in real time.

In order to do so I use tkinter and tkintermapview, I can display the map, the icon, different overlay no problem.

The issue is that I can't figure out how to adjust the size of the images and overlay to the zoom

I searched for how to get the zoom value in order to link it to the image size, so I tried to read some documentation, asked chatGPT and it keep giving me false info like use map_widget.get_zoom() which is not a thing:

"AttributeError: 'TkinterMapView' object has no attribute 'get_zoom'"


Solution

  • source code shows that TkinterMapView has self.zoom so use map_widget.zoom

    print( map_widget.zoom )