Namespace: olx

olx

Namespaces

animation
control
format
interaction
layer
parser
render
source
style
tilegrid

Type Definitions

olx.AnimationOptions{Object}

Properties:
Name Type Argument Description
center ol.Coordinate | undefined <optional>

The center of the view at the end of the animation.

zoom number | undefined <optional>

The zoom level of the view at the end of the animation. This takes precedence over resolution.

resolution number | undefined <optional>

The resolution of the view at the end of the animation. If zoom is also provided, this option will be ignored.

rotation number | undefined <optional>

The rotation of the view at the end of the animation.

anchor ol.Coordinate | undefined <optional>

Optional anchor to remained fixed during a rotation or resolution animation.

duration number | undefined <optional>

The duration of the animation in milliseconds (defaults to 1000).

easing undefined | function <optional>

The easing function used during the animation (defaults to ol.easing.inAndOut). The function will be called for each frame with a number representing a fraction of the animation's duration. The function should return a number between 0 and 1 representing the progress toward the destination state.

olx.AtPixelOptions{Object}

Object literal with options for the ol.Map#forEachFeatureAtPixel and ol.Map#hasFeatureAtPixel methods.

Properties:
Name Type Argument Description
layerFilter function | undefined <optional>

Layer filter function. The filter function will receive one argument, the layer-candidate and it should return a boolean value. Only layers which are visible and for which this function returns true will be tested for features. By default, all visible layers will be tested.

hitTolerance number | undefined <optional>

Hit-detection tolerance in pixels. Pixels inside the radius around the given position will be checked for features. This only works for the canvas renderer and not for WebGL. Default is 0.

olx.AttributionOptions{Object}

Properties:
Name Type Description
html string

HTML markup for this attribution. Required.

olx.CollectionOptions{Object}

Properties:
Name Type Argument Description
unique boolean | undefined <optional>

Disallow the same item from being added to the collection twice. Default is false.

olx.DeviceOrientationOptions{Object}

Properties:
Name Type Argument Description
tracking boolean | undefined <optional>

Start tracking. Default is false.

olx.FrameState{Object}

Properties:
Name Type Description
pixelRatio number

Required.

time number

Required.

viewState olx.ViewState

Required.

olx.GeolocationOptions{Object}

Properties:
Name Type Argument Description
tracking boolean | undefined <optional>

Start Tracking. Default is false.

trackingOptions GeolocationPositionOptions | undefined <optional>

Tracking options. See http://www.w3.org/TR/geolocation-API/#position_options_interface.

projection ol.ProjectionLike

The projection the position is reported in.

olx.GraticuleOptions{Object}

Properties:
Name Type Argument Description
map ol.Map | undefined <optional>

Reference to an ol.Map object.

maxLines number | undefined <optional>

The maximum number of meridians and parallels from the center of the map. The default value is 100, which means that at most 200 meridians and 200 parallels will be displayed. The default value is appropriate for conformal projections like Spherical Mercator. If you increase the value more lines will be drawn and the drawing performance will decrease.

strokeStyle ol.style.Stroke | undefined <optional>

The stroke style to use for drawing the graticule. If not provided, the lines will be drawn with rgba(0,0,0,0.2), a not fully opaque black.

targetSize number | undefined <optional>

The target size of the graticule cells, in pixels. Default value is 100 pixels.

showLabels boolean | undefined <optional>

Render a label with the respective latitude/longitude for each graticule line. Default is false.

lonLabelFormatter undefined | function <optional>

Label formatter for longitudes. This function is called with the longitude as argument, and should return a formatted string representing the longitude. By default, labels are formatted as degrees, minutes, seconds and hemisphere.

latLabelFormatter undefined | function <optional>

Label formatter for latitudes. This function is called with the latitude as argument, and should return a formatted string representing the latitude. By default, labels are formatted as degrees, minutes, seconds and hemisphere.

lonLabelPosition number | undefined <optional>

Longitude label position in fractions (0..1) of view extent. 0 means at the bottom of the viewport, 1 means at the top. Default is 0.

latLabelPosition number | undefined <optional>

Latitude label position in fractions (0..1) of view extent. 0 means at the left of the viewport, 1 means at the right. Default is 1.

lonLabelStyle ol.style.Text | undefined <optional>

Longitude label text style. The default is

new ol.style.Text({
  font: '12px Calibri,sans-serif',
  textBaseline: 'bottom',
  fill: new ol.style.Fill({
    color: 'rgba(0,0,0,1)'
  }),
  stroke: new ol.style.Stroke({
    color: 'rgba(255,255,255,1)',
    width: 3
  })
});

Note that the default's textBaseline configuration will not work well for lonLabelPosition configurations that position labels close to the top of the viewport.

latLabelStyle ol.style.Text | undefined <optional>

Latitude label text style. The default is

