Class: XYZSource

alk.source.XYZSource

An instance of this class takes a alk.service.Service object, which generates the XYZ URL for the OpenLayers XYZ source. It is meant to be extended.

new alk.source.XYZSource(opt_options)

This constructor is the base constructor for an XYZ Source object for accessing ALK Sources.

Important options:

service:

This option contains the alk.service.Service that will create the URL that has the {x}, {y}, {z} template in it.

attribution:

This option contains the attribution object for this source. This option is an override. Should a subclass not provide one, the service will be asked for its attribution. Should that not be provided, the default ALK attribution will be supplied.

Option Type Description
attributions ol.AttributionLike | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

Attributions.

cacheSize number | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

Cache size. Default is 2048.

crossOrigin null | string | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or 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.

logo string | olx.LogoOptions | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

Logo

opaque boolean | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

Whether the layer is opaque.

projection ol.ProjectionLike | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

This options contains the projection with which to interpret other options, such as the extent.

reprojectionErrorThreshold number | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

Maximum allowed reprojection error (in pixels). Default is 0.5. Higher values may increase reprojection performance, but decrease precision.

maxZoom number | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

Optional maximum zoom level. Default is 20 (ALK specific).

minZoom number | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

Optional minimum zoom level. Default is 0.

tileGrid ol.tilegrid.TileGrid | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

Tile Grid.

tileLoadFunction ol.TileLoadFunctionType | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

Optional function to load a tile given a URL. The default is function(imageTile, src) { imageTile.getImage().src = src; };

tilePixelRatio number | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

The pixel ratio used by the tile service. For example, if the tile service advertises 256px by 256px tiles but actually sends 512px by 512px images (for retina/hidpi devices) then tilePixelRatio should be set to 2. Default is 1.

tileSize number | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

The tile size used by the tile service. Default is [256, 256] pixels.

tileUrlFunction ol.TileUrlFunctionType | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

Optional function to get tile URL given a tile coordinate and the projection. Required if url or urls are not provided.

service alk.service.Service | undefined

This option holds the underlying ALK service used to get the tiles.

wrapX boolean | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

Whether to wrap the world horizontally. The default, undefined, is to request out-of-bounds tiles from the server. When set to false, only one world will be rendered. When set to true, tiles will be requested for one world only, but they will be wrapped horizontally to render multiple worlds.

transition number | undefined

This option is an OpenLayers option passed to the ol.source.XYZ super class of the alk.source.XYZSource object from its subclasses.

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

Subclasses

Extends

  • ol.source.XYZ

Members

This is the service that was used to create the URL. It is not used internally, and just serves as a reference.

Methods

setService(service)

This method sets the Service for this source. It generates a new URL.

Name Type Description
service alk.service.Service