TkinterMapView
TkinterMapView copied to clipboard
Get other Tile Servers and Overlay Tile Servers to work with Registration key input to function if needed
https://wiki.openstreetmap.org/wiki/Tile_servers
It would be EXTREMELY useful if you could get many of these additional Tile Servers to work and Overlay Tile Servers. Also if you could add a function to enter in whatever registration key or whatnot in order to use these Tile Servers that require registration would be absolutely amazing.
Also if there was a way to enable functionality to add the legend that these overlay tile servers provide, would be extremely useful.
Which tile server is not working for you? For the ones that are not free to use, I don't know how the registration works, I think that depends on the provider. But for some providers you just pass the registration key in the url.
This is my code of getting the tile image from the url:
url = self.tile_server.replace("{x}", str(x)).replace("{y}", str(y)).replace("{z}", str(zoom))
image = Image.open(requests.get(url, stream=True).raw)
tkintermapview/map_widget.py line 419
You can download the repository and try to modify the requests.get method and pass some sort of key you need for you're provider. But I don't know if I can build a universal method of passing registration that works for all providers.
And how do I get a legend from a specific tile server? Do all tile servers provide a legend?
wow that's the fastest response i've ever seen on github! I'm very interested in this stuff, so maybe i'll try to help get some of it to work here.
Tile servers you have listed that do not work for me are : They show some sort of comment error self.map_widget.set_tile_server("https://tiles.wmflabs.org/hikebike/{z}/{x}/{y}.png") # detailed hiking self.map_widget.set_tile_server("https://tiles.wmflabs.org/osm-no-labels/{z}/{x}/{y}.png") # no labels
Legend: Yea I have no idea how to get that to work or import them but i'll try to look into it, would be cool.
I see, so i'll try registering for one of them and then convert their tile server they give me with that converter you showed.
Another question ... do you think it's possible to get the tile server from google earth to work? https://gis.stackexchange.com/questions/190850/tile-server-overlay-in-google-earth
Do you know how I could create an overlay map tiles to go on top of the google satellite one?
I think you're correct as well the auth goes at the end. https://docs.mapbox.com/data/tilesets/guides/vector-tiles-introduction/
getting mapbox to work would open this application to a ton of elements and easy customization.
More Info on how to customize mapbox stuff tile overlay: https://www.e-education.psu.edu/geog865/node/321
More on creating overlay on top of google map: https://gist.github.com/donmccurdy/1d3998a37c73e9435b5503e5f37457be
I will look into this, the two tile servers that don't work seem to be out of order I think.
Tool for exporting offline maps: https://www.bluemarblegeo.com/knowledgebase/global-mapper-23/Formats/Google_Maps_Tiles.htm
I will look into this, the two tile servers that don't work seem to be out of order I think.
Thanks man, yea overall I think what i'm looking at is expanding your program here to do more. A lot of it is a pipedream. I'm looking to basically import all my own symbols and provide battlelines and all that stuff for DCS (digital combat simulator) I just need to overlay stuff on top of Google Satellite one.
also I found these just by going through the entire alphabet. I think you can just use a radio button to switch between one map without labels and one map with labels:
#map_widget.set_tile_server("https://mt0.google.com/vt/lyrs=t&hl=en&x={x}&y={y}&z={z}&s=Ga", max_zoom=22) # google night #map_widget.set_tile_server("https://mt0.google.com/vt/lyrs=p&hl=en&x={x}&y={y}&z={z}&s=Ga", max_zoom=22) # google terrain, labels #map_widget.set_tile_server("https://mt0.google.com/vt/lyrs=r&hl=en&x={x}&y={y}&z={z}&s=Ga", max_zoom=22) # google broad map, labels #map_widget.set_tile_server("https://mt0.google.com/vt/lyrs=y&hl=en&x={x}&y={y}&z={z}&s=Ga", max_zoom=22) # google satellite, labels
#map_widget.set_overlay_tile_server("https://mt0.google.com/vt/lyrs=h&hl=en&x={x}&y={y}&z={z}&s=Ga") # google label overlay
I found an absolute gold mine as well !
https://github.com/geopandas/xyzservices/blob/main/provider_sources/leaflet-providers-parsed.json
TONS of tile servers ... and you can use some of them as overlay instead as well