Module: ol

This is a module that consolidates functions for integration with OpenLayers.

Methods

(async, static) createLayer(params) → {ol.layer.Image}

Obtains the layer instance that can be loaded with OpenLayers.
Parameters:
Name Type Description
params Object Conditions for obtaining an instance of {ol.layer.Image}
Properties
Name Type Attributes Default Description
ol Object Reference to the OpenLayers module. Specify OpenLayers version 7.3.0 or higher. When importing and using OpenLayers as a module, create an ol object as shown in the example below and set it to params.ol.
collection string URL of the dataset's collection.json
band string <optional>
The band names of the dataset defined in collection.json. If this is omitted, the first band defined in the dataset will be set automatically.
colorMap ColorMapObject <optional>
Color map used for visualization. If this is omitted, the settings will automatically display the range from minimum to maximum values globally using a color scale from black to white.
date Date <optional>
new Date() An Image instance will be retrieved for this date and time.
tid number <optional>
An Image instance corresponding to this timestamp ID will be obtained. Please specify either date or tid.
onloadstart module:ol.createLayer-onloadstart <optional>
function(){} Callback function executed when the map's scroll zoom is completed and data acquisition begins
onloading module:ol.createLayer-onloading <optional>
function(){} Callback function executed each time data is acquired on a tile-by-tile basis
onloadend module:ol.createLayer-onloadend <optional>
function(){} Callback function executed when data acquisition is completed
opacity number <optional>
1 Layer opacity. Please specify a value between 0 (transparent) and 1 (opaque).
projection string <optional>
"EPSG:4326" Map projection. Currently, it only supports displaying datasets in EPSG:4326 (geographic coordinates) using EPSG:3857 (Web Mercator). In that case, specify "EPSG:3857."
bilinearResampling boolean <optional>
false If true, high-precision bilinear resampling will be used. This method is necessary for differential calculations, such as deriving a slope from acquired terrain data. If false, a fast nearest neighbor method will be used.
See:
Returns:
Returns an instance of {ol.layer.Image}. For this instance, you can obtain an ImageCollection using getImageCollection and an Image using getImage. You can also switch the date and time using setDate, change the color using setColorMap, and obtain the legend using getLegend.
Type
ol.layer.Image
Example
//When importing and using OpenLayers as a module, create an ol object like the following and set it to params.ol.
import ImageCanvas from 'ol/source/ImageCanvas';
import Image from 'ol/layer/Image';

const ol = {
	"source": {
		ImageCanvas
	},
	"layer": {
		Image
	},
};
console.log(ol);

Type Definitions

createLayer-onloadend(image, progress)

This is a callback function executed when data retrieval is completed in the module:ol.createLayer.
Parameters:
Name Type Description
image Image Image instance with loading completed
progress number Progress rate expressed as a value from 0 to 100%

createLayer-onloading(progress)

This is a callback function executed while data is being retrieved in the module:ol.createLayer. It is executed each time data is read in units of tiles in COG (Cloud Optimized GeoTIFF).
Parameters:
Name Type Description
progress number Progress rate expressed as a value from 0 to 100%

createLayer-onloadstart()

This is a callback function executed in the module:ol.createLayer at the timing when the map's scroll zoom is completed and data retrieval begins.