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
@viglino Download

Styles

Font style
(map.style.font.html)
2017

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..

stylevectorfontfontawesomeiconmaki

Photo style
(map.style.photo.html)
2017

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.

stylevectorphoto

Statistic charts style
(map.style.chart.html)
2017

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

stylevectorstatisticchartpiedonutanimation

Statistic charts style + values
(map.style.chart+text.html)
2017

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

stylevectorstatisticchartpietext

Fill pattern style
(map.style.pattern.html)
2017

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

stylevectorfillpatternhatch

Stroke pattern style
(map.style.strokepattern.html)
2017

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

stylevectorstrokepatternhatch

FlowLine style
(map.style.flowline.html)
2019-02

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.

stylevectorflowcolorsankey

Flow arrow style
(map.style.flowarrow.html)
2020-10

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

stylevectorflowcolorarrowsankey

FlowLine style
(map.style.gpxline.html)
2019-02-05

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

stylevectorflowcolorgpx

Profile style
(map.style.profile.html)
2020-10-25

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

stylevectorprofile3Dgpx

Textpath style
(map.style.textpath.html)
2017

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

stylevectortextpathtextalong

Hash lines style
(map.style.hashlines.html)
2017

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

stylevectorhashstrokeoffset

Scribble fill
(map.style.scribblefill.html)
2017

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

stylevectorhatchfillscribble

Animation

Animated clusters
(map.animatedcluster.html)
2017

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

maplayeranimationclusteranimated

Feature animation
(map.featureanimation.html)
2017

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

mapfeatureanimationbouncedrop

Feature animation with select
(map.featureanimation.select.html)
2017

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

mapfeatureanimationbouncedropselect

Pulse!
(map.pulse.html)
2017

A pulse function to pulse points on a map.

mapanimationpulse

Filter

Crop/mask filter
(map.filter.crop.html)
2017

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

filtercropmask

Clip filter
(map.filter.clip.html)
2017

Filter to clip a map or a layer.

filterclip

Colorize filter
(map.filter.colorize.html)
2017

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

filtereffectcolorhuesaturationinvertgrayscale

Texture filter
(map.filter.texture.html)
2017

Filter to add texture effects on maps or layers.

filtereffecttexture

Composite filter
(map.filter.composite.html)
2017

This filter applies a composite operation on layer drawing.

filtereffectcompositecolorcanvas

Mix blend mode filter
(map.filter.css.html)
2021-08-01

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

filtereffectol6blend

Folding map
(map.filter.fold.html)
2017

This filter creates a folding effect on the map.

filtereffectfoldfoldingmapcanvas

Pencil sketch filter
(map.filter.pencilsketch.html)
2021-01

A filter to turn your maps into pencil sketchs.

filterpencilsketchmapcanvas

Edge detection filter
(map.filter.edgedetection.html)
2021-04

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

filterSVGmapcanvasSobelRobertsPrewitt

Controls

Layer switcher control example
(map.switcher.html)
2017

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

layerswitchercontrol

Switcher with layer filter option
(map.switcher.filter.html)
2019-01-15

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

layerswitchercontrolfilter

LayerSwitcher image
(map.switcher.image.html)
2017

A simple layer switcher with image buttons.

layerswitchercontrolpreview

Layer shop
(map.switcher.shop.html)
2023-01-23

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

layerswitchershopcontrol

MapZone control
(map.control.mapzone.html)
2019-02-09

A control to jump from a map zone to another.

mapcontrolzonelocate

Overlay menu
(map.control.overlay.menu.html)
2017

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

overlaycontrolmenu

Overview map
(map.overview.html)
2017

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

overviewcontrol

Geo bookmarks control
(map.control.geobookmark.html)
2017

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

controlbookmarkplace

Profile control
(map.control.profile.html)
2017

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

controlprofileZaltitudeGPXGPS

Permalink control
(map.control.permalink.html)
2017

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

controlpermalink

Swipe control
(map.control.swipe.html)
2017

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

controlswipecompare

Compare map
(map.compare.html)
2022-10-22

Swipe control and clip interaction to compare two maps.

mapcompareswipeclip

Notification control
(map.control.notification.html)
2017

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

mapcontrolnotification

