We can use OpenLayer's icon style to display an image, we just need the URL to the photo. We can use the JavaScript console to take a quick look at what data is associated with each feature, so that we can figure out where the URL is stored. With the previous example running in your browser, open the JavaScript console and type the following commands:
var feature = flickrSource.getFeatures()[0]; feature.getProperties();
This gets the first feature from the vector source and displays its properties, which should show you something like the following screenshot:
Well, that wasn't as useful as we'd hoped. The URL to the photo is not there, so what's happening? It turns out that the KML format includes style information and OpenLayers is smart enough to extract that information and automatically generate style functions for the features. Unfortunately, OpenLayers is also hiding all the extra information about the feature that we need. We need a different...