Types
CameraUpdateTransformFunction
A callback hook that allows manipulating the camera and being notified about camera updates before they happen.
Parameters
{ bearing: number; center: LngLat; elevation: number; pitch: number; roll: number; zoom: number; }
number
LngLat
number
number
number
number
RequestTransformFunction
This function is used to tranform a request. It is used just before executing the relevant request.
Parameters
string
ResourceType
ResourceType
A type of MapLibre resource.
Enumeration members
Subscription
Allows to unsubscribe from events without the need to store the method reference.
Methods
unsubscribe()
Returns
void
StyleSetterOptions
Supporting type to add validation to another style related type.
Type declaration
boolean
Whether to check if the filter conforms to the MapLibre Style Specification.
Disabling validation is a performance optimization that should only be used if you have previously validated
the values you will be passing to this function.
CubemapLayerConstructorOptions
src/custom-layers/CubemapLayer/types.ts
Constructor options for the CubemapLayer.
Usage
Simple space
You can enable a simple space background with a solid color:
Predefined Presets
Alternatively, you can provide a cubemap for a space backround using one of the following methods:-
space: Dark blue hsl(210, 100%, 4%) background and white stars (transparent background image). Space color changes the background color, stars always stay white. -
stars(default): Black background (image mask), space color changes the stars color, background always stays black. -
milkyway: Black half-transparent background with standard milkyway and stars. Space color changes the stars and milkyway color, background always stays black. -
milkyway-subtle: Black half-transparent background with subtle milkyway and less stars. Space color changes the stars and milkyway color, background always stays black. Black half-transparent background with standard milkyway and stars. Space color changes the stars and milkyway color, background always stays black. -
milkyway-bright: Black half-transparent background with bright milkyway and more stars. Space color changes the stars and milkyway color, background always stays black.
Cubemap Images (Custom Skybox)
Load your custom cubemap images:
Cubemap Path with image format
This fetches all images from a path, this assumes all files are named px, nx, py, ny, pz, nz and suffixed with the appropriate extension specified informat.
Set the space background dynamically
You can also set the space dynamically after the map loads:
RadialGradientLayerConstructorOptions
src/custom-layers/RadialGradientLayer/types.ts
Options for constructing a RadialGradientLaye.
Usage
Radial gradient
For more customization, you can define a radial gradient with scale and stops:
Set the halo dynamically
You can also set the halo dynamically after the map loads:
MaptilerCustomControlCallback
src/controls/MaptilerCustomControl.ts
A callback hook used by a MaptilerCustomControl.
Parameters
SDKMap
HTMLElement
Event
ImageMetadata
src/ImageViewer/ImageViewer.ts
The metadata of the image. This is the shape of the response from the API. And used to convert px to lnglat and vice versa..
Type declaration
string
string
number
string
number
number
number
number