Cool extensions for OpenLayers (ol). - For more information see the online API documentation.
More example for use in: webpack parcel Angular
If you like this, you may like ol-games .

Star Fork Issue Watch
Tweet @viglino Download

## Styles

Font style

Draw points using an iconic font (font Awesome) gives you scalable vector icons that can instantly be customized (form, size, color, drop shadow) using attributes..

style, vector, font, fontawesome, icon, maki

Photo style

The ol.style.Photo is an image style to show photos or images on a map. The photos are drawn in a box and can be anchored.

style, vector, photo

Statistic charts style

The ol.style.Chart is an image style to draw statistical graphics (bar, donut or pie charts) on a map.

style, vector, statistic, chart, pie, donut, animation

Statistic charts style + values

This example shows how to display values using a ol.style.Chart.

style, vector, statistic, chart, pie, text

Fill pattern style

The ol.style.FillPattern is a fill style with a set of cartographic patterns to use in your maps.

style, vector, fill, pattern, hatch

Stroke pattern style

The ol.style.StokePattern is a stroke style with a set of cartographic patterns to use in your maps.

style, vector, stroke, pattern, hatch

FlowLine style

The ol.style.FlowLine is a line style to draw LineString with variable colors and widths to display flows or Sankey diagram on a map.

style, vector, flow, color, sankey

Flow arrow style

With the ol.style.FlowLine you can add arrows to draw Sankey maps.

style, vector, flow, color, arrow, sankey

FlowLine style

This example displays a GPX track using a ol.style.FlowLine to symbolize elevation along the line as a color.

style, vector, flow, color, gpx

Profile style

ol/style/Profile is a style to draw line profiles on a map.

style, vector, profile, 3D, gpx

Textpath style

The ol.vector.setTextPathStyle() is a function to draw text along a linear feature (ol.geom.lineString) on postcompose.

style, vector, textpath, text, along

Hash lines style

This example uses the ol.geom.offsetCoords() function to draw an offset line with a dash symbol.

style, vector, hash, stroke, offset

Scribble fill

The scribbleFill function calculates a MultiPolyline to fill a Polygon with a scribble effect that appear hand-made.

style, vector, hatch, fill, scribble

## Animation

Animated clusters

ol.layer.AnimatedCluster is a layer that animates clusters on zoom change.

map, layer, animation, cluster, animated

Feature animation

ol.featureAnimation provides animations to animate features on a map.

map, feature, animation, bounce, drop

Feature animation with select

This example shows how to use a transparent style to let the features selectable when animated.

map, feature, animation, bounce, drop, select

Animate features along a path

This example animates features along a path.

map, feature, animation, path

Pulse!

A pulse function to pulse points on a map.

map, animation, pulse

## Filter

Crop/mask filter

Filter to crop or mask a map or a layer using an area (ol.feature).

filter, crop, mask

Clip filter

Filter to clip a map or a layer.

filter, clip

Colorize filter

Filter to add color effects on maps or layers (hue, color, grayscale, enhance...).

filter, effect, color, hue, saturation, invert, grayscale

Texture filter

Filter to add texture effects on maps or layers.

filter, effect, texture

Composite filter

This filter applies a composite operation on layer drawing.

filter, effect, composite, color, canvas

Canvas filter

Apply canvas filter on layer drawing.

filter, effect, svg, blur, huerotate, canvas

Mix blend mode filter

Apply CSS filter on layers (mix-blend-mode).

filter, effect, ol6, blend

Folding map

This filter creates a folding effect on the map.

filter, effect, fold, folding, map, canvas

Pencil sketch filter

A filter to turn your maps into pencil sketchs.

filter, pencil, sketch, map, canvas

Edge detection filter

A set of filters to turn detect edges on map layers.

filter, SVG, map, canvas, Sobel, Roberts, Prewitt

## Controls

Layer switcher control example

Example of a layer switcher control with visibility, opacity and ordering.

layer, switcher, control

Switcher with layer filter option

Example of a layer switcher control with a filter to filter layers on names.

layer, switcher, control, filter

LayerSwitcher image

A simple layer switcher with image buttons.

layerswitcher, control, preview

LayerSwitcher popup

