Module: ol/source/OSM

ol/source/OSM


Classes

OSM

Members

module:ol/source/OSM.ATTRIBUTION{string}

The attribution containing a link to the OpenStreetMap Copyright and License page.

Type Definitions

Options{Object}

Properties:
Name Type Argument Default Description
attributions module:ol/source/Source~AttributionLike <optional>

Attributions.

cacheSize number <optional>

Initial tile cache size. Will auto-grow to hold at least the number of tiles in the viewport.

crossOrigin null | string <optional>
'anonymous'

The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.

imageSmoothing boolean <optional>
true

Enable image smoothing.

maxZoom number <optional>
19

Max zoom.

opaque boolean <optional>
true

Whether the layer is opaque.

reprojectionErrorThreshold number <optional>
0.5

Maximum allowed reprojection error (in pixels). Higher values can increase reprojection performance, but decrease precision.

tileLoadFunction module:ol/Tile~LoadFunction <optional>

Optional function to load a tile given a URL. The default is

function(imageTile, src) {
  imageTile.getImage().src = src;
};
transition number <optional>
250

Duration of the opacity transition for rendering. To disable the opacity transition, pass transition: 0.

url string <optional>
'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'

URL template. Must include {x}, {y} or {-y}, and {z} placeholders.

wrapX boolean <optional>
true

Whether to wrap the world horizontally.

zDirection number | module:ol/array~NearestDirectionFunction <optional>
0

Choose whether to use tiles with a higher or lower zoom level when between integer zoom levels. See module:ol/tilegrid/TileGrid~TileGrid#getZForResolution.