I have consulted the post on GIS stack exchange and read the docs, however I cannot find a solution that works.
The idea is to put a .png image of a site report within the maplayer for web output. The points show up fine but the popup image does not.
The column that holds the file name for the image has been formatted in the following ways (plus many more varieties):
- "filename.png" #<---------- images in the same folder as the project
"images/filename.png"#<-------- images in an images "folder" in the samefolder as the project
"../images/filename.png"
Mulitple variations on this have been tried by loading the different methods in the attribute table and having as pop up value(output from most recent try):
The field attributes are set to photo:
I have taken a look at the output generated by the script in the Data folder that holds the css, js and other files associated with the webpage export(in my case these files go to 'users>me>AppData>Local>Temp>qgis2web>folder'
The data is in a dictionary of dicts I put the first one here:
{ "type": "Feature", "properties": { "field_1": "Aare_Bern_CaveltiN", "Density": 1.61, "lon_x1": 7.4733190977753496, "lat_y1": 46.923578788505381, "City": "Muri bei Bern", "File": "Aare_Bern_CaveltiN.png", "FileName": "\"\\images\\Aare_Bern_CaveltiN.png\"", "Source": "<img source =\"\\images\\Aare_Bern_CaveltiN.png\" width=\"400\" height=\"600΅ \/>", "File2": "\"Aare_Bern_CaveltiN.png\"", "FileNameThree": "\"images\\Aare_Bern_CaveltiN.png\"", "FileNameFour": "<img source =\"Aare_Bern_CaveltiN.png\" width=\"400\" height=\"600΅ \/>", "FileNameFive": "\"<img source =\"\\images\\Aare_Bern_CaveltiN.png\" width=\"400\" height=\"600΅ \/>\"" }, "geometry": { "type": "Point", "coordinates": [ 7.47331909777535, 46.923578788505381 ] } }
I cannot figure out exactly what needs to be passed on to the plugin for this to work. Nor are the examples I have found clearing this up.
Is it an absolute path or relative path? Path to where? Although the project is one folder the output goes to temp.
Or maybe even more precise: When I call the column value from python (before exporting csv for the map layer) like this: print(df['filename'][0])
where df=layer data and filename = column that holds the files.
Should I see this: "filename.png" (in quotes) or this: filename.png (no quotes)?