I have made a leaflet map in python with Folium. I have used markers and popup pictures, and saved the results as a html-file. I then want to share this html with the rest of my team. I want to share the map (html-file) to the web with the help of Flask and Heroku.
The orignal map is created with folium, with the svg-files located at a folder called SVG: The folium markers are then linked to the svg-files in the this folder. html_svg=''
When I open the html-file in the browser, the markers is shown with correct SVG( se picture below) Map open in browser. SVG show up as markers as intended
This works fine. However, when i try to use it with Flask the SVG markers are not shown as seen in this picture: Map html in Flask
The following code is quite simple : app = Flask(name)
@app.route('/')
def render_the_map():
return render_template('map.html')
if __name__ == '__main__':
app.run(debug=True)
The SVG wont show up, and I get this error:
127.0.0.1 - - [02/Jun/2021 13:22:40] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [02/Jun/2021 13:22:52] "GET /SVG//tot-grey.svg HTTP/1.1" 404 -
127.0.0.1 - - [02/Jun/2021 13:22:52] "GET /SVG//tot.svg HTTP/1.1" 404 -
127.0.0.1 - - [02/Jun/2021 13:22:52] "GET /SVG//tot_cpt.svg HTTP/1.1" 404 -
I have tried to create a Static folder in the Flask app but give me the same result.
Anyone that got any tips on how to show SVG when uploading to the web with Flask ?