Namespace: ol

ol

Classes

AssertionError
Attribution
Collection
DeviceOrientation
Disposable
DragBoxEvent
Feature
Geolocation
Graticule
Image
ImageBase
ImageTile
Kinetic
Map
MapBrowserEvent
MapEvent
Object
ObjectEvent
Observable
Overlay
Sphere
Tile
VectorTile
View

Namespaces

animation
color
colorlike
control
coordinate
easing
events
extent
featureloader
format
geom
has
interaction
layer
loadingstrategy
proj
render
source
style
tilegrid

Methods

ol.inherits(childCtor, parentCtor) experimental

src/ol/index.js, line 257

Inherit the prototype methods from one constructor into another.

Usage:

function ParentClass(a, b) { }
ParentClass.prototype.foo = function(a) { }

function ChildClass(a, b, c) {
  // Call parent constructor
  ParentClass.call(this, a, b);
}
ol.inherits(ChildClass, ParentClass);

var child = new ChildClass('a', 'b', 'see');
child.foo(); // This works.
Name Type Description
childCtor function

Child constructor.

parentCtor function

Parent constructor.

Type Definitions

ol.AttributionLike{string} {Array.<string>} {ol.Attribution} {Array.<ol.Attribution>}

ol.CanvasFunctionType()

src/ol/typedefs.js, line 69

A function returning the canvas element ({HTMLCanvasElement}) used by the source as an image. The arguments passed to the function are: ol.Extent the image extent, {number} the image resolution, {number} the device pixel ratio, ol.Size the image size, and ol.proj.Projection the image projection. The canvas returned by this function is cached by the source. The this keyword inside the function references the ol.source.ImageCanvas.

ol.Color{Array.<number>} {Uint8Array} {Uint8ClampedArray}

A color represented as a short array [red, green, blue, alpha]. red, green, and blue should be integers in the range 0..255 inclusive. alpha should be a float in the range 0..1 inclusive. If no alpha value is given then 1 will be used.

ol.ColorLike{string} {CanvasPattern} {CanvasGradient}

A type accepted by CanvasRenderingContext2D.fillStyle. Represents a color, pattern, or gradient.

ol.Coordinate{Array.<number>}

An array of numbers representing an xy coordinate. Example: [16, 48].

ol.CoordinateFormatType()

src/ol/typedefs.js, line 136

A function that takes a ol.Coordinate and transforms it into a {string}.

ol.DragBoxEndConditionType()

src/ol/typedefs.js, line 145

A function that takes a ol.MapBrowserEvent and two ol.Pixels and returns a {boolean}. If the condition is met, true should be returned.

ol.DrawGeometryFunctionType()

src/ol/typedefs.js, line 157

Function that takes coordinates and an optional existing geometry as arguments, and returns a geometry. The optional existing geometry is the geometry that is returned when the function is called without a second argument.

ol.EventsConditionType()

src/ol/typedefs.js, line 166

A function that takes an ol.MapBrowserEvent and returns a {boolean}. If the condition is met, true should be returned.

ol.EventsKey{Object}

Key to use with ol.Observable#unByKey.

ol.Extent{Array.<number>}

An array of numbers representing an extent: [minx, miny, maxx, maxy].

ol.FeatureLoader()

src/ol/typedefs.js, line 219

ol.source.Vector sources use a function of this type to load features.

This function takes an ol.Extent representing the area to be loaded, a {number} representing the resolution (map units per pixel) and an ol.proj.Projection for the projection as arguments. this within the function is bound to the ol.source.Vector it's called from.

The function is responsible for loading the features and adding them to the source.

ol.FeatureStyleFunction()

src/ol/typedefs.js, line 230

A function that returns an array of styles given a resolution. The this keyword inside the function references the ol.Feature to be styled.

ol.FeatureUrlFunction()

src/ol/typedefs.js, line 243

ol.source.Vector sources use a function of this type to get the url to load features from.

