O'Reilly logo

OpenLayers 3 : Beginner's Guide by Erik Hazzard, Paul Spencer, Thomas Gratier

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

With the data from Flickr from the previous example, we have enough to get started. We'll create our simple application with an OSM base layer and a vector layer filled with the Flickr data on top of it:

  1. Create a new HTML page for the application in the sandbox folder. For the sake of this chapter, we'll refer to this as flickr.html. We'll use the familiar structure. Also, we'll start with ol-debug.js and optimize it later:
    <!doctype html> <html> <head> <title>Flickr App</title> <link rel="stylesheet" href="../assets/ol3/css/ol.css" type="text/css"> <link rel="stylesheet" href="../assets/css/samples.css" type="text/css"> </head> <body> <div id="map" class="map"></div> <script src="../assets/ol3/js/ol-debug.js></script> ...

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