We mentioned earlier that the Flickr feed API supports more than just the KML format. It also supports a variety of RSS versions and JSON. That sounds promising; let's see if we can do better with the JSON version. Refer to the following steps:
First, replace the KML source,
flickrSource
, with a generic vector source. Reload the page and make sure that everything still works. You should see the base map but no features (we'll add them shortly):var flickrSource = new ol.source.Vector();
Next, we'll need to download the JSON version of our data by changing the format in the URL to
json
. Load the following URL in your browser and save the result to a new file calledflickr_data.json
:Have a look at this file in your text editor. Note that it starts with
jsonFlickrFeed
(
on the first line, this means that it is intended to be loaded as JSONP).