new ol.style.Text({
  font: '12px Calibri,sans-serif',
  textAlign: 'end',
  fill: new ol.style.Fill({
    color: 'rgba(0,0,0,1)'
  }),
  stroke: new ol.style.Stroke({
    color: 'rgba(255,255,255,1)',
    width: 3
  })
});

Note that the default's textAlign configuration will not work well for latLabelPosition configurations that position labels close to the left of the viewport.

olx.LogoOptions{Object}

Object literal with config options for the map logo.

Properties:
Name Type Description
href string

Link url for the logo. Will be followed when the logo is clicked. Required.

src string

Image src for the logo. Required.

olx.MapOptions{Object}

Object literal with config options for the map.

Properties:
Name Type Argument Description
controls ol.Collection.<ol.control.Control> | Array.<ol.control.Control> | undefined <optional>

Controls initially added to the map. If not specified, ol.control.defaults() is used.

pixelRatio number | undefined <optional>

The ratio between physical pixels and device-independent pixels (dips) on the device. If undefined then it gets set by using window.devicePixelRatio.

interactions ol.Collection.<ol.interaction.Interaction> | Array.<ol.interaction.Interaction> | undefined <optional>

Interactions that are initially added to the map. If not specified, ol.interaction.defaults() is used.

keyboardEventTarget Element | Document | string | undefined <optional>

The element to listen to keyboard events on. This determines when the KeyboardPan and KeyboardZoom interactions trigger. For example, if this option is set to document the keyboard interactions will always trigger. If this option is not specified, the element the library listens to keyboard events on is the map target (i.e. the user-provided div for the map). If this is not document the target element needs to be focused for key events to be emitted, requiring that the target element has a tabindex attribute.

layers Array.<ol.layer.Base> | ol.Collection.<ol.layer.Base> | undefined <optional>

Layers. If this is not defined, a map with no layers will be rendered. Note that layers are rendered in the order supplied, so if you want, for example, a vector layer to appear on top of a tile layer, it must come after the tile layer.

loadTilesWhileAnimating boolean | undefined <optional>

When set to true, tiles will be loaded during animations. This may improve the user experience, but can also make animations stutter on devices with slow memory. Default is false.

loadTilesWhileInteracting boolean | undefined <optional>

When set to true, tiles will be loaded while interacting with the map. This may improve the user experience, but can also make map panning and zooming choppy on devices with slow memory. Default is false.

logo boolean | string | olx.LogoOptions | Element | undefined <optional>

The map logo. A logo to be displayed on the map at all times. If a string is provided, it will be set as the image source of the logo. If an object is provided, the src property should be the URL for an image and the href property should be a URL for creating a link. If an element is provided, the element will be used. To disable the map logo, set the option to false. By default, the OpenLayers logo is shown.

moveTolerance number | undefined <optional>

The minimum distance in pixels the cursor must move to be detected as a map move event instead of a click. Increasing this value can make it easier to click on the map. Default is 1.

overlays ol.Collection.<ol.Overlay> | Array.<ol.Overlay> | undefined <optional>

Overlays initially added to the map. By default, no overlays are added.

renderer ol.renderer.Type | Array.<ol.renderer.Type> | undefined <optional>

Renderer. By default, Canvas and WebGL renderers are tested for support in that order, and the first supported used. Specify a ol.renderer.Type here to use a specific renderer. Note that the Canvas renderer fully supports vector data, but WebGL can only render Point geometries.

target Element | string | undefined <optional>

The container for the map, either the element itself or the id of the element. If not specified at construction time, ol.Map#setTarget must be called for the map to be rendered.

view ol.View | undefined <optional>

The map's view. No layer sources will be fetched unless this is specified at construction time or through ol.Map#setView.

olx.OverlayOptions{Object}

Object literal with config options for the overlay.

Properties:
Name Type Argument Description
id number | string | undefined <optional>

Set the overlay id. The overlay id can be used with the ol.Map#getOverlayById method.

element Element | undefined <optional>

The overlay element.

offset Array.<number> | undefined <optional>

Offsets in pixels used when positioning the overlay. The first element in the array is the horizontal offset. A positive value shifts the overlay right. The second element in the array is the vertical offset. A positive value shifts the overlay down. Default is [0, 0].

position ol.Coordinate | undefined <optional>

The overlay position in map projection.

positioning ol.OverlayPositioning | string | undefined <optional>

Defines how the overlay is actually positioned with respect to its position property. Possible values are 'bottom-left', 'bottom-center', 'bottom-right', 'center-left', 'center-center', 'center-right', 'top-left', 'top-center', and 'top-right'. Default is 'top-left'.

stopEvent boolean | undefined <optional>

Whether event propagation to the map viewport should be stopped. Default is true. If true the overlay is placed in the same container as that of the controls (CSS class name ol-overlaycontainer-stopevent); if false it is placed in the container with CSS class name ol-overlaycontainer.

insertFirst boolean | undefined <optional>

Whether the overlay is inserted first in the overlay container, or appended. Default is true. If the overlay is placed in the same container as that of the controls (see the stopEvent option) you will probably set insertFirst to true so the overlay is displayed below the controls.

