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

Layers in OpenLayers 3

OpenLayers is a JavaScript library, and as discussed earlier is built using Object Oriented Programming (OOP). When we want to actually create a layer, we will create (or instantiate) an object from an ol.layer.Layer subclass.

OpenLayers has many different ol.layer classes. The layer types are only for different kinds of data (tiles, images, and vector). Using an attached ol.source.* will allow you to connect to a different type of map server 'back end.' Each layer object is independent of other layer objects; so, doing things to one layer won't necessarily affect the other.

Note

How many layers can I have?

The safest maximum amount of layers you can have on a map at one time depends largely on the user's machine (that is, ...

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