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

Multiple styles

Remember, from the beginning of the chapter, that we said there were three different ways of specifying styles:

  • An instance of ol.style.Style
  • An array of ol.style.Style instances
  • A style function

We've looked at the first, using ol.style.Style, in detail. The second, an array of styles, is really not much different from the first, that is, you are still dealing with the basic styles. The difference is that when you provide an array of styles, features are rendered once for each style. This means each feature is rendered more than once, which can provide some interesting effects. An example is probably the best way of illustrating this.

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