autoPan boolean | undefined <optional>

If set to true the map is panned when calling setPosition, so that the overlay is entirely visible in the current viewport. The default is false.

autoPanAnimation olx.OverlayPanOptions | undefined <optional>

The animation options used to pan the overlay into view. This animation is only used when autoPan is enabled. A duration and easing may be provided to customize the animation.

autoPanMargin number | undefined <optional>

The margin (in pixels) between the overlay and the borders of the map when autopanning. The default is 20.

olx.OverlayPanOptions{Object}

Properties:
Name Type Description
duration number | undefined

The duration of the animation in milliseconds. Default is 1000.

easing undefined | function

The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.inAndOut.

olx.ProjectionOptions{Object}

Object literal with config options for the projection.

Properties:
Name Type Argument Description
code string

The SRS identifier code, e.g. EPSG:4326. Required.

units ol.proj.Units | string | undefined <optional>

Units. Required unless a proj4 projection is defined for code.

extent ol.Extent | undefined <optional>

The validity extent for the SRS.

axisOrientation string | undefined <optional>

The axis orientation as specified in Proj4. The default is enu.

global boolean | undefined <optional>

Whether the projection is valid for the whole globe. Default is false.

metersPerUnit number | undefined <optional>

The meters per unit for the SRS. If not provided, the units are used to get the meters per unit from the ol.proj.METERS_PER_UNIT lookup table.

worldExtent ol.Extent | undefined <optional>

The world extent for the SRS.

getPointResolution function | undefined <optional>

Function to determine resolution at a point. The function is called with a {number} view resolution and an {ol.Coordinate} as arguments, and returns the {number} resolution at the passed coordinate. If this is undefined, the default ol.proj#getPointResolution function will be used.

olx.ViewOptions{Object}

Object literal with config options for the view.

Properties:
Name Type Argument Description
center ol.Coordinate | undefined <optional>

The initial center for the view. The coordinate system for the center is specified with the projection option. Default is undefined, and layer sources will not be fetched if this is not set.

constrainRotation boolean | number | undefined <optional>

Rotation constraint. false means no constraint. true means no constraint, but snap to zero near zero. A number constrains the rotation to that number of values. For example, 4 will constrain the rotation to 0, 90, 180, and 270 degrees. The default is true.

enableRotation boolean | undefined <optional>

Enable rotation. Default is true. If false a rotation constraint that always sets the rotation to zero is used. The constrainRotation option has no effect if enableRotation is false.

extent ol.Extent | undefined <optional>

The extent that constrains the center, in other words, center cannot be set outside this extent. Default is undefined.

maxResolution number | undefined <optional>

The maximum resolution used to determine the resolution constraint. It is used together with minResolution (or maxZoom) and zoomFactor. If unspecified it is calculated in such a way that the projection's validity extent fits in a 256x256 px tile. If the projection is Spherical Mercator (the default) then maxResolution defaults to 40075016.68557849 / 256 = 156543.03392804097.

minResolution number | undefined <optional>

The minimum resolution used to determine the resolution constraint. It is used together with maxResolution (or minZoom) and zoomFactor. If unspecified it is calculated assuming 29 zoom levels (with a factor of 2). If the projection is Spherical Mercator (the default) then minResolution defaults to 40075016.68557849 / 256 / Math.pow(2, 28) = 0.0005831682455839253.

maxZoom number | undefined <optional>

The maximum zoom level used to determine the resolution constraint. It is used together with minZoom (or maxResolution) and zoomFactor. Default is 28. Note that if minResolution is also provided, it is given precedence over maxZoom.

minZoom number | undefined <optional>

The minimum zoom level used to determine the resolution constraint. It is used together with maxZoom (or minResolution) and zoomFactor. Default is 0. Note that if maxResolution is also provided, it is given precedence over minZoom.

projection ol.ProjectionLike

The projection. Default is EPSG:3857 (Spherical Mercator).

resolution number | undefined <optional>

The initial resolution for the view. The units are projection units per pixel (e.g. meters per pixel). An alternative to setting this is to set zoom. Default is undefined, and layer sources will not be fetched if neither this nor zoom are defined.

resolutions Array.<number> | undefined <optional>

Resolutions to determine the resolution constraint. If set the maxResolution, minResolution, minZoom, maxZoom, and zoomFactor options are ignored.

rotation number | undefined <optional>

The initial rotation for the view in radians (positive rotation clockwise). Default is 0.

zoom number | undefined <optional>

Only used if resolution is not defined. Zoom level used to calculate the initial resolution for the view. The initial resolution is determined using the ol.View#constrainResolution method.

zoomFactor number | undefined <optional>

The zoom factor used to determine the resolution constraint. Default is 2.

olx.ViewState{Object}

Properties:
Name Type Description
center ol.Coordinate

Required.

projection ol.proj.Projection

Required.

resolution number

Required.

rotation number

Required.