Openlayers ol-ext

Cool extensions for OpenLayers (ol > 5.3).

ol-ext is a set of extensions, controls, interactions to use with Openlayers.

Quick start

Install ol-ext

Install the npm ol-ext package and link to the node_modules directory:

npm install ol-ext

See Openlayers quickstart to create an Openlayers project.

In the main.js file add ol-ext classes:

// Import the layer switcher control
import LayerSwitcher from "ol-ext/control/LayerSwitcher"

const switcher = new LayerSwitcher;
// You can add it to the map

Remember to import the style in your style.css:

@import "node_modules/ol/ol.css";
@import "node_modules/ol-ext/dist/ol-ext.css";

body {
  margin: 0;
  height: 100%;
/* ... */

Check out online examples.

The example page is the best way to have a quick look at all the library.

ol extension


Please use the GitHub issue tracker for all bugs and feature requests. Before creating a new issue, do a quick search to see if the problem has been reported already.

Building the documentation:

The documentation use gulp-jsdoc3 to create the doc.

  1. install the gulp-jsdoc3 project at the root directory:
npm install gulp-jsdoc3
  1. then run the gulp command to create the doc in the doc/doc-pages directory:
gulp doc


ol-ext is licenced under the French Opensource BSD compatible CeCILL-B FREE SOFTWARE LICENSE.
(c) 2016-2019 - Jean-Marc Viglino

Full text license in English
Full text license in French