O'Reilly logo

OpenLayers 2.10 by Erik Hazzard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

  1. 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 as example_1.html.
  2. Now let's create the map. We won't be using a WMS layer this time—instead, we'll just be using a Google ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required