new VTileLayer(url, optionsopt) → {VTileLayer}
Create a layer with tiled image data queried from a VisiOmatic server.
Parameters
-
url
stringURL of the tile server
-
options
object<optional>
Options.
Properties
-
title
string<optional>
<nullable>
nullLayer title. Defaults to the image filename with extension removed followed by the OBJECT name if available.
-
setTitleBar
boolean<optional>
falseUpdate the document / webpage title using the layer title.
-
crs
leaflet.CRS|WCS<optional>
<nullable>
nullCoordinate Reference or World Coordinate System: extracted from the data header if available or raw pixel coordinates otherwise.
-
center
string<optional>
<nullable>
nullWorld coordinates (either in RA,Dec decimal form or in
hh:mm:ss.s±dd:mm:ss.ssexagesimal format), or any Sesame-compliant identifier defining the initial centering of the map upon layer initialization. Sexagesimal coordinates and identifier strings are sent to the Sesame resolver service for conversion to decimal coordinates. Assume x,y pixel coordinates if WCS information is missing. Defaults to image center. -
fov
number<optional>
<nullable>
nullField of View (FoV) covered by the map upon later initialization, in world coordinates (degrees, or pixel coordinates if WCS information is missing). Defaults to the full FoV.
-
minZoom
number<optional>
0Minimum zoom factor.
-
maxZoom
number<nullable>
Maximum zoom factor.
-
maxNativeZoom
number<optional>
18Maximum native zoom factor (including resampling).
-
noWrap
boolean<optional>
trueDeactivate layer wrapping.
-
brightness
numberBrightness level.
-
contrast
numberContrast factor.
-
colorSaturation
numberColor saturation for multi-channel data (0.0: B&W, >1.0: enhance).
-
gamma
numberDisplay gamma.
-
cMap
string<optional>
'grey'Colormap for single channels or channel combinations. Valid colormaps are
'grey','jet','cold'and'hot'. -
invertCMap
boolean<optional>
falseInvert Colormap or color mix (like a negative).
-
quality
numberJPEG encoding quality in percent.
-
mixingMode
string<optional>
'color'Channel mixing mode. Valid modes are
'mono'(single-channel) and'color'. -
channelColors
Array.<RGB><optional>
[]RGB contribution of each channel to the mixing matrix. Defaults to
rgb(0.,0.,1.), rgb(0.,1.,0.), rgb(1.,0.,0.), rgb(0.,0.,0.), ...] -
channelLabels
Array.<string><optional>
[]Channel labels. Defaults to
['Channel #1', 'Channel #2', ...]. -
channelLabelMatch
string<optional>
'.*'Regular expression matching the labels of channels that are given a color by default.
-
channelUnits
Array.<string><optional>
[]Channel units. Defaults to
['ADU','ADU',...]. -
minMaxValues
Array.<Array.<number>><optional>
[]Pairs of lower, higher clipping limits for every channel. Defaults to values extracted from the data header if available or
[[0.,255.], [0.,255.], ...]otherwise. -
channel
number<optional>
0Default active channel index in mono-channel mixing mode.
-
framerate
numberDefault animation framerate.
-
sesameURL
string<optional>
'https://cdsweb.u-strasbg.fr/cgi-bin/nph-sesame'URL of the Sesame resolver service.
-
credentials
string<optional>
<nullable>
nullFor future use.
-
title
Returns
-
VTileLayerVisiOmatic TileLayer instance.
Example
const map = L.map('map'),
url = '/tiles?FIF=example.fits',
layer = new VTileLayer(url, {cmap: 'jet'});
layer.addTo(map);
Source
Members
visioobject
VisiOmatic-specific TileLayer properties.
Type
-
object
Properties
-
imageName
stringImage name (e.g., a filename).
-
objectName
stringObject name.
-
imageSize
Array.<Array.<number>>Image sizes at every resolution.
-
gridSize
Array.<object>Grid sizes at every resolution.
-
bpp
numberImage depth in bits per pixel.
-
mixingMode
stringCurrent color mixing mode (
'mono'or'color'). -
channel
numberCurrent image channel index.
-
nChannel
numberNumber of image channels.
-
minZoom
numberMinimum zoom factor (tile resolution).
-
maxZoom
numberMaximum zoom factor (tile resolution).
-
brightness
numberCurrent image brightness level.
-
contrast
numberCurrent image contrast factor.
-
colorSaturation
numberCurrent image color saturation.
-
gamma
numberCurrent image display gamma.
-
cMap
stringCurrent color map.
-
invertCMap
booleanCurrent colormap inversion switch status.
-
backgroundLevel
Array.<number>Background level for every channel.
-
backgroundMAD
Array.<number>Background MAD for every channel.
-
minValue
Array.<number>Current lower clipping limit for every channel.
-
maxValue
Array.<number>Current upper clipping limit for every channel.
-
mix
Array.<Array.<number>>Current color mixing matrix.
-
rgb
Array.<RGB>Current color mixing matrix as RGB mixes.
-
channelLabels
Array.<string>Label for every image channel.
-
activeChannels
Array.<number>List of active channels.
-
channelUnits
Array.<string>Pixel value unit for every image channel.
-
quality
numberCurrent JPEG encoding quality in %.
-
framerate
numberCurrent animation framerate.
Source
visioDefaultobject
Default server rendering parameters (to shorten tile query strings).
Type
-
object
Properties
-
brightness
numberDefault brightness level.
-
contrast
numberDefault contrast factor.
-
colorSaturation
numberDefault image color saturation.
-
gamma
numberDefault display gamma.
-
cMap
stringDefault colormap.
-
invertCMap
booleanDefault colormap inversion switch.
-
minValue
Array.<number>Default lower clipping limits for channels.
-
maxValue
Array.<number>Default upper clipping limits for channels.
-
channelColors
Array.<RGB>Default color mixing matrix.
-
quality
numberDefault JPEG encoding quality.
-
framerate
numberDefault animation framerate.
Source
Methods
_addToMap(map)
Executed once the layer to be added to the map is ready.
Parameters
-
map
objectLeaflet map to add the layer to.
Source
_gammaCorr(val) → {number}
Apply gamma expansion to the provided input value.
Parameters
-
val
numberInput value.
Returns
-
numbergamma-compressed value.
Source
_initTile(tile)
Initialize a tile.
Parameters
-
tile
objectThe tile.
Source
_isValidTile(coords) → {boolean}
Tell if a tile at the given coordinates should be loaded.
Parameters
-
coords
pointTile coordinates.
Returns
-
booleantrueif tile should be loaded,falseotherwise.
Source
_readVisioKey(str, keyword, regexp) → {*}
Decode the input string as a 'keyword:value' pair.
Parameters
-
str
stringInput string.
-
keyword
stringInput keyword.
-
regexp
stringRegular expression for decoding the value.
Deprecated
- since version 3.0
Returns
-
*Decoded output.
Source
_refreshTileUrl(tile, url)
Replace a tile.
Parameters
-
tile
objectThe tile.
-
url
stringThe tile URL.
Source
_setAttr(attr, value, fnopt)
Update layer attribute and redraw layer content.
Parameters
-
attr
stringName of the (numerical) layer attribute to be updated.
-
value
*New value.
-
fn
UI~layerCallback<optional>
Optional additional callback function.
Source
addTo(map)
Add the layer to the map.
Parameters
-
map
objectLeaflet map to add the layer to.
Listens to events
- event:metaload
Source
createTile(coords, done) → {object}
Create a tile at the given coordinates.
Parameters
-
coords
pointTile coordinates.
-
done
booleanCallback function called when the tile has been loaded.
Returns
-
objectThe new tile.
Source
dispatchChannelColors(colors)
Dispatch a list of colors over active channels
Parameters
-
colors
Array.<RGB>List of colors.
Source
getChannelColor(channel) → {string}
Get color for the given channel.
Parameters
-
channel
numberInput channel.
Returns
-
stringcolor string.
Source
getMetaData(url)
Get metadata describing the tiled image at the provided URL.
Parameters
-
url
stringThe full tile URL.
Fires
- event:metaload
Source
getTileSettingsURL() → {string}
Generate the settings part of a tile query URL based on current settings.
Returns
-
stringThe tile settings URL.
Source
getTileUrl(coords) → {string}
Generate a tile URL from its coordinates
Parameters
-
coords
pointTile coordinates.
Returns
-
stringThe tile URL.
Source
redraw()
Redraw a tile without flickering.
Source
rgbToMix(channel, rgb)
Update the color mixing matrix with the RGB contribution of a given channel.
Parameters
-
channel
numberInput channel.
-
rgb
RGB|falseRGB color. False deletes the channel.
Source
setColor()
Summary
Switch the layer to 'color' mixing mode.
Description
RGB colors and saturation settings define mixing matrix elements in
'color' mode
Source
setMono()
Summary
Switch the layer to 'mono' mixing mode for the current channel.
Description
The current channel index defines the color mixing matrix elements in
'mono' mode
Source
updateMix(layer)
Summary
Update the color mixing matrix using the current color and saturation settings.
Description
RGB colors and saturation settings define mixing matrix elements in
'color' mode
Parameters
-
layer
VTileLayerVisiOmatic layer ("this" is used if not provided)
Source
Events
channelupdate
Fired when the image channel is being updated.
metaload
Fired when the image metadata have been loaded.