Skip to content

Commit

Permalink
Google als Tileserver auswählbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian committed Dec 22, 2020
1 parent f5913f6 commit 48e6e8e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion help.html
Expand Up @@ -130,7 +130,7 @@ <h3> Einstellungen </h3>
Dieser Ordner kann im Laufe der Zeit eine gro&szlig;e Menge an Dateien beinhalten.</p>
<p>x,y,z - gibt den Ort an, der sich zu Anfang der Darstellung im Kartenmittelpunkt befindet.</p>
<p>adjustment - Interne Einstellung sollte normalerweise nicht ver&auml;ndert werden.</p>
<p>tileserver - Hier kann man zwischen thunderforest und openstreetmap w&auml;hlen.</p>
<p>tileserver - Hier kann man zwischen thunderforest, openstreetmap und google w&auml;hlen.</p>
<p>apiKey - Um Kacheln von Thunderforest herunterzuladen ben&ouml;tigt man einen apikey. Der per Default eingetragene apikey
ist nur ein Test apikey. Das bedeutet mit ihm k&ouml;nnen maximal 150000 Kachel pro Monat heruntergeladen werden.
Wenn Sie gefallen an pywv finden und Sie diesen h&auml;ufig nutzen, bitte ich Sie sich einen eigenen apikey zu besorgen.</p>
Expand Down
2 changes: 1 addition & 1 deletion run.ini
Expand Up @@ -6,6 +6,6 @@ x=21801.986=
y=34084.261=
zoom=16=
adjustment=9=
tileserver=openstreetmap=
tileserver=google= oder openstreetmap oder thunderforest
apiKey=2f5cfc26c3f247338c829d8e9d1e637e=

4 changes: 3 additions & 1 deletion tile.py
Expand Up @@ -303,10 +303,12 @@ def downloadOSMData(x,y,zoom,config):
f.write(inhalt)

def downloadTile(x,y,zoom,config):
""" Lese eine Kachel von Thunderforest oder OpenStreetMap und speichere diese im Tile Cache Directory """
""" Lese eine Kachel von Thunderforest oder OpenStreetMap oder Google und speichere diese im Tile Cache Directory """
sUrl = "https://tile.thunderforest.com/cycle/"+zoom+"/"+y+"/"+x+".png?apikey="+config["apiKey"]
if config["tileserver"] == "openstreetmap":
sUrl = "https://a.tile.openstreetmap.de/"+zoom+"/"+y+"/"+x+".png"
if config["tileserver"] == "google":
sUrl = "https://mt1.google.com/vt/lyrs=y&x="+y+"&y="+x+"&z="+zoom
rc = request.urlopen(sUrl)
if not rc.code == 200: print("downloadTile: Http Response Code: ", rc.code)
inhalt = rc.read()
Expand Down

0 comments on commit 48e6e8e

Please sign in to comment.