new VTileLayer(url, optionsopt) → {VTileLayer}
Create a layer with tiled image data queried from a VisiOmatic server.
Parameters
-
url
string
URL 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.s
sexagesimal 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
number
Brightness level.
-
contrast
number
Contrast factor.
-
colorSaturation
number
Color saturation for multi-channel data (0.0: B&W, >1.0: enhance).
-
gamma
number
Display 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
number
JPEG 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
number
Default 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
-
VTileLayer
VisiOmatic 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
string
Image name (e.g., a filename).
-
objectName
string
Object name.
-
imageSize
Array.<Array.<number>>
Image sizes at every resolution.
-
gridSize
Array.<object>
Grid sizes at every resolution.
-
bpp
number
Image depth in bits per pixel.
-
mixingMode
string
Current color mixing mode (
'mono'
or'color'
). -
channel
number
Current image channel index.
-
nChannel
number
Number of image channels.
-
minZoom
number
Minimum zoom factor (tile resolution).
-
maxZoom
number
Maximum zoom factor (tile resolution).
-
brightness
number
Current image brightness level.
-
contrast
number
Current image contrast factor.
-
colorSaturation
number
Current image color saturation.
-
gamma
number
Current image display gamma.
-
cMap
string
Current color map.
-
invertCMap
boolean
Current 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.
-
channelFlags
Array.<boolean>
Display activation flag for every channel.
-
channelUnits
Array.<string>
Pixel value unit for every image channel.
-
quality
number
Current JPEG encoding quality in %.
-
framerate
number
Current animation framerate.
Source
visioDefaultobject
Default server rendering parameters (to shorten tile query strings).
Type
-
object
Properties
-
brightness
number
Default brightness level.
-
contrast
number
Default contrast factor.
-
colorSaturation
number
Default image color saturation.
-
gamma
number
Default display gamma.
-
cMap
string
Default colormap.
-
invertCMap
boolean
Default 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
number
Default JPEG encoding quality.
-
framerate
number
Default animation framerate.
Source
Methods
_addToMap(map)
Executed once the layer to be added to the map is ready.
Parameters
-
map
object
Leaflet map to add the layer to.
Source
_gammaCorr(val) → {number}
Apply gamma expansion to the provided input value.
Parameters
-
val
number
Input value.
Returns
-
number
gamma-compressed value.
Source
_initTile(tile)
Initialize a tile.
Parameters
-
tile
object
The tile.
Source
_isValidTile(coords) → {boolean}
Tell if a tile at the given coordinates should be loaded.
Parameters
-
coords
point
Tile coordinates.
Returns
-
boolean
true
if tile should be loaded,false
otherwise.
Source
_readVisioKey(str, keyword, regexp) → {*}
Decode the input string as a 'keyword:value' pair.
Parameters
-
str
string
Input string.
-
keyword
string
Input keyword.
-
regexp
string
Regular expression for decoding the value.
Deprecated
- since version 3.0
Returns
-
*
Decoded output.
Source
_refreshTileUrl(tile, url)
Replace a tile.
Parameters
-
tile
object
The tile.
-
url
string
The tile URL.
Source
_setAttr(attr, value, fnopt)
Update layer attribute and redraw layer content.
Parameters
-
attr
string
Name 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
object
Leaflet 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
point
Tile coordinates.
-
done
boolean
Callback function called when the tile has been loaded.
Returns
-
object
The new tile.
Source
getChannelColor(channel) → {string}
Get color for the given channel.
Parameters
-
channel
number
Input channel.
Returns
-
string
color string.
Source
getMetaData(url)
Get metadata describing the tiled image at the provided URL.
Parameters
-
url
string
The full tile URL.
Fires
- event:metaload
Source
getTileSettingsURL() → {string}
Generate the settings part of a tile query URL based on current settings.
Returns
-
string
The tile settings URL.
Source
getTileUrl(coords) → {string}
Generate a tile URL from its coordinates
Parameters
-
coords
point
Tile coordinates.
Returns
-
string
The 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
number
Input channel.
-
rgb
RGB
|false
RGB 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
VTileLayer
VisiOmatic 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.