API - use same tile server as Client to generate staticmap - fix #83

This commit is contained in:
Sam
2021-07-14 20:20:48 +02:00
parent bd7783ca96
commit 3ead237e5c
4 changed files with 53 additions and 14 deletions

View File

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