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 – creating a loader function

Creating a loader function isn't as hard as it might sound, let's walk through a concrete example that loads features from a WFS server. In this example, we will be using the popular jQuery library to help us load data. If you are not familiar with jQuery, see http://jquery.com for more information.

  1. Start by creating a new HTML page using the same structure we've used before. We'll start from this for each of the vector source examples. Note the addition of a <script> tag to load jQuery:
    <!doctype html> <html> <head> <title>vector Examples</title> <link rel="stylesheet" href="../assets/ol3/ol.css" type="text/css" /> <link rel="stylesheet" href="../assets/css/samples.css" type="text/css" /> </head> <body> ...

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