A simple layer switcher as a menu.

layerswitcher, control

Layer shop

A layer switcher integrating bars to handle layer properties and buttons.

layerswitcher, shop, control

WMS Capabilities control

A control to help adding WMS on your maps.

map, control, layer, WMS, capabilities, getCapabilities

WMTS Capabilities control

A control to help adding WMTS on your maps.

map, control, layer, WMTS, capabilities, getCapabilities

MapZone control

A control to jump from a map zone to another.

map, control, zone, locate

Overlay menu

The overlay control can be used to display a menu on to of the map.

overlay, control, menu

Overview map

An overview map with zoom limit and custom styles. Click on the overview will center the map.

overview, control

Geo bookmarks control

ol.control.GeoBookmark adds a control to handle geo bookmarks, ie. save places.

control, bookmark, place

Profile control

ol.control.Profile is a control that draw a profile of a 3D lineString (with a XYZ or XYZM layout).

control, profile, Z, altitude, GPX, GPS

Permalink control

The ol.control.Permalink is hyperlink that will return the user to the current map view.

control, permalink

Swipe control

The ol.control.Swipe is a control that add a split screen to compare two map overlays.

control, swipe, compare

Compare map

Swipe control and clip interaction to compare two maps.

map, compare, swipe, clip

Notification control

The ol.control.Notification lets you show notification on the map.

map, control, notification

Globe control

The ol.control.Globe add a small globe on the map to display a position marker.

control, swipe, overlay, split

Gauge control

The ol.control.Gauge add a gauge on the map.

control, gauge

Scale control

ol.control.Scale displays the current scale in a control on the map.

control, scale

FeatureList control

ol/control/FeatureList displays a list of features attributes in a list.

control, list, table

## Control bar

Control button

The ol.control.Button is simple control button.

control, button, toolbar

Control Toggle

ol.control.Toggle is an ol.control.Button with an active/deactive state.

control, button, toggle, toolbar

Control bar

The ol.control.Bar is a panel that contains other controls. You can compose toolbars with it.

control, bar, toolbar, button, panel

Control subbar

ol.control.Bar an be bested using an ol.control.Toggle to add subbar.

control, bar, subbar, toolbar, button, panel

Edition bar

An example of ol.control.Bar to handle an edit toolbar.

control, edit, bar, toolbar, button, panel

## Canvas controls

Print control

A control to print the map.

control, canvas, print, map, export

Print dialog control

Add a dialog to print the map.

control, canvas, print, map, export, dialog

Canvas control

Example of canvas controls, ie. controls that are drawn on the canvas to use with export (jpeg/png) functions.

control, canvas, scale line, attribution, title, export

Compass control.

The ol.control.Compass draw a compass on the map.

control, canvas, compass

Graticule control.

The ol.control.Graticule draw a graticule and coordinate labels on the map.

control, canvas, graticule

Grid reference control.

The ol.control.GridReference display a grid reference on the map associated with an index map.

control, canvas, grid, reference, index

Target control.

The ol.control.Target draw a target to materialize the center of the map.

control, canvas, target

## Interactions

Transform interaction

The ol.interaction.Transform is an interaction to transform features (scale, translate, rotate).

interaction, transform, scale, translate, rotate, vector

An interaction to copy / paste features on the map

ol.interaction.CopyPaste is an interaction to copy, cut, paste features.

interaction, feature, copy, cut, paste

An interaction to draw holes in polygons

ol.interaction.DrawHole is an interaction to draw holes in poglygon features.

interaction, draw, hole, polygon, donut

Split feature interaction

ol.interaction.Split is an interaction to split feature geometry (ol.geom.LineString).

interaction, split, linestring

Splitter interaction

An interaction that acts as a split feature agent while editing vector features (LineString).

interaction, split, linestring

Modify feature

A modify interaction that support undo/redo.

interaction, modify, undo

Draw regular interaction

ol.interaction.DrawRegular is an interaction to draw regular polygon (circle/ellipse, triangle, square/rectangles, etc).

interaction, regular, interaction, draw, circle, triangle

Offset interaction

An interaction to offset the feature geometry.

interaction, vector, transform, offset

Hover interaction

