Is it possible to display locally saved images in Leaflet/Folium map popups?

878 views
Skip to first unread message

elliot.r...@gmail.com

unread,
Mar 20, 2017, 10:07:43 AM3/20/17
to Leaflet
Using python I have managed to extract the exref data (lat, long, etc) of photos into a pandas dataframe. I then generate a leaflet/folium map html file, which when opened in a browser, displays the georeferenced points where the photos were captured. Clicking each opens a popup displaying filename, as per the following:

for lat,lon,Filename in zip(df['Lat'],df['Lon'],df['Filename']):
  fg.add_child(folium.Marker(location[lat,lon],popup=Filename,icon=folium.Icon(color='red')))

However, what I would like to do is display the actual images in the popup. Is it possible to do this with locally stored images - perhaps by specifying the filepath+filename? Web searches have returned a number of solutions for using web-hosted images by referring to url's, but I would like to use this as a way to navigate through offline photos if possible.


Peter Thomson

unread,
Apr 27, 2018, 4:24:23 PM4/27/18
to Leaflet
I have also used Python to extract the date and time taken from photos with the location from a GPS track and display a marker on a leaflet map. Clicking the link in the marker launches the image in a div above the map rather than in the popup. I do this on my local system by using CherryPy to handle the interactivity.
I store all the GPS time / location points in a local SQLite database table and all the image Exif data in another table. This makes searching for images near a given location very easy.
With CherryPy you can do anything locally that you can do with a URL
Reply all
Reply to author
Forward
0 new messages