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

Tile Images not loading on Mac

Kromilan opened this issue · comments

First of all, thank you for developing this. It's exactly what I have been looking for and so far, it works great for me. On Windows and Linux. However, on Mac I don't see the map at all, instead I only see grey images. The code I used to test this on mac is /examples/map_view_demo.py from this repository.
I have also tried it with my app, which is running fine on windows and linux. There I discovered that it's only a problem with the display of the map. The marker displays as normal and all behaviour functions properly too. In my case specifically, when I click on the map, I get the coordinates of the location I clicked and the map focuses on that point. By the coordinates I get, I can tell that this is working nicely. The zoom buttons in the top left also display correctly. It's simply that instead of a map, I only see grey. I don't want to post the code here though, because as said, it also happens with /examples/map_view_demo.py from here.
Could it be a bug with the package?
Do I have to install anything else on Mac?
Do I have to code it differently when I want the map to display on Mac?
Thank you for your answer.

It's working fine for me and I am using a Mac. However I didn't use the example file like you mentioned but I just followed the example instruction on the readme on showing the map.

I also tried it with an own script, which also works on windows but not on mac.
Which Tkinter Version are you using, alexius?

Using tkinter.TkVersion, it shows 8.6. I am using python 3.

That is strange. I also have 8.6 installed.
Does somebody have an idea how I can determine where its going wrong?

Do you see any errors in the terminal where your app is running? Sometimes the tiles doesn't show because of connection problems when connecting to openstreetmap servers.

I will check on monday when I'm back in the office

When I run the example file in the terminal with python3 ./map_view_demo.py I get absolutely no terminal output.

I tried running the code again with my internet turned off on my Linux computer. On linux while the internet is turned off, I also get grey instead of the images, so it looks exactly the same like it does on the mac. So it's plausible that the mac somehow cannot reach the openstreetmap server. However, on Linux I also get an error message while it's not connected to the internet.
Status code Unknown from https://nominatim.openstreetmap.org/search: ERROR - HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Max retries exceeded with url: /search?q=NYC&format=jsonv2&addressdetails=1&limit=1 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fb9be65d9d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
But if there was an issue with the connection, I would expect a similar error message on Mac, but while it's connected to the internet, I get no error message, even though the map looks like it does when you aren't connected.
I can also ping nominatim.openstreetmap.org and openstreetmap.org just fine, so if there is a connection error, its exclusive to python.

Alright I will try the example

I tried the example code and it works fine with me.

Here is the screenshot:

Screenshot 2023-07-06 at 12 49 45 AM