An interaction to do something when hovering a feature (change cursor, show a popup, display information, etc.)

interaction, hover, cursor

Snap guide interaction

ol.interaction.SnapGuide handles snapping of vector features using guides lines while modifying or drawing them.

interaction, sna, guide

Clip interaction

ol.interaction.Clip clip layers by a circle on the map.

interaction, clip, circle, canvas

Dropfile interaction

ol.interaction.DropFile is a drag and drop interaction. It fires a loadstart and loadend and errors.

interaction, drag, drop

Drag overlays interaction

ol.interaction.DraOverlay is an interaction to drag overlays on the map.

interaction, drag, popup, placemark, overlay

## Undo/redo interaction

Undo/redo interaction

ol/interaction/UndoRedo is an interaction to handle undo/redo on a map.

interaction, undo, redo

Undo/redo attributes

ol/interaction/FillAttribute is a cancelable interaction to modify attributes.

interaction, undo, redo, attributes

Undo/redo custom action

This example shows how to define action with ol/interaction/UndoRedo.

interaction, undo, redo, custom, action

## Legend

Legend control

ol.control.Legend is a control to display a legend on a map.

style, legend, features, control

Legend control

An example to display a ol.control.Legend in a statistical map.

style, legend, features, control

Multi Legend control

An example to display a ol.control.Legend with 2 columns.

style, legend, features, control

Legend with an image

Legend items can use ol/legend/Image to display an image as legend.

style, legend, image, control

Layer legend

Legends can be associated with a layer and displayed when the layer is visible only.

style, legend, layer, control

## Search

Search bar

A generic search bar to search on the map.

search, control

Search GPS

A search control to get lon/lat from user.

search, control, GPS, longitude, latitude

Search feature

A search bar to search features on the map.

search, control, vector

Search WikiPedia feature

A search control to search features in WikiPedia.

search, control, vector, wikipedia, mediawiki

Search places with Nominatim

A search bar to search places using the OSM Nominatim.

search, control, OSM, nominatim, places, autocomplete

Search places with Photon

A search bar to search places using the photon API.

search, control, OSM, photon, places, autocomplete

Search French places

A search bar to search French places using the French National Address Base (BAN) API.

search, control, BAN, french, places, autocomplete

Search Géoportail

A search bar to search French places using the Géoportail API.

search, control, Geoportail, french, places, autocomplete

Search French cadastral parcels

A search bar to search French cadastral parcels using the Géoportail API.

search, control, Geoportail, french, parcel, autocomplete

## Select controls

Select control

ol.control.Select is a control to select features by attributes in a source.

search, select, features, control

Multi-select control

ol.control.SelectMulti is a control container that manage other Select control.

search, select, features, control

## Routing

Dijkstra short path

Use Dijkstra's algorithm on a vector layer.

routing, graph, algo, dijkstra, A*, short path

Geoportail routing

A routing control that use the French Geoportail API.

routing, IGNF, Geoportail

Geoportail isochrone

An isochrone control that use the French Geoportail API.

routing, isochrone, IGNF, Geoportail

## Popup

Popup!

Show popup on a map with style.

popup, overlay

Animated popup!

This example uses a CSS to add a bounce effect to the popup display.

popup, overlay, animation

Feature popup

ol/Overlay/PopupFeature is a popup to show the content of features on the map.

popup, overlay, feature, attribute, select

Fixed popup

Popup on a fixed place in the map viewport.

popup, overlay

Tooltips

ol/Overlay/Tooltip is a popup to show information on the fly. It can be used to display measure while drawing.

popup, overlay, feature, tooltip, measure

Placemark

Display a placemark on the map.

popup, overlay, placemark, animation

Overlay control

The overlay control can be used to display information on to of the map.

popup, overlay, animation

## Bin map

Hexbin maps

ol.source.HexBin aggregates features on hexagonal grid. Hexagonal binning (heatmaps) provide a convenient way to visualize density.

layer, hexbin, cluster, hexagon, binning, heatmap

Grid bin maps

ol.source.GridBin is a convenient way for aggregating data into a coarser representation for display.

layer, binning, cluster, square, grid

INSEE bin maps

The French INSEE grid is a 2.3 million squares grid (200m x 200m) that cover the France based on lambert azimutha equal area projection (EPSG:3035).