Globe control
(map.control.globe.html)
2017

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

controlswipeoverlaysplit

Gauge control
(map.control.gauge.html)
2017

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

controlgauge

Scale control
(map.control.scale.html)
2019-07-22

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

controlscale

FeatureList control
(map.control.featurelist.html)
2023-11-28

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

controllisttable

Control bar

Control button
(map.control.button.html)
2017

The ol.control.Button is simple control button.

controlbuttontoolbar

Control Toggle
(map.control.toggle.html)
2017

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

controlbuttontoggletoolbar

Control bar
(map.control.bar.html)
2017

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

controlbartoolbarbuttonpanel

Control subbar
(map.control.subbar.html)
2017

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

controlbarsubbartoolbarbuttonpanel

Edition bar
(map.control.editionbar.html)
2017

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

controleditbartoolbarbuttonpanel

Canvas controls

Canvas control
(map.canvas.control.html)
2017

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

controlcanvasscale lineattributiontitleexport

Compass control.
(map.control.compass.html)
2017

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

controlcanvascompass

Graticule control.
(map.control.graticule.html)
2017

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

controlcanvasgraticule

Grid reference control.
(map.control.gridreference.html)
2017

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

controlcanvasgridreferenceindex

Target control.
(map.target.control.html)
2017

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

controlcanvastarget

Interactions

Transform interaction
(map.interaction.transform.html)
2017

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

interactiontransformscaletranslaterotatevector

An interaction to copy / paste features on the map
(map.interaction.copypaste.html)
2019-05-24

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

interactionfeaturecopycutpaste

An interaction to draw holes in polygons
(map.interaction.drawhole.html)
2017

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

interactiondrawholepolygondonut

Split feature interaction
(map.interaction.split.html)
2017

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

interactionsplitlinestring

Splitter interaction
(map.interaction.splitter.html)
2017

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

interactionsplitlinestring

Modify feature
(map.interaction.modifyfeature.html)
2017

A modify interaction that support undo/redo.

interactionmodifyundo

Draw regular interaction
(map.interaction.drawregular.html)
2017

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

interactionregularinteractiondrawcircletriangle

Hover interaction
(map.interaction.hover.html)
2017

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

interactionhovercursor

Snap guide interaction
(map.interaction.snapguides.html)
2017

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

interactionsnaguide

Clip interaction
(map.interaction.clip.html)
2017

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

interactionclipcirclecanvas

Dropfile interaction
(map.ddrop.html)
2017

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

interactiondragdrop

Drag overlays interaction
(map.interaction.dragoverlay.html)
2018-12-10

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

interactiondragpopupplacemarkoverlay

Undo/redo interaction

Undo/redo interaction
(map.interaction.undoredo.html)
2018-12

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

interactionundoredo

Undo/redo attributes
(map.interaction.undoredo2.html)
2019-01

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

interactionundoredoattributes

Undo/redo custom action
(map.interaction.undocustom.html)
2019-02-23

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

interactionundoredocustomaction

Legend

Legend control
(map.control.legend.html)
2017

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

stylelegendfeaturescontrol

Legend control
(map.control.legendstat.html)
2017

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

stylelegendfeaturescontrol

Multi Legend control
(map.control.legends.html)
2017

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

stylelegendfeaturescontrol

Legend with an image
(map.control.legend.image.html)
2022-10-25

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

stylelegendimagecontrol

Layer legend
(map.control.legend.layer.html)
2022-10-25

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

stylelegendlayercontrol

Search

Search bar
(map.control.search.html)
2017

A generic search bar to search on the map.

searchcontrol

Search GPS
(map.control.searchgps.html)
2019-01-15

A search control to get lon/lat from user.

searchcontrolGPSlongitudelatitude

Search coordinates
(map.control.searchcoord.html)
2024-06-21

A search control to search place by coordinates.

searchcontrolcoordinateprojection

Search feature
(map.control.searchfeature.html)
2017

A search bar to search features on the map.

searchcontrolvector

Search WikiPedia feature
(map.control.searchpedia.html)
2019-03-02

A search control to search features in WikiPedia.

searchcontrolvectorwikipediamediawiki

Select controls

Select control
(map.control.select.html)
2017

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

searchselectfeaturescontrol

