diff --git a/geoportal/geoportailv3_geoportal/views/upload.py b/geoportal/geoportailv3_geoportal/views/upload.py index 566f2a9c2..e08aa4065 100644 --- a/geoportal/geoportailv3_geoportal/views/upload.py +++ b/geoportal/geoportailv3_geoportal/views/upload.py @@ -50,12 +50,20 @@ def get_vt_style(self): else: dir = "/tmp" - file_path = os.path.join(dir, '%s.json' %id) + file_path = os.path.join(dir, '%s.json' % id) if not os.path.exists(file_path): return HTTPBadRequest("File does not exist") with open(file_path) as json_file: data = json.load(json_file) + data["glyphs"] = "https://vectortiles.geoportail.lu/fonts/" + data["glyphs"].strip() + for source in data["sources"]: + data["sources"][source]["url"] = ( + data["sources"][source]["url"] + .replace("mbtiles://{", "https://vectortiles.geoportail.lu/data/") + .replace("}", ".json") + ) + return data @view_config(route_name='delete_vt_style', renderer='json')