Hi all,
62 and trying to learn some python coding.
Currently trying to play with tkintermapview for a flight simulator jobs display feature using data from an online flight simulator addon called FS Economy. This map resides in a map class I created and display in a tkinter notebook tab/page. I pull jobs from there site and show the job airports and job paths on the map. Because there are different types of jobs, I create all jobs on the map at once and set there state to hidden. I have three buttons , one for each type of job. When you select a type, a function in the map page is called that loops through each map path and airport which resets the state according to a job type variable set by clicking the buttons. This is working really well. Selecting the different buttons changes the airports and path state almost instantly. But like all things…There’s a butt…
I noticed that if an airport was outside the map view area, it did not draw the map image(icon), so that if you zoomed out, the path was there but not the airport image. If I toggle the button, it instantly redraws and the airports are there. (not sure if redraw is the right term, basically resetting the state for each item)
In the notebook class, I have a 1 second loop running in a thread that works with a message function to remove messages every ten seconds. I decided to try and use this loop to check the map zoom status and if the zoom level changed, I would call the same function that the buttons call to retrigger the airports and path.
For some reason I cannot figure out, this does what I want but the results are slow. Pressing the button is instantaneous, calling the function from the loop takes 2 to 3 seconds, (you can literally watch the airports repopulate on the map) each time the zoom level changes.
Can anyone explain why I get such a different result from the loop calling the function?
Thanks
Eldrithal