Now that we've got that sorted out, we should be able to create a thumbnail style for our photos reasonably easily:
var cache = {};flickrStyle function and replace it with the following:function flickrStyle(feature) {
var url = feature.get('url');
if (!cache[url]) {
cache[url] = new ol.style.Style({
image: new ol.style.Icon({
scale: 0.10,
src: url
})
});
}
return [cache[url]];
}We just updated our style function to return a more suitable style. In the first step, we created an object to act as a cache for our styles, so that we don't create them multiple times (that's inefficient!), and in the second, we updated our style function to create a new icon style for the feature, if one isn't in the cache already. Our icon style takes care of scaling the image to 10 percent of its original size so that it's not too big for the map area.