Classes
Type Definitions
- 
    
    
A function that takes an
module:ol/Tile~Tilefor the tile and a{string}for the url as arguments. The default issource.setTileLoadFunction(function(tile, src) { tile.getImage().src = src; });For more fine grained control, the load function can use fetch or XMLHttpRequest and involve error handling:
import TileState from 'ol/TileState'; source.setTileLoadFunction(function(tile, src) { var xhr = new XMLHttpRequest(); xhr.responseType = 'blob'; xhr.addEventListener('loadend', function (evt) { var data = this.response; if (data !== undefined) { tile.getImage().src = URL.createObjectURL(data); } else { tile.setState(TileState.ERROR); } }); xhr.addEventListener('error', function () { tile.setState(TileState.ERROR); }); xhr.open('GET', src); xhr.send(); }); - 
    
Options{Object}
 - 
    
    
Properties:
Name Type Argument Default Description transitionnumber <optional> 
250 A duration for tile opacity transitions in milliseconds. A duration of 0 disables the opacity transition.
interpolateboolean <optional> 
false Use interpolated values when resampling. By default, the nearest neighbor is used when resampling.
 - 
    
    
module:ol/source/Tile~TileSourcesources use a function of this type to get the url that provides a tile for a given tile coordinate.This function takes an
module:ol/tilecoord~TileCoordfor the tile coordinate, a{number}representing the pixel ratio and amodule:ol/proj/Projection~Projectionfor the projection as arguments and returns a{string}representing the tile URL, or undefined if no tile should be requested for the passed tile coordinate. 
 OpenLayers