Constructs a new PanoramaModel.
The construction options for the model.
The base URL configures the location of the panoramic image server. See getPanoramicImageURL for details on how the base URL is used to construct actual image URLs.
Custom request parameters to send along with panoramic requests. The object literal can contain simple key/value pairs. Accepted values are strings, numbers and booleans. 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
.
An object literal that represents URL parameters (as a key-value map) to send with each HTTP request. If set (and not empty), an XHR with the specified query parameters will be performed instead of creating an Image.
getPanoramicImageURL 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 image description for a given panoramic context.
The context is passed from FeaturePainter.paintBody
/ GeoCanvas.drawPanorama
.
If your dataset has a mix of different panorama types (cubemap vs. single-image), or has a mix of tile structures, you should override this method and return the right descriptor for a given context.
the feature the panoramic image is for
the context of this panoramic image in the feature
a descriptor that describes
Loads a tile of a panoramic image or video.
the coordinate of the tile
a callback function that should be invoked when the image was successfully loaded The function takes three arguments: the tile request that was passed to this function, an image object and an optional content type.
a callback function that should be invoked when the image could not be loaded The function will receive two arguments, the request that was passed to this function and an optional Error object.
Optional
error: Error
Returns the URL for a specific panoramic image tile request. The default implementation of this method returns baseURL
,
replacing the patterns in the baseURL
with the ones supported by replaceURLPatterns.
the tile request
the resolved URL for the specified tile or null
if the requested tile does not exist, or no URL could be determined (for example, when baseURL is not set).
Replaces patterns in the given URL.
By default, it will replace {x}
, {y}
, {z}
, {face}
and {id}
with the values of
request.x
, request.y
, request.level
, request.face
(mapped) and feature.id
respectively.
Additionally, it will replace {context.*}
with a corresponding property on your context object.
It is not uncommon that the tile rows are seem to be reversed in the visualisation. This means that the
Y-axis in the tile coordinate system of the tile service is reversed with respect to the tile coordinate
system used by LuciadRIA. You can use the {-y}
placeholder in the baseURL to compensate for this.
If the URL contains the {s}
subdomains hook, replaceURLPatterns will replace the hook
with one of the values of subdomains.
The URL that contains the patterns to replace.
The request for the panoramic image
The URL with its patterns replaced, or null if no replacement could be made. This can happen when the URL is null, or no panorama descriptor could be found for the request (getPanoramaDescriptor returns null).
A model that describes (multileveled) panoramas.
This model is similar to a UrlTileSetModel. The difference is that this model fetches panoramic imagery, instead of 2D rasters. This model is assigned to FeaturePainter you decide for what geometry or feature you want to show panoramic images (using GeoCanvas.drawPanorama.
Since
2020.1