The first step in our application will require us to get data from Flickr. We'll request some data and save it locally.
bird as a tag. Open up this URL in your web browser, and you should be able to download it as a KML file from http://api.flickr.com/services/feeds/geo/?format=kml&tags=bird.flickr_data.kml and place it in your map directory.style tags—if we want, we can directly apply the styles from the file to our map (as we'll see soon).
We just downloaded the latest images in the KML format that contained a tag called bird. When you call the URL and pass in a tag, Flickr will return to you the latest images uploaded that have some geographic information associated with them. You may be wondering why we downloaded the KML file. If you remember from Chapter 5, Using Vector Layers, we can just create a vector layer and point to the Flickr URL, instead of a local file. Doing this adds complexity, however, because Flickr does not support Cross Origin Resource Sharing. When we download the KML file, we can access it directly. When we're in the development mode, we want to keep things as easy as possible to debug and fix. Once we get the code working to load the KML file we downloaded (in the next example), we don't need to worry about it anymore. When we develop our application and find bugs or errors with it, we don't have to spend much time tracking them down. We get the static file working, and we move on to the next task. We don't have to worry about the Flickr API going down, our requests not completing, or other things—we can focus on other parts. Once we get more parts of our application working, then we'll switch to using the dynamic URL. For now, let's use the static file.