new RadarRenderer(map, layerId, insertBeforeId)
Parameters:
| Name | Type | Description |
|---|---|---|
map |
mapboxgl.Map | a mapbox map object |
layerId |
string | id of the layer to render the radar data |
insertBeforeId |
string | layer to insert the new layer before |
- Source:
Classes
Methods
clear()
Clear the layer (just the visibility)
- Source:
destroy()
Destroy the radar renderer and cleanup
- Source:
draw(data)
Draw the radar data on the map
Parameters:
| Name | Type | Description |
|---|---|---|
data |
RadarData |
- Source:
- See:
-
- ./types/radar-data.d.ts
generateVertices(radarData) → {Float32Array}
Generate the vertices from the radar data
Parameters:
| Name | Type | Description |
|---|---|---|
radarData |
RadarData |
- Source:
Returns:
- Type
- Float32Array
getHexColor(value) → {string}
get the hex color for a specific value
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number |
- Source:
Returns:
- Type
- string
getRGBAColor(value) → {Array.<number>}
get the RGBA color for a specific value
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number |
- Source:
Returns:
- Type
- Array.<number>
getValueAt(lngLat) → {Object}
Get the value at a specific latitude and longitude
Parameters:
| Name | Type | Description |
|---|---|---|
lngLat |
- Source:
Returns:
- Type
- Object
isPointInTriangle(pointX, pointY, ax, ay, bx, by, cx, cy) → {boolean}
Check if a point is inside a triangle
Parameters:
| Name | Type | Description |
|---|---|---|
pointX |
number | position x of the point to check |
pointY |
number | position y of the point to check |
ax |
number | position x of the first vertex of the triangle |
ay |
number | position y of the first vertex of the triangle |
bx |
number | position x of the second vertex of the triangle |
by |
number | position y of the second vertex of the triangle |
cx |
number | position x of the third vertex of the triangle |
cy |
number | position y of the third vertex of the triangle |
- Source:
Returns:
- Type
- boolean
reset()
Reset the radar renderer to its initial state, the colormap is not reset
- Source:
setColormap(colormap)
Set the colormap for the radar data, the supported colormaps are hex RRGGBB or with alpha RRGGBBAA, or an array of RGB or RGBA values
Parameters:
| Name | Type | Description |
|---|---|---|
colormap |
Array.<string> | Array.<Array.<number>> |
- Source:
setFilter(min, max)
Set a filter with the minimum and maximum values for the radar data
Parameters:
| Name | Type | Description |
|---|---|---|
min |
number | |
max |
number |
- Source:
setMinMax(min, max)
Set the minimum and maximum values for the radar data
Parameters:
| Name | Type | Description |
|---|---|---|
min |
number | |
max |
number |
- Source:
setOpacity(opacity)
Set the opacity for the entire radar renderer
Parameters:
| Name | Type | Description |
|---|---|---|
opacity |
number |
- Source: