This class should not be instantiated by users of LuciadRIA.
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.
The base URL configures the location of the tile server. Please refer to getTileURL for details on how the base URL is used to obtain tiles.
The base URL configures the location of the tile server. Please refer to getTileURL for details on how the base URL is used to obtain tiles.
Indicates whether or not credentials should be included with HTTP requests.
Set this to true if the server requires credentials, like HTTP basic authentication headers or cookies.
You should disable credentials if the server is configured to allow cross-origin requests from all domains (Acces-Control-Allow-Origin=*
).
If the server allows CORS requests from all domains, the browser will block all requests where credentials=true
.
Once set, all subsequent HTTP requests will use the newly set value.
The default value is false
.
Indicates whether or not credentials should be included with HTTP requests.
Set this to true if the server requires credentials, like HTTP basic authentication headers or cookies.
You should disable credentials if the server is configured to allow cross-origin requests from all domains (Acces-Control-Allow-Origin=*
).
If the server allows CORS requests from all domains, the browser will block all requests where credentials=true
.
Once set, all subsequent HTTP requests will use the newly set value.
The default value is false
.
Returns the data type of this RasterTileSetModel.
The number of available detail levels. Level 0 is the coarsest level.
Headers to send with every HTTP request.
An object literal that represents the headers to send with every HTTP request. The property names represent HTTP header names, the property values represent the HTTP header values. This property can be set dynamically (post-construction). Once set, all subsequent HTTP requests will use the newly set headers.
Note that when custom headers are being sent to a server on another domain, the server will have to properly
respond to pre-flight CORS requests (a HTTP OPTION request sent by the browser before doing the actual request).
The server has to indicate that the header can be used in the actual request, by including it in
the pre-flight's Access-Control-Allow-Headers
response header.
The default value is null
.
Headers to send with every HTTP request.
An object literal that represents the headers to send with every HTTP request. The property names represent HTTP header names, the property values represent the HTTP header values. This property can be set dynamically (post-construction). Once set, all subsequent HTTP requests will use the newly set headers.
Note that when custom headers are being sent to a server on another domain, the server will have to properly
respond to pre-flight CORS requests (a HTTP OPTION request sent by the browser before doing the actual request).
The server has to indicate that the header can be used in the actual request, by including it in
the pre-flight's Access-Control-Allow-Headers
response header.
The default value is null
.
Custom request parameters to send along with tile request. The object literal can contain simple key/value pairs. Accepted values are strings, numbers and booleans. A ProgrammingError will be thrown if values of another type are used. Values must not be URL encoded.
Assignments of other values than object literals to requestParameters
will throw an Error. Clearing
the parameters can be done by assigning null
or an empty object literal to
requestParameters
. In order to trigger a refresh of the
visualization on the map, can call invalidate.
Custom request parameters to send along with tile request. The object literal can contain simple key/value pairs. Accepted values are strings, numbers and booleans. A ProgrammingError will be thrown if values of another type are used. Values must not be URL encoded.
Assignments of other values than object literals to requestParameters
will throw an Error. Clearing
the parameters can be done by assigning null
or an empty object literal to
requestParameters
. In order to trigger a refresh of the
visualization on the map, can call invalidate.
Returns the sampling mode of this RasterTileSetModel.
getTileURL will replace the {s}
pattern in baseURL
with
values from subdomains
. This will cause tile requests to be spread across different
subdomains. Browsers limit the amount of connections to a single domain. Using
subdomains
avoids hitting this limit.
The subdomains
array cannot be empty if the model's baseURL contains the {s}
subdomain hook.
getTileURL will replace the {s}
pattern in baseURL
with
values from subdomains
. This will cause tile requests to be spread across different
subdomains. Browsers limit the amount of connections to a single domain. Using
subdomains
avoids hitting this limit.
The subdomains
array cannot be empty if the model's baseURL contains the {s}
subdomain hook.
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.
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.
A tileset model that can access tiles from HERE's map rendering services. Its constructor should not be called directly. Instead, use the static create method:
async function createHereMapsLayer(): Promise<RasterTileSetLayer> { const model = await createHereMapsTileSetModel({ apiKey: HERE_MAPS_API_KEY, base: "aerial", type: "maptile", scheme: "hybrid.day" }); return new RasterTileSetLayer(model, { label: "HERE Maps", layerType: LayerType.BASE, id: "HERE" }); }
2021.1