layer, binning, cluster, square, insee

Feature bin maps

The ol.source.FeatureBin is a source that use a set of features subdivision to bin data on it.

layer, cluster, binning, feature, aggregate

## Layer / source

Georeference images on a map

ol/source/GeoImage georeference images on a map.

layer, georeference, georeferencing, image, photo

IDW interpolated source

ol/source/IDW is an IDW (Inverse Distance Weighted) interpolated source.

layer, source, IDW, interpolation, inverse, distance, weight

Show DFCI grid in a layer

A ol/source/DCI to display the French DFCI grid on a map as a layer.

source, dfci, grid, index

A source to display day/night on a map.

The ol/source/DayNight display night and day on a map.

source, night, day

French IGN's layer and source

ol/source/Geoportail abd ol/layer/Geoportail handle french Geoportail layers and API key.

source, layer, geoportail

Preview of a layer

Add a getPreview function to ol.layer that retrieve a preview of the layer.

layer, preview

Overpass source

ol.source.Overpass is a vector source that use the Overpass API to load OSM features.

layer, vector, OSM, Overpass

GeoRSS source

ol/source/GeoRSS is a vector source to load a GeoRSS feed.

source, layer, vector, GeoRSS

BDpedia layer

A BDpedia tile vector layer that use RDF of the french DBpedia project.

layer, vector, wikipedia, dbpedia

Wikimedia Commons layer

ol.layer.WikiCommons is a tile vector layer that use Wikimedia Commons.

layer, vector, wikipedia, wikimedia, commons

Delaunay triangulation

ol.source.Delaunay computes a Delaunay triangulation of a vector source.

source, vector, Delaynay, Voronoi, triangulation, TIN

## Mobile

GPS control button

The ol/interaction/GeolocationButton is a simple button to handle geolocation.

interaction, mobile, GPS, location

Draw feature using GPS

The ol.interaction.GeolocationDraw is a draw interaction that use the GPS to draw features.

interaction, mobile, draw, GPS, location

A control bar to record GPS tracks

The ol.control.GeolocationBar is a control designed to record GPS tracks.

mobile, control, bar, draw, GPS, location

Touch compass interaction

The TouchCompass interaction lets you handle movement by dragging a touch compass.

interaction, touch, drag, compass

Long touch interaction

The LongTouch interaction is an interaction to handle a long touch event.

interaction, touch, long

Touch draw interaction

An interactioon for drawing feature geometry on a touch device.

interaction, touch, draw, vector

ModifyTouch interaction

An interactioon to display a popup when modifying a feature to remove a vertex on touch devices.

interaction, touch, modify, remove, vector

TouchCursor interaction

An interaction specially designed to work on mobile, with a cursor to shift the finger position and lets it visible when drawing.

interaction, mobile, touch, modify, draw, vector

## Geometry

Cardinal spline

The ol.geom.Geometry.cspline() function smooth lines by using cardinal splines (canonical spline) to draw smooth curves that goes through the points.

geom, linestring, spline, smooth, curve

Geohash

The ol/geohash adds functions to convert a geohash to/from a latitude/longitude point, and to determine bounds of a geohash cell and find neighbours of a geohash.

geom, geohash

Great circle track

The ol.sphere.greatCircleTrack() function computes a great circle geometry.

geom, track, great circle, sphere

Convex Hull

The ol.coordinate.convexHull() function calculates a convex hull or convex envelope, ie. the smallest polygon that contains all points of a set.

geom, polygon, convex hull, envelope

Cluster envelope

Uses convex hull to display the envelope of the points inside a cluster when cusor hovers the cluster.

geom, polygon, convex hull, envelope

Intersection!

Fast polygon intersection calculation with an extent.

geometry, intersection, extent

Intersection (circle)!

Rough polygon intersection calculation with a circle.

geometry, intersection

Intersection (statistics)!

Calculte statistics on a map using fast polygon intersection calculation.

geometry, intersection, statistics

## Perspective map

Perspective map

ol/PerspectiveMap displays a map with a perspective effect by pitching the map.

map, 3D, 2.5D, perspective

## Storymap

Storymap