This function takes an ol.Extent representing the area to be loaded, a {number} representing the resolution (map units per pixel) and an ol.proj.Projection for the projection as arguments and returns a {string} representing the URL.

ol.ImageLoadFunctionType()

src/ol/typedefs.js, line 273

A function that takes an ol.Image for the image and a {string} for the src as arguments. It is supposed to make it so the underlying image ol.Image#getImage is assigned the content specified by the src. If not specified, the default is

function(image, src) {
  image.getImage().src = src;
}

Providing a custom imageLoadFunction can be useful to load images with post requests or - in general - through XHR requests, where the src of the image element would be set to a data URI when the content is loaded.

ol.LoadingStrategy()

src/ol/typedefs.js, line 311

A function that takes an ol.Extent and a resolution as arguments, and returns an array of ol.Extent with the extents to load. Usually this is one of the standard ol.loadingstrategy strategies.

ol.Pixel{Array.<number>}

An array with two elements, representing a pixel. The first element is the x-coordinate, the second the y-coordinate of the pixel.

ol.PreRenderFunction()

src/ol/typedefs.js, line 375

Function to perform manipulations before rendering. This function is called with the ol.Map as first and an optional olx.FrameState as second argument. Return true to keep this function for the next frame, false to remove it.

ol.ProjectionLike{ol.proj.Projection} {string} {undefined}

A projection as ol.proj.Projection, SRS identifier string or undefined.

ol.RasterOperation()

src/ol/typedefs.js, line 403

A function that takes an array of input data, performs some operation, and returns an array of ouput data. For pixel type operations, the function will be called with an array of pixels, where each pixel is an array of four numbers ([r, g, b, a]) in the range of 0 - 255. It should return a single pixel array. For 'image' type operations, functions will be called with an array of https://developer.mozilla.org/en-US/docs/Web/API/ImageData and should return a single https://developer.mozilla.org/en-US/docs/Web/API/ImageData. The operations are called with a second "data" argument, which can be used for storage. The data object is accessible from raster events, where it can be initialized in "beforeoperations" and accessed again in "afteroperations".

ol.RasterOperationType{string}

Raster operation type. Supported values are 'pixel' and 'image'.

ol.RendererType{string}

Available renderers: 'canvas' or 'webgl'.

ol.SelectFilterFunction()

src/ol/typedefs.js, line 460

A function that takes an ol.Feature or ol.render.Feature and an ol.layer.Layer and returns true if the feature may be selected or false otherwise.

ol.Size{Array.<number>}

An array of numbers representing a size: [width, height].

ol.StyleFunction()

src/ol/typedefs.js, line 560

A function that takes an ol.Feature and a {number} representing the view's resolution. The function should return a ol.style.Style or an array of them. This way e.g. a vector layer can be styled.

ol.StyleGeometryFunction()

src/ol/typedefs.js, line 570

A function that takes an ol.Feature as argument and returns an ol.geom.Geometry that will be rendered and styled for the feature.

ol.TileCoord{Array.<number>}

An array of three numbers representing the location of a tile in a tile grid. The order is z, x, and y. z is the zoom level.

ol.TileLoadFunctionType()

src/ol/typedefs.js, line 597

A function that takes an ol.Tile for the tile and a {string} for the url as arguments.

ol.TileUrlFunctionType()

src/ol/typedefs.js, line 631

ol.source.Tile sources use a function of this type to get the url that provides a tile for a given tile coordinate.

This function takes an ol.TileCoord for the tile coordinate, a {number} representing the pixel ratio and an ol.proj.Projection for the projection as arguments and returns a {string} representing the tile URL, or undefined if no tile should be requested for the passed tile coordinate.

ol.TransformFunction()

src/ol/typedefs.js, line 642

A transform function accepts an array of input coordinate values, an optional output array, and an optional dimension (default should be 2). The function transforms the input coordinate values, populates the output array, and returns the output array.

ol.WFSFeatureCollectionMetadata{Object}

Number of features; bounds/extent.

ol.WFSTransactionResponse{Object}

Total deleted; total inserted; total updated; array of insert ids.