Multi-select control
(map.control.selectmulti.html)
2017

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

searchselectfeaturescontrol

Routing

Geoportail routing
(map.control.routing.html)
2019-02

A routing control that use the French Geoportail API.

routingIGNFGeoportail

Geoportail isochrone
(map.control.isochrone.html)
2019-02

An isochrone control that use the French Geoportail API.

routingisochroneIGNFGeoportail

Popup

Popup!
(map.popup.html)
2017

Show popup on a map with style.

popupoverlay

Animated popup!
(map.popup.anim.html)
2017

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

popupoverlayanimation

Feature popup
(map.popup.feature.html)
2017

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

popupoverlayfeatureattributeselect

Fixed popup
(map.fixedpopup.html)
2021-02-28

Popup on a fixed place in the map viewport.

popupoverlay

Tooltips
(map.tooltip.measure.html)
2019-06-29

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

popupoverlayfeaturetooltipmeasure

Placemark
(map.placemark.html)
2018-12

Display a placemark on the map.

popupoverlayplacemarkanimation

Overlay control
(map.control.overlay.html)
2017

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

popupoverlayanimation

Bin map

Hexbin maps
(map.layer.hexbin.html)
2017

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

layerhexbinclusterhexagonbinningheatmap

Grid bin maps
(map.layer.gridbin.html)
2019-02-16

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

layerbinningclustersquaregrid

INSEE bin maps
(map.layer.insee.html)
2019-02-16

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).

layerbinningclustersquareinsee

Feature bin maps
(map.layer.featurebin.html)
2019-02-16

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

layerclusterbinningfeatureaggregate

Layer / source

IDW interpolated source
(map.layer.idw.html)
2021-05-21

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

layersourceIDWinterpolationinversedistanceweight

Show DFCI grid in a layer
(map.dfci.html)
2017

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

sourcedfcigridindex

A source to display day/night on a map.
(map.daynight.html)
2019-11-30

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

sourcenightday

French IGN's layer and source
(map.layer.geoportail.html)
2019-06-05

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

sourcelayergeoportail

Preview of a layer
(map.preview.html)
2017

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

layerpreview

Overpass source
(map.overpass.html)
2017

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

layervectorOSMOverpass

GeoRSS source
(map.source.georss.html)
2019-10-24

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

sourcelayervectorGeoRSS

BDpedia layer
(map.dbpedia.html)
2017

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

layervectorwikipediadbpedia

Delaunay triangulation
(map.source.delaunay.html)
2018-11

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

sourcevectorDelaynayVoronoitriangulationTIN

Mobile

GPS control button
(map.control.geolocationbt.html)
2021-01

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

interactionmobileGPSlocation

Draw feature using GPS
(map.interaction.geolocationdraw.html)
2017

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

interactionmobiledrawGPSlocation

A control bar to record GPS tracks
(map.control.geolocationbar.html)
2017

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

mobilecontrolbardrawGPSlocation

Touch compass interaction
(map.interaction.touchcompass.html)
2017

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

interactiontouchdragcompass

Long touch interaction
(map.interaction.longtouch.html)
2017

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

interactiontouchlong

Touch draw interaction
(map.interaction.drawtouch.html)
2017

An interactioon for drawing feature geometry on a touch device.

interactiontouchdrawvector

ModifyTouch interaction
(map.interaction.modifytouch.html)
2017

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

interactiontouchmodifyremovevector

TouchCursor interaction
(map.interaction.touchcursordraw.html)
2020-12-01

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

interactionmobiletouchmodifydrawvector

Geometry

Cardinal spline
(map.geom.cspline.html)
2017

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

geomlinestringsplinesmoothcurve

Geohash
(map.geohash.html)
2020-04-21

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.

geomgeohash

Great circle track
(map.geom.greatcircle.html)
2019-08-16

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

geomtrackgreat circlesphere

Convex Hull
(map.convexhull.html)
2017

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

geompolygonconvex hullenvelope

Cluster envelope
(map.cluster.convexhull.html)
2017

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

geompolygonconvex hullenvelope

Intersection!
(map.intersection.html)
2022-10-23

Fast polygon intersection calculation with an extent.

geometryintersectionextent

Intersection (circle)!
(map.circle.intersection.html)
2022-10-23

