Time for Action – adding data to your map
Time to get back to coding. Now that we have the data from Flickr from the previous example, let's add it to our map. We'll create a Google Maps base layer and then a vector layer filled with the Flickr data on top of it.
First, we need to make sure the
flickr_data.kml
file is in the same directory that we'll be creating our map in. Save the file in your server's document root folder, which may be something like (with Xampp on windows)c:/xampp/htdocs
or on OSX (with Xammp, http://www.apachefriends.org/en/xampp-macosx.html) in/Applications/XAMPP
, or on Linux:/var/www/
. We'll refer to it asexample_1.html
.Now let's create the map. We won't be using a WMS layer this time—instead, we'll just be using a Google base map and place our vector layer on top of it. Make sure to first add the reference to the Google Maps API in the
<head>
section:<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
Now, create and add a...