Conversation
There was a problem hiding this comment.
The code proposed here did not work for me. My solution was to disable verification with session.verify = False. That works on VPN, off VPN and doesn't care about proxy servers. However, I am not sure that is a desirable method. But in general this code should be using a single session since the performance increase is shocking because the session remains open. The map widget becomes BLAZING fast. So you should also use a session instead and then the requests.get calls should be replaced with session.get. My solution also did not require a change to the widget API. Here is some sample code:
In the class constructor add:
# Create a request session for map tile fetching and hold onto it
self.session = requests.Session()
self.session.trust_env=False
self.session.verify = False
In the destroy event add:
def destroy(self):
self.session.close()
When getting tiles modify:
image = Image.open(self.session.get(url, stream=True, headers={"User-Agent": "TkinterMapView"}).raw)
No description provided.