Rough polygon intersection calculation with a circle.

geometryintersection

Intersection (statistics)!
(map.layer.clc.wfs.html)
2022-10-23

Calculte statistics on a map using fast polygon intersection calculation.

geometryintersectionstatistics

Perspective map

Perspective map
(map.perspective.html)
2020-02-27

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

map3D2.5Dperspective

Storymap

Storymap
(map.control.storymap.html)
2018-12-28

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

storymapscroll-drivennarrationcontrol

Time line
(map.control.timeline.html)
2018-12-25

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

storymaptimelinedatetimecontrol

Time line interval
(map.control.timeinterval.html)
2018-12-27

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

storymaptimelineintervaldatetimecontrolearthquake

Time line slider
(map.control.timequake.html)
2018-12-27

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

storymaptimelinesliderdatetimecontrolearthquake

Historical map
(map.historical.html)
2021-05-05

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

storymaptimelinelayerdatetimecontrolhistoric

Image line
(map.control.imageline.html)
2018-12-25

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

storymapimagelinecontrol

Elevation

Elevation layer
(map.layer.altitude.html)
2021-08-22

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

layerelevationbilaltitudeDEM

Hypsosometric tints
(map.layer.elev.html)
2021-08-22

Use elevation layer to render hyspometric tints.

layerelevationbilhyspometricDEM

Sea level
(map.layer.sealevel.html)
2021-08-22

Use elevation layer to render sea level at different elevation.

layerelevationbilfloodDEM

Miscellaneous

Status control
(map.control.status.html)
2019-06-08

A control to show debug information on the map.

controlstatusoverlaydebug

Dialog control
(map.dialog.html)
2019-07-24

A control to display dialogs on a map.

controldialogoverlayform

Magnify glass
(map.overlay.magnify.html)
2017

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).

overlaymagnifyglasszoom

Flashlight!
(map.flashlight.html)
2017

The flashlight interaction add a flashlight effect on mouse move.

interactioneffectlight

Animated Overlay
(map.animatedcanvas.html)
2020-01-25

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

controleffectrainsnowcloudsbirdsanimation

Map in the cloud
(map.control.cloud.html)
2017

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

controleffectcloudsbirdsanimation

Lego map
(map.filter.lego.html)
2017

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

filtereffectlegobrick

OilPainting source
(map.filter.oilpaint.html)
2021-01

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

sourcefilteroilpainting

Pointillism filter
(map.filter.pointillism.html)
2021-01

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

sourcefilterimpressionnismpointillismpainting

Watter ripple
(map.interaction.ripple.html)
2017

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

interactioneffectanimationwatterripple

Synchronize Maps
(map.interaction.synchronize.html)
2017

Synchronize maps and add an overlay to show mouse position.

synchronizationmapcursorcomparison

Progress bar
(map.progressbar.html)
2021-06-30

Add a progress bar to your maps.

controlprogressbar

Inputs!
(map.input.html)
2017

A wide range of inputs to use in your maps.

mapinputcolorsizemenurange

Collection input list
(map.input.collection.html)
2017

A list element to synchronize with an ol.Collection.

olcollectionlist

Tools

Exif2GeoJSON
(exif2geojson.html)
2017

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

exiftagimagegeojsontool

GeoJSON2CSV
(geojson2csv.html)
2019-03-02

Convert a GeoJSON file to CSV.

csvgeojsontool

CSV2GeoJSON
(csv2geojson.html)
2019-10-16

Convert a CSV file to GeoJSON.

csvgeojsontool

Full map

Pirate map.
(map.pirate.html)
2017

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.

controlcanvaspirategraticulecompasseffect

2.5/3D renderer
(map.layer.3D.html)
2017

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

layervector3Dbuildingsanimation

2.5/3D layer
(map.layer.3D.2.html)
2019-06-05

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

layervector3Dsourceanimationstatistic

BDpedia photo map
(map.dbpedia.photo.html)
2017

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

layervectorclusterphotostyledbpediaanimation

Clustering map
(map.clustering.html)
2017

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

layervectorclusterchartstyleclusteranimation

Watchdog map
(map.watchdogs.html)
2022-10-22

A map with animations when adding points.

mapanimationblink