API - allow keeping default tile server for static map - #83

This commit is contained in:
Sam
2021-07-16 19:17:17 +02:00
parent cbcd67b3a1
commit 3c4718cc27
5 changed files with 47 additions and 7 deletions

View File

@ -265,14 +265,11 @@ def generate_map(map_filepath: str, map_data: List) -> None:
"""
Generate and save map image from map data
"""
m = StaticMap(
400,
225,
10,
url_template=current_app.config['TILE_SERVER']['URL'].replace(
m = StaticMap(400, 225, 10)
if not current_app.config['TILE_SERVER']['DEFAULT_STATICMAP']:
m.url_template = current_app.config['TILE_SERVER']['URL'].replace(
'{s}.', ''
),
)
)
line = Line(map_data, '#3388FF', 4)
m.add_line(line)
image = m.render()