Though all the examples on the Leaflet.Photo plugin page involve getting data via an API, all you really need is an array of objects with the latitude, longitude and URL(s) for each image. For example:
var photos = [{
"lat": 34.04555452,
"lng": -118.3001509,
"thumbnail": "http://www.mydomain.com/photo1_thumb.jpg",
"url": "http://www.mydomain.com/photo1.jpg",
"name": "My First Photo"
}, {
"lat": 34.0522683,
"lng": -118.2698607,
"thumbnail": "http://www.mydomain.com/photo2_thumb.jpg",
"url": "http://www.mydomain.com/photo2.jpg",
"name": "My Second Photo"
}, {
"lat": 34.06281904,
"lng": -118.2809651,
"thumbnail": "http://www.mydomain.com/photo3_thumb.jpg",
"url": "http://www.mydomain.com/photo3.jpg",
"name": "My Third Photo"
}]
var photoLayer = L.photo.cluster().on('click', function(evt) {
var photo = evt.layer.photo;
var template = '<img src="{url}" /></a><p>{name}</p>';
evt.layer.bindPopup(L.Util.template(template, photo)).openPopup();
});
photoLayer.add(photos).addTo(map);
The lat
, lng
and thumbnail
properties are required, since these are what the plugin uses to create the marker, but you can add any other properties you like, such as the full-size image URL, caption text, styling parameters, etc. The simplest way to use photos from your own domain is just to store this array of objects in your script, or as a separate file on your server, which you could load either with the page or later via AJAX.
Here's an example fiddle with the objects included in the script:
http://jsfiddle.net/nathansnider/q8ar6wu9/
Best Answer
This script will take as an input a folder of images, and a shapefile. The shapefile needs to be attributed with the image name, and the lat and long of the point. The script will write to the EXIF tag of the image the lat and long from the attribute table. After execution the image location will be the same as the point location. The script requires the pyexiv2 library and therefore, only works with Python 2.7 and ArcGIS 10.x. I will port it to Python 3 if anyone asks. Make a backup of your data before you run this code!
And this should work for Python 3 but the Python interpreter is locked in a walled garden in ArcGIS Pro. ESRI may have blocked the ability to add the pyexiv2 library. In that case you may need to make a clone.