Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Add mapbox tiles api support #170

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ def url_mapping(server: str, tile_x: int, tile_y: int, level_of_detail: int) ->

if "khm" in server:
return f"https://{server}/kh/v=908?x={tile_x}&y={tile_y}&z={level_of_detail}"


if "mapbox" in server:
return f"https://{server}/v4/mapbox.satellite/{level_of_detail}/{tile_x}/{tile_y}.jpg?sku=cky8e1hd40jus15nzunvf7q4u&access_token=pk.eyJ1IjoiaDB3YXJkIiwiYSI6ImNreG5td3UxajFwNW4ybnBudWtvdmw4bjEifQ.mbmam48LS8GaSWYXUOrNUQ"

if "arcgisonline" in server:
return f"https://{server}/ArcGIS/rest/services/World_Imagery/MapServer/tile/{level_of_detail}/{tile_y}/{tile_x}"

@app.route("/tiles/akh<path>")
def tiles(path: str) -> Response:
Expand Down
2 changes: 1 addition & 1 deletion src/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def proxy_url(self, proxy_url: str) -> None:

@property
def google_servers(self) -> list[str]:
return ["khm.google.com", 'mt.google.com']
return ['mt.google.com','khm.google.com',"api.mapbox.com","services.arcgisonline.com"]

@property
def google_server(self):
Expand Down