Type: (url: URL) -> URLShortener
This function will be called in order to shorten a URL, and must return a URLShortener.
Parameter | Type | Description |
---|---|---|
url |
URL |
The URL that needs shortening. |
Note: This function might be called multiple times, or just once and its return value cached.
Type: object
Field | Type | Default | Description |
---|---|---|---|
url |
URL |
Required | The URL to send the HTTP request to. |
method |
string |
'GET' |
The request method (example 'GET' , 'POST' ). |
data |
object |
Optional | The data to be sent with the request. If provided, data will be encoded and added to the URL for 'HEAD' and 'GET' requests, or sent as the request's form data body for all other request methods. |
responseType |
ResponseType | 'text' |
How the response should be interpreted. |
callback |
ShortenerCallback | Optional | If provided, will be called with the received response as its only argument and should return the shortened URL or an Error object. Otherwise the response will be treated as the shortened URL. |
errorback |
ShortenerErrorback | Optional | If provided, will be called with the error that occurred as its only argument and should return the shortened URL or an Error object. Otherwise the error will be handled as is. |
Example
function createBitlyShortener(url) {
// For more info see http://dev.bitly.com/authentication.html#apikey
var login = '<your bitly login>';
var apiKey = '<your bitly api-key>';
return {
method: 'GET',
url: (
window.location.protocol === 'http:'
? 'http://api.bit.ly/v3/shorten'
: 'https://api-ssl.bit.ly/v3/shorten'
),
data: {longUrl: url, apiKey: apiKey, login: login},
responseType: 'json',
callback: function(response) {
if (response.status_code === 200) {
return response.data.url;
} else {
return new Error(response.status_txt);
}
},
};
}
Type: string
Possible values:
'arraybuffer'
'blob'
'json'
'text'
For more info see MDN's XMLHttpRequest.responseType.
Type: (response) -> URL | Error
Type: (error: Error) -> URL | Error
Type: (key: string) -> (group1: string|null, group2: string|null) -> number
This function receives the tag key used to group the products and must return
a function that compares the passed tag values or null
for the default group.
The comparator function should return:
- a negative number to indicate the first argument (ie.
group1
) should come before the second (ie.group2
) - a positive number to indicate the first argument (ie.
group1
) should come after the second (ie.group2
) -
zero (
0
) to indicate the first argument (ie.group1
) and the second (ie.group2
) are considered equal and thus their order remains unchanged.
Note: This function might be called multiple times, or just once and its return value cached.
Type: object
Field | Type | Default | Description |
---|---|---|---|
label |
string |
null |
The label of the group (used in the products side panel if given) |
products |
string[] |
Required | An ordered list of IDs of the products in that group |
Note: All product IDs MUST be IDs of existing products in the config.
Note: All product IDs MUST be unique (a product can be in no group or in one group and only once in that group).
Deprecation note: When
label
is notnull
, will add aGroup:${label}
tag to each one ofproducts
, if that product doesn't have aGroup
tag already.
Type: object
Field | Type | Default | Description |
---|---|---|---|
id |
string |
Required | The ID of the message used to mainly to remember if it was shown before. |
type |
MessageType | Required | The type of the message, used to style it. |
text |
string |
Required | The body of the message, it supports HTML. |
showOnce |
boolean |
false |
When set to true , once the user closes the message it will not be shown again. |
Examples
{
id: 'odyssea reprocessing from 01/07/2016 to 03/02/2017',
type: 'warning',
text: 'All Odyssea products are currently being reprocessed from July 2016 until the 3<sup>rd</sup> February 2017.',
showOnce: true,
}
{
id: 'test_info',
type: 'info',
text: 'This is an info message.',
}
{
id: 'test_warning',
type: 'warning',
text: 'This is a warning message.',
}
{
id: 'test_error',
type: 'error',
text: 'This is an error message.',
}
{
id: 'test_long',
type: 'info',
text: 'This is a loooooooooooooooooooong loooooooooooooooong loooooooooong long long loooooooooong long long loooooooooong long message.',
}
{
id: 'test_multi_lines',
type: 'info',
text: 'This is a message<br>on multiple<br>lines.',
}
{
id: 'test_multi_spaces',
type: 'info',
text: 'This is a message with lots of spaces.',
}
Type: string
Possible values:
'info'
'warning'
'error'
Type: string
or object
Can be found by Right-Clicking a hotspot item (from the "Hotspots" panel) and choosing "Copy link address" (or equivalent).
Note: Not to be confused with a share permalink (or a live URL).
Note: Not to be confused with a short link.
Example
'?name=Chlorophyll%20A%20and%20Globcurrent%20%40%20Agulhas%20region&date=1412426592000×pan=1d%3B1w&products=900913_Chlorophyll_a_concentration_VIIRS,900913_GlobCurrent_L4_geostrophic_streamline&extent=768344.98869256,-5048359.949897,4280779.311964,-3243223.0901656&opacity=100,50&stackLevel=50,90'
Field | Type | Default | Description |
---|---|---|---|
name |
string |
Required | The name shown in the "Hotspots" panel |
description |
URL |
Optional | A URL of a description page |
date |
Date or integer >= 0
|
Optional | If provided, the date of the hotspot or the date in milliseconds since 1 January 1970 UTC |
extent |
number[4] |
Optional | The extent of the viewport defined as [left, bottom, right, top] all in the projection projection . |
timespan |
Timespan | Optional | The timespan used |
zoom |
integer >= 0 |
Optional | The zoom level |
products |
string[] |
Optional | A list of product ids |
opacity |
number[] |
Optional | A list of product opacities |
stackLevel |
number[] |
Optional | A list of product stack levels |
pattern |
string[] |
Optional | A list of product filtering patterns |
Example
{
name: 'Chlorophyll A and Globcurrent @ Agulhas region',
date: 1412426592000, // 2014-10-04T12:43:12.000Z
extent: [768344.98869256, -5048359.949897, 4280779.311964, -3243223.0901656],
timespan: '1d',
zoom: 3,
products: [
'900913_Chlorophyll_a_concentration_VIIRS',
'900913_GlobCurrent_L4_geostrophic_streamline',
],
opacity: [100, 50],
stackLevel: [50, 90],
}
Type: OpenLayers.Layer
For more info see OpenLayers 2's official documentation.
Examples
new OpenLayers.Layer.Google('Google Satellite', {
type: google.maps.MapTypeId.SATELLITE,
numZoomLevels: 20,
maxExtent: new OpenLayers.Bounds(maxExtent),
}),
new OpenLayers.Layer.Google('Google Streets', {
type: google.maps.MapTypeId.ROADMAP,
numZoomLevels: 22,
maxExtent: new OpenLayers.Bounds(maxExtent),
}),
Type: [string, Timespan, boolean]
or [string, Timespan]
The elements of the tuple are as follows:
- The label of the time range.
- The width of the time range.
-
true
if the time range should be selected by default, otherwisefalse
.
For more info see Timeline.
Examples
['6-Hour', '6h']
['Daily', '1d', true]
Type: string
<Timespan> ::= ( <number> <unit> )+
<number> ::= <a positive decimal number>
<unit> ::= "s" # second
| "M" # minute
| "h" # hour
| "d" # day
| "w" # week
| "m" # month
| "y" # year
| "D" # decade
| "c" # century
Examples
-
'6h'
6 hours timespan -
'1m'
1 month timespan -
'1m3d'
1 month and 3 days timespan
Type: (url: URL) -> ImportPolicy
The function that will be called
for each URL that needs to be imported automatically to determine if that operation should be allowed, denied, or otherwise the user should be asked with a prompt (the default).
If a function is provided, it will be called in order to determine the import policy for the given URL, and must return a ImportPolicy.
Parameter | Type | Description |
---|---|---|
url |
URL |
The URL that is about to be imported automatically. |
Note: This function might be called multiple times, or just once and its return value cached.
Example
function importFromSEAShotOnly(url) {
if (url.origin === 'https://seashot.odl.bzh') {
return 'allow';
}
return 'deny';
}
Type: string
Possible values:
'allow'
'deny'
'ask'
Type: string
See MDN's CSS Color, note that only a restricted subset of formats are supported:
-
#RRGGBB
withRR
,GG
andBB
being 2-digit hexadecimal numbers. -
#RGB
withR
,G
andB
being 1-digit hexadecimal numbers. -
rgb(red, green, blue)
withred
,green
andblue
being integers between0
and255
. -
rgba(red, green, blue, alpha)
withred
,green
andblue
being integers between0
and255
andalpha
between0
and1
.
Examples
-
#FF0000
is red -
#F00
is red -
rgb(255, 0, 0)
is red -
rgba(255, 0, 0, 0.5)
is red with 50% opacity.
Type: object
Field | Type | Default | Description |
---|---|---|---|
label |
string |
Optional | The label, if any, to be shown with the colormap. Useful in case of multiple colormaps for the same product. |
colorPalette |
URL |
Required | The URL of the color palette to be used. For more info see the Color Palettes section. |
ticks |
ColormapTick[] | Required | The list of tick positions and values or labels to be placed on the colormap. |
The following helper functions are for creating a colormap tick list in certain patterns:
Example
{
// use the "yellow" to "red" color palette
colorPalette: 'images/palettes/yellow_red.cpt',
// with ticks `0` at the left, `0.35` at the right,
// and intermediate ticks for every `0.05` increments
ticks: makeDeltaTicks(0, 0.35, 0.05),
}
Type: [number ∈ [0, 1], number | string]
The elements of the tuple are as follows:
- The relative position of the tick on the colormap (
0
being the minimum and1
the maximum). - The value at the position of the tick as
number
or the label asstring
.
Note: Values of type
number
may be used in the future to calculate the value-under-cursor.
Examples
-
[0, -1]
places at tick at the minimum with a value of-1
-
[0.5, 2]
places at tick at the middle with a value of2
-
[1, 5]
places at tick at the maximum with a value of5
-
[0, 'min']
places at tick at the minimum labeled "min" -
[0.5, '']
places at tick at the maximum without any label -
[1, 'max']
places at tick at the maximum labeled "max"
A color palette is a sequence of colors in a specific order over a range of values. With three special colors:
- The underflow color used to represent values smaller than the minimum.
- The overflow color used to represent values bigger than the maximum.
- The null color used to represent
NaN
values.
Supported formats:
- RGB
- A list of new line separated triplets of red, green and blue.
- The values of each triplet are separated by white space.
- The values of each triplet are whole numbers between
0
and255
. - The resulting color palette is made up of segments equal in length and who's color corresponds to its respective triplet.
- The underflow color is the first color.
- The overflow color is the last color.
- The null color is transparent.
- PNG
- A PNG image of which only the first row of pixels is used.
- The resulting color palette is made up of segments equal in length and who's color corresponds to its respective pixel.
- The underflow color is the first color.
- The overflow color is the last color.
- The null color is transparent.
- CPT (Color Palette Table)
- See CPT Reference.
- Only RGB color model is supported.
- Only Regular CPTs are supported.
- If no underflow color (B) is specified, the first color will be used.
- If no overflow color (F) is specified, the last color will be used.
- If no null color (N) is specified, transparent will be used.