Always export obsMapSource in config.json from api

This commit is contained in:
Paul Bienkowski 2021-11-25 00:12:24 +01:00
parent fe62af9d97
commit 2b9bdb6ff1

View file

@ -162,10 +162,7 @@ if INDEX_HTML and exists(INDEX_HTML):
**req.app.config.FRONTEND_CONFIG, **req.app.config.FRONTEND_CONFIG,
"apiUrl": f"{scheme}://{req.host}{base_path}api", "apiUrl": f"{scheme}://{req.host}{base_path}api",
"loginUrl": f"{scheme}://{req.host}{base_path}login", "loginUrl": f"{scheme}://{req.host}{base_path}login",
} "obsMapSource": {
print(req.app.config)
if req.app.config.get("TILES_FILE"):
result["obsMapSource"] = {
"type": "vector", "type": "vector",
"tiles": [ "tiles": [
req.app.url_for("tiles", zoom="000", x="111", y="222.pbf") req.app.url_for("tiles", zoom="000", x="111", y="222.pbf")
@ -176,6 +173,8 @@ if INDEX_HTML and exists(INDEX_HTML):
"minzoom": 12, "minzoom": 12,
"maxzoom": 14, "maxzoom": 14,
} }
}
return json_response(result) return json_response(result)
@app.get("/<path:path>") @app.get("/<path:path>")