Class: MapLayer

alk.layer.MapLayer

An instance of this class is to be used for the map (i.e. lowest) layer in an ol.Map. This layer gets provides base map layers to ALK raster map tiles.

new alk.layer.MapLayer(opt_options)

This constructor creates an Openlayers compatible ol.Layer for an {ol.Map} that provides ALK raster map tiles specific to the supplied ALK style option.

Along with the style, region, dataset, and apiKey options, which pertain to the particular ALK service alk.service.MapTileService, this constructor also takes options pertaining to OpenLayers ol.Layer, i.e. alkx.BaseMapLayerOptions.

Option Type Description
apiKey string

This option contains the ALK ApiKey that gives you permission to extract data from ALK Servers.

style alk.val.Style | number | string

This option tells the service the style of map that is requested. ALK has a number of different map styles, such as alk.val.Style.Night, and alk.val.Style.Terrain.

region alk.val.Region | number | string

This option tells the service in which region the retrieved data is to pertain. Some ALK Services switch underlying services due to this option. For instance, traffic data for North America and Europe may come from different underlying services.

dataset alk.val.Dataset | number | string

The option contains the Dataset parameter for the Service. This option specifies an area dataset that may be pertinent to the request.

sourceOptions alkx.BaseMapSourceOptions | undefined

This option provides the extra options to create the alk.source.BaseMapSource source and its alk.service.MapTileService service that will supply the URL to get the base map layer tiles.

opacity number | undefined

This option is an OpenLayer Vector Layer Option.

Opacity (0, 1). Default is 1.

preload number | undefined

This option is an OpenLayer Vector Layer Option.

Preload. Load low-resolution tiles up to preload levels. By default preload is 0, which means no preloading.

map ol.PluggableMap | undefined

This option is an OpenLayer Vector Layer Option.

Sets the layer as overlay on a map. The map will not manage this layer in its layers collection, and the layer will be rendered on top. This is useful for temporary layers. The standard way to add a layer to a map and have it managed by the map is to use ol.Map#addLayer.

visible boolean | undefined

This option is an OpenLayer Vector Layer Option.

Visibility. Default is true (visible).

extent ol.Extent | undefined

This option is an OpenLayer Vector Layer Option.

The bounding extent for layer rendering. The layer will not be rendered outside of this extent.

minResolution number | undefined

This option is an OpenLayer Vector Layer Option.

The minimum resolution (inclusive) at which this layer will be visible.

maxResolution number | undefined

This option is an OpenLayer Vector Layer Option.

The maximum resolution (exclusive) below which this layer will be visible.

useInterimTilesOnError boolean | undefined

This option is an OpenLayer Vector Layer Option.

Use interim tiles on error. Default is true.

zIndex number | undefined

This option is an OpenLayer Vector Layer Option.

The z-index for layer rendering. At rendering time, the layers will be ordered, first by Z-index and then by position. The default Z-index is 0.

Example
var map = new ol.Map();
var mapLayer = new alk.layer.MapLayer({
  style: alk.val.Style.Satellite,
  region: alk.val.Region.NA,
  dataset: alk.val.Dataset.NA,
  opacity: 0.8
})
map.addLayer(mapLayer);

Extends

  • ol.layer.Group