Skip to content

Commit

Permalink
Merge pull request #3142 from Geoportail-Luxembourg/GSLUX-679_fix_reg…
Browse files Browse the repository at this point in the history
…istered_style_dl

Gslux 679 fix registered style dl
  • Loading branch information
mki-c2c authored May 23, 2024
2 parents c862c47 + ffbd6f5 commit cf70dbf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion geoportal/geoportailv3_geoportal/views/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit cf70dbf

Please sign in to comment.