Creates a new RasterTileSetModel.
a parameter hash containing the properties described below
An event indicating that this RasterTileSetModel is invalidated. Invalidated means that the underlying data for the tiled images has changed This event fires when invalidate is called.
Returns the data type of this RasterTileSetModel.
The number of available detail levels. Level 0 is the coarsest level.
Returns the sampling mode of this RasterTileSetModel.
Returns the bounds of the tile set at the specified detail level.
the requested detail level.
the bounds of the raster data at the specified detail level.
It returns null
if the level does not exist.
Loads a tile from the tileset.
the coordinate of the tile
the callback function that should be invoked when the tile was successfully loaded The function will receive two arguments, the tile coordinate that was passed to this function and an Image object.
the callback function that should be invoked when the tile could not be loaded The function will receive two arguments, the tile coordinate that was passed to this function and an optional Error object.
an AbortSignal that signals when a tile request is cancelled
Returns the pixel density of the raster data at the specified detail level. The pixel density is the number of raster elements per spatial unit , i.e. (tile pixel width) / (tile spatial width) and (tile pixel height) / (tile spatial height area), where the tile spatial dimensions are in the tilesets reference.
the requested detail level
the pixel density of the raster data at the specified detail level.
It returns null
if the level does not exist.
Returns the bounds of a given tile in the tile set. The bounds are calculated based on the model bounds and the model's tileset structure.
The tile coordinate for which you want to calculate the bounds
The bounds of the requested tile coordinate in the model's reference.
Returns the number of columns in the tile grid at the given level. Each level should have twice the number of columns of the previous one.
the level to be queried
the number of tile columns on the specified level
Loads a tile from the tileset. The default implementation of this method calls the getImage method.
The following code snippet illustrates how this method can be overridden.
model.getTileData = function(tile, onSuccess, onError) {
fetch(url).then(function(response) {
response.arrayBuffer().then(function(arrayBuffer) {
onSuccess(tile, {
data: arrayBuffer,
mimeType: "image/jpeg"
});
})
});
the coordinate of the tile
the callback function that should be invoked when the tile was successfully loaded The function will receive two arguments, the tile coordinate that was passed to this function and a TileData object.
the callback function that should be invoked when the tile could not be loaded The function will receive two arguments, the tile coordinate that was passed to this function and an optional Error object.
an AbortSignal that signals when a tile request is cancelled.
Returns the height, in pixels, of the tiles at the specified detail level. All tiles are assumed to have the same resolution.
the requested detail level
the height of the tiles at the specified detail level
Returns the number of rows in the tile grid at the given level. Each level should have twice the number of rows of the previous one.
the level to be queried
the number of tile rows on the specified level
Returns the width, in pixels, of the tiles at the specified detail level. All tiles are assumed to have the same resolution.
the requested detail level
the width of the tiles at the specified detail level
Signals that the underlying data for the tiled images has changed. If this model is added to a map using a RasterTileSetLayer, calling this method will thus trigger a refresh of the visualization.
Provides a tiled and multi-leveled view on some dataset. Applications can use the tile set to extract a limited working set from the data, which they can then visualize or otherwise process. The contents of the tiles are not specified by this interface.
A tile set knows the underlying data's bounds and reference, as well as the number of levels and the number of tile rows and columns on each level.
Elevation data must be organized using a quad-tree tile set structure.
Raster tile sets must but organized as quad-tree structures when you use them on a Canvas Map.
For a quad-tree tile set structure the expectation is:
For other tile set structures the expectation is:
The tile set interface allows: