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 – location, location, location

Let's add another resource to our page, so that we can access some nice icons. In the past, we might have done this by creating images for each of the icons we wanted and then adding <img> tags. We are going to try a different approach this time using an iconic font called Font Awesome. We'll discuss why after the example; for now, just follow these steps:

  1. Add the following <link> tag to the <head> tag of your HTML document, just after the link to ol.css:
    <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
  2. Now, add a new <style> section inside the <head> tag:
    <style>
    .marker {
      position: absolute;
      width: 24px;
      height: 24px;
      font-size: 24px;
    }
    </style>
  3. Next, we ...

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