A control with scroll-driven navigation to create narrative maps.

storymap, scroll-driven, narration, control

Time line

The ol/control/Timeline displays features on a timeline.

storymap, timeline, date, time, control

Time line interval

The ol/control/Timeline can be used to displays filter features in a time interval.

storymap, timeline, interval, date, time, control, earthquake

Time line slider

This example use a ol/control/Timeline as a time slider.

storymap, timeline, slider, date, time, control, earthquake

Historical map

This example use a ol/control/Timeline to control layer visibility.

storymap, timeline, layer, date, time, control, historic

Image line

The ol/control/Imageline displays images on map as a line.

storymap, image, line, control

## Elevation

Elevation layer

Use elevation Band Interleaved by Line (BIL) to encode altitude as RGB pixels in a layer.

layer, elevation, bil, altitude, DEM

Hypsosometric tints

Use elevation layer to render hyspometric tints.

layer, elevation, bil, hyspometric, DEM

Sea level

Use elevation layer to render sea level at different elevation.

layer, elevation, bil, flood, DEM

## Miscellaneous

Status control

A control to show debug information on the map.

control, status, overlay, debug

Dialog control

A control to display dialogs on a map.

control, dialog, overlay, form

Record map as video!

Add some magic on your maps.

control, canvas, animation, video, record

Thinker Bell animation

Add some magic on your maps.

interaction, Tinker Bell, sparkle, cursor

There is a Blob on my map!

Add a blob interaction on your maps.

interaction, blob, clip, cursor

Magnify glass

The Magnify overlay add a "magnifying glass" effect to an OL3 map that displays a portion of the map in a different zoom (and actually display different content).

overlay, magnify, glass, zoom

Flashlight!

The flashlight interaction add a flashlight effect on mouse move.

interaction, effect, light

Animated Overlay

The ol.Overlay.AnimatedCanvas is an overlay to play animations on top of the map.

control, effect, rain, snow, clouds, birds, animation

Map in the cloud

The ol.control.Cloud adds an animated clouds overlay over the map.

control, effect, clouds, birds, animation

Lego map

A map that looks like made of a set of Lego bricks.

filter, effect, lego, brick

OilPainting source

ol/source/OilPainting turns an image layer into artistic oil painting.

source, filter, oil, painting

Pointillism filter

ol/filter/Poinitillism turns an image layer into artistic impressionnist pointillist painting.

source, filter, impressionnism, pointillism, painting

Watter ripple

The ripple interaction add a watter ripple effect on a map.

interaction, effect, animation, watter, ripple

Synchronize Maps

Synchronize maps and add an overlay to show mouse position.

synchronization, map, cursor, comparison

Synchronize Maps

Synchronize maps in different windows.

synchronization, map, window, comparison

Playing with VectorTile styles

An exemple to change colors on a VectorTile

source, layer, geoportail, vectortile, style

Download IGN Geoportail Opendata

An exemple to download data using a WFS.

source, layer, geoportail, WFS, opendata

Progress bar

Add a progress bar to your maps.

control, progress, bar

## Tools

Exif2GeoJSON

A usefull tool to make a GeoJSON file with all of the found GPS points in a list of images.

exif, tag, image, geojson, tool

GeoJSON2CSV

Convert a GeoJSON file to CSV.

csv, geojson, tool

CSV2GeoJSON

Convert a CSV file to GeoJSON.

csv, geojson, tool

## Full map

Pirate map.

This example shows how to combine a color filter, with a parchment texture filter, a compass control and a graticule control to create an old map effect.

control, canvas, pirate, graticule, compass, effect

2.5/3D renderer

This example is an attempt to represent 2.5/3D informations on a map.

layer, vector, 3D, buildings, animation

2.5/3D layer

The ol/layer/Vector3D is a layer to display vector source in a 2.5/3D style.

layer, vector, 3D, source, animation, statistic

BDpedia photo map

An example using a BDpedia layer with clusters to show photos on a map.

layer, vector, cluster, photo, style, dbpedia, animation

Clustering map

An example using the ol.style.Chart to display the cluster content.

layer, vector, cluster, chart, style, cluster, animation

Watchdog map

A map with animations when adding points.

map, animation, blink