Types
Types
This page contains all types that can be provided as arguments to Map SDK functions. All types used throughout Map SDK functions link to this page, and any types that employ other types are referenced via clickable links.
Analytics Types
AnalyticsEventHandlers
AnalyticsEventHandlers
Called whenever a user-triggered event happens.
Note: This is a on-prem feature and is not available for other versions of the Map SDK.
type AnalyticsEventHandlers = {
onUserEvent?: (event: UserEvent) => void
};
NoPayloadEvents
NoPayloadEvents
export type NoPayloadEvent =
| RemoveDatasetEvent
| AddLayerEvent
| RemoveLayerEvent
| AddLayerGroupEvent
| RemoveLayerGroupEvent;
RasterTileLoadEvent
RasterTileLoadEvent
A type returning raster tile loading status updates.
assetUrls: string[];
tileIndex: [number, number, number];
remainingTiles: number;
status: 'loading' | 'loaded' | 'canceled';
error?: Error;
Argument | Type | Description |
---|---|---|
assetUrls | string[] | An array of URLs that the tile assets are being requested from. |
tileIndex | [number, number, number] | An array containing tile coordinates [x, y, z]. |
remainingTiles | number | Total number of tiles that are being loaded. |
status | string | The status of the raster tile loading. Either 'loading' , 'loaded' , 'canceled' , or 'failed' . |
error | Error | If an error occurred, an error object describing the loading error. |
UserEvent
UserEvent
A collection of types of events that are reported by onUserEvent
callback.
type UserEvent = NoPayloadEvent | MapControlClickedEvent | SidePanelSectionChangedEvent;
Parameters
MapControlClickedEvent
can return a payload with the control modified.
type MapControlClickedEvent = EventWithPayload<
'activate-map-control',
| {control: 'legend' | 'chart'}
| {control: 'toggle-3d', mode: ViewMode}
| {control: 'split-map', mode: SplitMode}
| {control: 'map-draw', mode: DrawMode}
>;
SidePanelSectionChangedEvent
can return the side panel changed.
type SidePanelSectionChangedEvent = EventWithPayload<
'change-side-panel-section',
{panel: SidePanelType}
>;
UserEventType
UserEventType
A collection of types of events that are reported by onUserEvent
callback.
type UserEventType =
| 'remove-dataset'
| 'add-layer'
| 'remove-layer'
| 'add-layer-group'
| 'remove-layer-group'
| 'activate-map-control'
| 'change-side-panel-section';
Argument | Type | Description |
---|---|---|
'remove-dataset' | string | Reported when a user removed a dataset. |
'add-layer' | string | Reported when a user adds a layer. |
'remove-layer' | string | Reported when a user removes a layer. |
'add-layer-group' | string | Reported when a user adds a layer group. |
'activate-map-control' | string | Reported when a user activates the map's controls. |
'change-side-panel-section' | string | Reported when a user changes side panel sections. |
Annotation Types
Annotation
Annotation
A callout on the map, including a text label and an optional pointer to a location. See examples in Studio product documentation.
Annotation = {
id: string;
kind: 'POINT' | 'CIRCLE' | 'ARROW' | 'TEXT';
isVisible: boolean;
autoSize?: boolean;
autoSizeY?: boolean;
anchorPoint: AnchorPoint;
label: string;
editorState?: EditorState;
mapIndex?: number;
lineColor: string;
lineWidth: number;
textWidth: number;
textHeight: number;
textVerticalAlign?: 'top' | 'middle' | 'bottom';
armLength?: number;
angle?: number;
radiusInMeters?: number;
};
class Annotation():
id: StrictStr
kind: Literal["TEXT", "ARROW", "POINT", "CIRCLE"]
is_visible: StrictBool
auto_size: Optional[StrictBool]
auto_size_y: Optional[StrictBool]
anchor_point: Tuple[float, float]
label: StrictStr
editor_state: Optional[Any]
map_index: Optional[int]
line_color: StrictStr
line_width: float
text_width: float
text_height: float
text_vertical_align: Literal["top", "middle", "bottom"]
arm_length: Optional[float]
angle: Optional[float]
radius_in_meters: Optional[float]
Javascript
Arguments
Argument | Type | Description |
---|---|---|
id | string | The unique identifier of the annotation. |
kind | 'POINT' | 'CIRCLE' | 'ARROW' | 'TEXT' | The type of annotation. |
isVisible | boolean | Whether the annotation should be visible on the map. |
autoSize | boolean | undefined | Whether the annotation should be auto-sized horizontally to fit the text. |
autoSizeY | boolean | undefined | Whether the annotation should be auto-sized vertically to fit the text. |
anchorPoint | AnchorPoint ([lon, lat] ) | The anchor point of the annotation in [lon, lat] format. |
label | string | The textual description of the annotation. |
editorState | EditorState | The state of the editor. See more information for EditorState |
mapIndex | number | undefined | The index of the map this annotation is attached to. |
lineColor | string | The color of the annotation line. |
lineWidth | number | The width of the annotation line. |
textWidth | number | The width of the annotation text. |
textHeight | number | The height of the annotation text. |
textVerticalAlign | 'top' | 'middle' | 'bottom' | undefined | The vertical alignment of the annotation text. |
armLength | number | The length of the annotation arm in pixels. |
angle | number | The angle of the annotation in degrees. |
radiusInMeters | number | The radius in meters (only for kind 'CIRCLE'). |
Python
Arguments
Argument | Type | Description |
---|---|---|
id | StrictStr | The unique identifier of the annotation. |
kind | Literal["TEXT", "ARROW", "POINT", "CIRCLE"] | The type of annotation. |
is_visible | StrictBool | Whether the annotation should be visible on the map. |
auto_size | Optional[StrictBool] | Whether the annotation should be auto-sized horizontally to fit the text. |
auto_size_y | Optional[StrictBool] | Whether the annotation should be auto-sized vertically to fit the text. |
anchor_point | Tuple[float, float] | The anchor point of the annotation. |
label | StrictStr | The textual description of the annotation. |
editor_state | Optional[Any] | See more information for EditorState |
map_index | Optional[int] | The index of the map this annotation is attached to. |
line_color | StrictStr | The color of the annotation line. |
line_width | float | The width of the annotation line. |
text_width | float | The width of the annotation text. |
text_height | float | The height of the annotation text. |
text_vertical_align | Literal["top", "middle", "bottom"] | The vertical alignment of the annotation text. |
arm_length | Optional[float] | The length of the annotation arm in pixels. |
angle | Optional[float] | The angle of the annotation in degrees. |
radius_in_meters | Optional[float] | The radius in meters (only for kind 'CIRCLE'). |
EditorState
EditorState
Serialized content of Lexical editor (https://lexical.dev/). This object is used for formatting text within map annotations. It supports various customization options such as bold, italic, underline, color, and background color.
To see an example of the EditorState
object working to format text, see our example here.
Arguments
Parameter | Type | Description |
---|---|---|
root | object | Root element containing the entire structure. |
root.children[] | array | Array of child elements (e.g., paragraphs, text, links). |
root.children[].type | string | Specifies element type (text , paragraph , link , linebreak ). |
root.children[].version | number | Indicates element version (always 1). |
root.children[].detail | number | Additional detail for some text elements. |
root.children[].format | number | Formatting options (bold , italic , underline ). |
root.children[].mode | string | Mode of the element (usually "normal"). |
root.children[].style | string | Custom styles like color and background-color . |
root.children[].text | string | Text content of the element. |
root.children[].direction | string | Text direction (usually left to right, or "ltr" ). |
root.children[].indent | number | Indentation level (always 0). |
root.children[].rel | string | Link relationship attribute (for link elements). |
root.children[].target | string | Target attribute for links (for link elements). |
root.children[].url | string | URL for links (for link elements). |
root.children[].children[] | array | Nested array of child elements within a paragraph or other parent element. |
root.children[].children[].type | string | Specifies element type within nested elements. |
root.children[].children[].version | number | Indicates element version within nested elements. |
root.children[].children[].detail | number | Additional detail for nested text elements. |
root.children[].children[].format | number | Formatting options for nested elements. |
root.children[].children[].mode | string | Mode of the element within nested elements. |
root.children[].children[].style | string | Custom styles for nested elements. |
root.children[].children[].text | string | Text content of nested elements. |
root.children[].children[].direction | string | Text direction for nested elements (usually left to right, or "ltr" ), |
root.children[].children[].indent | number | Indentation level for nested elements (always 0). |
root.children[].children[].rel | string | Link relationship attribute for nested link elements. |
root.children[].children[].target | string | Target attribute for nested link elements. |
root.children[].children[].url | string | URL for nested link elements. |
Example
export const editorContent = {
root: {
children: [
{
children: [
{
detail: 0,
format: 0,
mode: "normal",
style: "",
text: "This is ",
type: "text",
version: 1,
},
{
detail: 0,
format: 1,
mode: "normal",
style: "",
text: "bold, ",
type: "text",
version: 1,
},
{
detail: 0,
format: 2,
mode: "normal",
style: "",
text: "italic",
type: "text",
version: 1,
},
{
detail: 0,
format: 1,
mode: "normal",
style: "",
text: ", ",
type: "text",
version: 1,
},
{
detail: 0,
format: 8,
mode: "normal",
style: "",
text: "underline",
type: "text",
version: 1,
},
{
detail: 0,
format: 0,
mode: "normal",
style: "",
text: ".",
type: "text",
version: 1,
},
{
type: "linebreak",
version: 1,
},
{
children: [
{
detail: 0,
format: 0,
mode: "normal",
style: "",
text: "Link",
type: "text",
version: 1,
},
],
direction: "ltr",
format: "",
indent: 0,
type: "link",
version: 1,
rel: "noopener noreferrer",
target: "_blank",
url: "https://studio.foursquare.com",
},
{
detail: 0,
format: 0,
mode: "normal",
style: "",
text: ", ",
type: "text",
version: 1,
},
{
detail: 0,
format: 0,
mode: "normal",
style: "color: #C90000;",
text: "red text",
type: "text",
version: 1,
},
{
detail: 0,
format: 0,
mode: "normal",
style: "",
text: ", ",
type: "text",
version: 1,
},
{
detail: 0,
format: 0,
mode: "normal",
style: "background-color: #52A353;",
text: "green bg",
type: "text",
version: 1,
},
{
detail: 0,
format: 0,
mode: "normal",
style: "",
text: ".",
type: "text",
version: 1,
},
],
direction: "ltr",
format: "",
indent: 0,
type: "paragraph",
version: 1,
},
{
children: [
{
detail: 0,
format: 11,
mode: "normal",
style: "color: #C90000;background-color: #52A353;",
text: "All styles",
type: "text",
version: 1,
},
],
direction: "ltr",
format: "",
indent: 0,
type: "paragraph",
version: 1,
},
],
direction: "ltr",
format: "",
indent: 0,
type: "root",
version: 1,
},
};
editor_content = {
"root": {
"children": [
{
"children": [
{
"detail": 0,
"format": 0,
"mode": "normal",
"style": "",
"text": "This is ",
"type": "text",
"version": 1
},
{
"detail": 0,
"format": 1,
"mode": "normal",
"style": "",
"text": "bold, ",
"type": "text",
"version": 1
},
{
"detail": 0,
"format": 2,
"mode": "normal",
"style": "",
"text": "italic",
"type": "text",
"version": 1
},
{
"detail": 0,
"format": 1,
"mode": "normal",
"style": "",
"text": ", ",
"type": "text",
"version": 1
},
{
"detail": 0,
"format": 8,
"mode": "normal",
"style": "",
"text": "underline",
"type": "text",
"version": 1
},
{
"detail": 0,
"format": 0,
"mode": "normal",
"style": "",
"text": ".",
"type": "text",
"version": 1
},
{
"type": "linebreak",
"version": 1
},
{
"children": [
{
"detail": 0,
"format": 0,
"mode": "normal",
"style": "",
"text": "Link",
"type": "text",
"version": 1
}
],
"direction": "ltr",
"format": "",
"indent": 0,
"type": "link",
"version": 1,
"rel": "noopener noreferrer",
"target": "_blank",
"url": "https://studio.foursquare.com"
},
{
"detail": 0,
"format": 0,
"mode": "normal",
"style": "",
"text": ", ",
"type": "text",
"version": 1
},
{
"detail": 0,
"format": 0,
"mode": "normal",
"style": "color: #C90000;",
"text": "red text",
"type": "text",
"version": 1
},
{
"detail": 0,
"format": 0,
"mode": "normal",
"style": "",
"text": ", ",
"type": "text",
"version": 1
},
{
"detail": 0,
"format": 0,
"mode": "normal",
"style": "background-color: #52A353;",
"text": "green bg",
"type": "text",
"version": 1
},
{
"detail": 0,
"format": 0,
"mode": "normal",
"style": "",
"text": ".",
"type": "text",
"version": 1
}
],
"direction": "ltr",
"format": "",
"indent": 0,
"type": "paragraph",
"version": 1
},
{
"children": [
{
"detail": 0,
"format": 11,
"mode": "normal",
"style": "color: #C90000;background-color: #52A353;",
"text": "All styles",
"type": "text",
"version": 1
}
],
"direction": "ltr",
"format": "",
"indent": 0,
"type": "paragraph",
"version": 1
}
],
"direction": "ltr",
"format": "",
"indent": 0,
"type": "root",
"version": 1
}
}
Dataset Types
AddDatasetOptions
AddDatasetOptions
Javascript-exclusive type.
Options applicable when adding a new dataset.
type AddDatasetOptions = {
autoCreateLayers?: boolean,
centerMap?: boolean
};
Arguments
Argument | Type | Description |
---|---|---|
autoCreateLayers | boolean | Whether to attempt and create new layer(s) when adding a dataset. Defaults to true . |
centerMap | boolean | Whether to center the map to fit the new layer bounds. Defaults to true . |
BaseDataset
BaseDataset
Properties common to both tabular and tiled datasets.
type BaseDataset = {
id: string,
label: string,
color: RGBColor,
fields: Field[]
};
class BaseDataset():
id: str
type: string
label: str
color: RGBColor
fields: List[Field]
Javascript
Arguments
Python
Arguments
BaseDatasetCreationProps
BaseDatasetCreationProps
Data used to create a dataset, in CSV, JSON, GeoJSON format.
type BaseDatasetCreationProps = Partial<Omit<BaseDataset, 'fields'>> & {
data: string | object | unknown[][]
};
class DatasetCreationProps():
id: Optional[str]
label: Optional[str]
color: Optional[RGBColor]
data: Union[str, dict, List[List[Any]]]
Javascript
Parent | Description |
---|---|
BaseDataset | Properties common to both tabular and tiled datasets. |
Arguments
Argument | Type | Description |
---|---|---|
data | string | object | unknown[][] | Data used to create a dataset, in CSV, JSON, GeoJSON format. |
Python
Arguments
Argument | Type | Description |
---|---|---|
id | string | Unique identifier for the dataset. |
label | string | Displayable dataset label. |
color | RGBColor | Color label of the dataset. |
data | Union[str, dict, List[List[Any]]] | Data used to create a dataset, in CSV, JSON, GeoJSON format. |
BaseField
BaseField
The field's unique identifier and user-facing label.
type BaseField = {
name: string,
label: string
};
class BaseField():
name: str
label: str
type: FieldType
Javascript
Arguments
Argument | Type | Description |
---|---|---|
name | string | A unique identifier for the field. |
label | string | A user-facing field label. |
Python
Arguments
Argument | Type | Description |
---|---|---|
name | string | A unique identifier for the field. |
label | string | A user-facing field label. |
BasicField
BasicField
Contains semantics around a single field in a dataset table.
type BasicField = BaseField & {
type:
| 'boolean'
| 'date'
| 'geojson'
| 'integer'
| 'real'
| 'string'
| 'array'
| 'object'
| 'point'
| 'h3'
};
class BasicField(BaseField):
type: BasicFieldType
Parent | Description |
---|---|
BaseField | The field's unique identifier and user-facing label. |
Javascript
Arguments
Argument | Type | Description |
---|---|---|
type | string | Type of the field. |
Python
Arguments
Argument | Type | Description |
---|---|---|
type | BasicFieldType | Type of the field. |
BasicFieldType
BasicFieldType
Python exclsuive type.
Available field types.
class BasicFieldType(FieldType):
BOOLEAN = "boolean"
DATE = "date"
GEOJSON = "geojson"
INTEGER = "integer"
REAL = "real"
STRING = "string"
ARRAY = "array"
OBJECT = "object"
POINT = "point"
H3 = "h3"
Dataset
Dataset
Dataset record.
type Dataset = LocalDataset | VectorTileDataset | RasterTileDataset;
Dataset = Union[LocalDataset, VectorTileDataset, RasterTileDataset]
Member | Description |
---|---|
LocalDataset | Dataset record representing a local dataset, with data provided by the caller. |
VectorTileDataset | Dataset record representing a vector tileset. |
RasterTileDataset | Raster tileset metadata. |
DatasetCreationProps
DatasetCreationProps
A set of properties used to synchronously add a dataset to the map.
type DatasetCreationProps =
| LocalDatasetCreationProps
| VectorTileDatasetCreationProps
| RasterTileDatasetCreationProps;
class DatasetCreationProps() = Union[
LocalDatasetCreationProps,
VectorTileDatasetCreationProps,
RasterTileDatasetCreationProps
]
Member | Description |
---|---|
LocalDatasetCreationProps | Dataset record representing a local dataset, with data provided by the caller. |
VectorTileDatasetCreationProps | Dataset record representing a vector tileset. |
RasterTileDatasetCreationProps | Raster tileset metadata. |
DatasetType
DatasetType
Python-exclusive type
Types of currently support datasets.
class DatasetType(str, Enum):
LOCAL = "local"
VECTOR_TILE = "vector-tile"
RASTER_TILE = "raster-tile
DatasetUpdateProps
DatasetUpdateProps
A set of properties used to update a dataset.
type DatasetUpdateProps = Partial<Pick<Dataset, 'label' | 'color'>>;
class _DatasetUpdateProps():
label: Optional[str]
color: Optional[RGBColor]
fields: Optional[List[Field]]
Python
Arguments
DatasetWithData
DatasetWithData
Type encapsulating a dataset record along with its data.
type DatasetWithData = Dataset & {
data: unknown[][]
};
class DatasetWithData(LocalDataset):
data: List[List[Any]]
Javascript
Parent | Description |
---|---|
Dataset | Dataset record. |
Arguments
Argument | Type | Description |
---|---|---|
Dataset | Dataset | Type encapsulating dataset properties. |
data | unknown[][] | Tabular data backing the dataset, where the order of fields matches the order in Dataset.fields |
Python
Parent | Description |
---|---|
Dataset | Dataset record representing a local dataset, with data provided by the caller. |
Arguments
Argument | Type | Description |
---|---|---|
data | List[List[any]] | Tabular data backing the dataset, where the order of fields matches the order in Dataset.fields |
DrawMode
DrawMode
Supported map draw modes.
type DrawMode = 'select' | 'polygon' | 'rectangle';
Field
Field
A unison of available field types.
type Field = BasicField | TimestampField;
Field = Union[BasicField, TimestampField]
Member | Description |
---|---|
BasicField | Contains semantics around a single field in a dataset table. |
TimestampField | Contains semantics around a single timestamp field in a dataset table. |
LocalDataset
LocalDataset
Dataset record representing a local dataset, with data provided by the caller.
type LocalDataset = BaseDataset & {
type: 'local'
};
class LocalDataset(BaseDataset):
type = DatasetType.LOCAL;
Parent | Description |
---|---|
BaseDataset | Properties common to both tabular and tiled datasets. |
Arguments
Argument | Type | Description |
---|---|---|
type | string | Must be "local" . |
LocalDatasetCreationProps
LocalDatasetCreationProps
Dataset record representing a local dataset, with data provided by the caller.
LocalDatasetCreationProps = BaseDatasetCreationProps & {
type?: 'local';
data: string | object | unknown[][];
};
Parent | Description |
---|---|
BaseDatasetCreationProps | Data used to create a dataset, in CSV, JSON, GeoJSON format. |
Arguments
Argument | Type | Description |
---|---|---|
BaseDatasetCreationProps | BaseDatasetCreationProps | Data used to create a dataset, in CSV, JSON, GeoJSON format. |
type | string | Must be "local" . |
data | string , object , unknown[][] | Data used to create a dataset, in CSV, JSON, GeoJSON format. |
RasterTileCreationMetadata
RasterTileCreationMetadata
Raster tileset metadata in STAC Item format. STAC version must be >= 1.0.0, and the EO and Raster STAC extensions are required. This metadata shape can be passed to the map to synchronously add a raster tileset.
type RasterTileCreationMetadata = {
metadataUrl?: string,
type: 'Feature',
stac_version: string,
extensions: string[],
assets: Record<string, any>
};
Arguments
Argument | Type | Description |
---|---|---|
metadataUrl | string | URL for tileset metadata. |
type | string | Type of the raster tileset. |
stac_version | string | STAC version for tileset. |
extensions | string[] | An array of extensions the Item implements. |
assets | Record<string, any>; | Dictionary of asset objects that can be downloaded, each with a unique key. |
RasterTileDataset
RasterTileDataset
Raster tileset metadata.
type RasterTileDataset = BaseDataset & {
type: 'raster-tile',
metadata: RasterTileMetadata
};
class RasterTileDataset(BaseDataset):
type = DatasetType.RASTER_TILE
metadata: RasterTileMetadata
Parent | Description |
---|---|
BaseDataset | Properties common to both tabular and tiled datasets. |
Javascript
Arguments
Argument | Type | Description |
---|---|---|
type | string | Must be "raster-tile" . |
metadata | RasterTileMetadata | Raster tileset metadata. |
Python
Arguments
Argument | Type | Description |
---|---|---|
type | string | Must be "raster-tile" . |
metadata | RasterTileMetadata | Raster tileset metadata. |
RasterTileDatasetCreationProps
RasterTileDatasetCreationProps
Dataset record representing a raster tileset.
type RasterTileDatasetCreationProps = BaseDatasetCreationProps & {
type: 'raster-tile',
metadata: RasterTileCreationMetadata
};
Parent | Description |
---|---|
BaseDatasetCreationProps | Data used to create a dataset, in CSV, JSON, GeoJSON format. |
Arguments
Argument | Type | Description |
---|---|---|
type | string | Must be "raster-tile" . |
metadata | RasterTileCreationMetadata | Raster tileset metadata in STAC Item format. |
RasterTileDatasetRemoteCreationProps
RasterTileDatasetRemoteCreationProps
Dataset record representing a raster tileset.
type RasterTileDatasetRemoteCreationProps = BaseDatasetCreationProps & {
type: 'raster-tile',
metadata: RasterTileRemoteMetadata
};
Parent | Description |
---|---|
BaseDatasetCreationProps | Data used to create a dataset, in CSV, JSON, GeoJSON format. |
Arguments
Argument | Type | Description |
---|---|---|
type | string | Must be "raster-tile" . |
metadata | RasterTileMetadata | The metadata of the raster tile. |
RasterTileLocalMetadata
RasterTileLocalMetadata
Python-exclusive type
Raster tileset metadata in STAC Item format. STAC version must be >= 1.0.0, and the EO and Raster STAC extensions are required. This metadata shape can be passed to the map to synchronously add a raster tileset.
class RasterTileLocalMetadata(RasterTileBaseMetadata):
metadata_url: Optional[string]
type: str = "Feature"
stac_version: str = PydanticField(..., alias="stac_version")
stac_extensions: List[str] = PydanticField(..., alias="stac_extensions")
assets: Dict[str, Any]
Parent | Description |
---|---|
RasterTileBaseMetadata | Raster tileset metadata. |
Arguments
Argument | Type | Description |
---|---|---|
metadata_url | string | URL for tileset metadata. |
type | string | Type of the raster tileset. |
stac_version | string | STAC version for tilesets. |
stac_extensions | List[str] | A list of extensions the Item implements. |
assets | Dict[str, Any] | Dictionary of asset objects that can be downloaded, each with a unique key. |
RasterTileMetadata
RasterTileMetadata
Raster tileset metadata.
type RasterTileMetadata = RasterTileCreationMetadata | RasterTileRemoteMetadata;
RasterTileMetadata = Union[RasterTileLocalMetadata, RasterTileRemoteMetadata]
Javascript
Member | Description |
---|---|
RasterTileCreationMetadata | Raster tileset metadata in STAC Item format. STAC version must be >= 1.0.0, and the EO and Raster STAC extensions are required. This metadata shape can be passed to the map to synchronously add a raster tileset. |
RasterTileRemoteMetadata | Raster tileset metadata with a remote metadata URL. This metadata can be passed to the map to asynchronously load a raster tileset. |
Python
Member | Description |
---|---|
RasterTileLocalMetadata | Raster tileset metadata in STAC Item format. STAC version must be >= 1.0.0, and the EO and Raster STAC extensions are required. This metadata shape can be passed to the map to synchronously add a raster tileset. |
RasterTileRemoteMetadata | Raster tileset metadata with a remote metadata URL. This metadata can be passed to the map to asynchronously load a raster tileset. |
RasterTileRemoteMetadata
RasterTileRemoteMetadata
Raster tileset metadata with a remote metadata URL. This metadata can be passed to the map to asynchronously load a raster tileset.
type RasterTileRemoteMetadata = {
metadataUrl: string
};
class RasterTileRemoteMetadata(RasterTileBaseMetadata):
metadata_url: string
Javascript
Arguments
Argument | Type | Description |
---|---|---|
metadataUrl | string | The metadata of the raster tile. |
Python
Arguments
Argument | Type | Description |
---|---|---|
metadata_url | string | The metadata of the raster tile. |
DatasetCreationProps
DatasetCreationProps
Dataset record representing a local dataset, with data provided by the caller.
LocalDatasetCreationProps = BaseDatasetCreationProps & {
type?: 'local';
data: string | object | unknown[][];
};
Parent | Description |
---|---|
BaseDatasetCreationProps | Data used to create a dataset, in CSV, JSON, GeoJSON format. |
Arguments
Argument | Type | Description | ||
---|---|---|---|---|
type | string | Must be "local" . | ||
data | `string | object | unknown[][]` | Data used to create a dataset, in CSV, JSON, GeoJSON format. |
RGBColor
RGBColor
Red, green, and blue channels of a color in [0-255]
range.
type RGBColor = [number, number, number];
RGBColor = Tuple[Number, Number, Number]
ReplaceDatasetOptions
ReplaceDatasetOptions
Javascript-exclusive type.
Options applicable when adding a new dataset.
type ReplaceDatasetOptions = {
force?: boolean,
strict?: boolean
};
Arguments
Argument | Type | Description |
---|---|---|
force | boolean | Whether to force a dataset replace, even if the compatibility check fails. Default: false . |
strict | boolean | Whether to ensure strict equality of types for each field being replaced. Default: false . |
TileDatasetCreationProps
TileDatasetCreationProps
A set of properties used to asynchronously add a dataset to the map based on remote files.
type TileDatasetCreationProps =
| VectorTileDatasetRemoteCreationProps
| RasterTileDatasetRemoteCreationProps;
Member | Description |
---|---|
VectorTileDatasetRemoteCreationProps | A set of properties used to create a vector tile dataset with provided metadata. |
RasterTileDatasetRemoteCreationProps | Dataset record representing a raster tileset. |
TimestampField
TimestampField
Contains semantics around a single timestamp field in a dataset table.
type TimestampField = BaseField & {
type: 'timestamp',
timeFormat: string
};
class TimestampField(BaseField):
type: TimestampFieldType = TimestampFieldType.TIMESTAMP
time_format: str
Parent | Description |
---|---|
BaseField | The fields's unique identifier and user-facing label. |
Javascript
Arguments
Argument | Type | Description |
---|---|---|
timeformat | string | moment.js time format of the field's temporal data. |
Python
Arguments
Argument | Type | Description |
---|---|---|
type | TimestampFieldType.TIMESTAMP | Timestamp type identifier. |
timeformat | string | moment.js time format of the field's temporal data. |
VectorTileBaseMetadata
VectorTileBaseMetadata
Vector tileset base metadata.
type VectorTileBaseMetadata = {
dataUrl: string
};
class VectorTileBaseMetadata():
data_url: string
Javascript
Parent | Description |
---|---|
VectorTileMetadata | Vector tileset metadata with a remote metadata URL. |
Arguments
Argument | Type | Description |
---|---|---|
dataUrl | string | URL template for tiles, with {x}/{y}/{z} placeholders |
Python
Arguments
Argument | Type | Description |
---|---|---|
data_url | string | URL template for tiles, with {x}/{y}/{z} placeholders |
VectorTileCreationMetadata
VectorTileCreationMetadata
Vector tileset metadata, following the metadata format generated by Tippecanoe. This metadata shape can be passed to the map to synchronously add a vector tileset.
type VectorTileCreationMetadata = VectorTileBaseMetadata & {
metadataUrl?: string,
bounds?: string | number[],
center?: string | number[],
maxzoom?: number,
minzoom?: number,
json: string | VectorTileEmbeddedMetadata
};
Parent | Description |
---|---|
VectorTileBaseMetadata | Vector tileset base metadata. |
Arguments
Argument | Type | Description |
---|---|---|
VectorTileBaseMetadata | VectorTileBaseMetadata | Vector tileset base metadata. |
metadataUrl | string | URL for tileset metadata. |
bounds | string , number[] | Tileset bounds, as an array or comma-delimited string in format "w,s,e,n". |
center | string , number[] | Tileset center, as an array or comma-delimited string in format "lng,lat". |
maxzoom | number | Maximum zoom supported by the tileset. |
minzoom | number | Minimum zoom supported by the tileset. |
json | string or VectorTileEmbeddedMetadata | Metadata for the tileset, as a JSON string or object. |
VectorTileDataset
VectorTileDataset
Dataset record representing a vector tileset.
type VectorTileDataset = BaseDataset & {
type: 'vector-tile',
metadata: VectorTileMetadata
};
class VectorTileDataset(BaseDataset):
type = DatasetType.VECTOR_TILE
metadata: VectorTileMetadata
Parent | Description |
---|---|
BaseDataset | Properties common to both tabular and tiled datasets. |
Javascript
Arguments
Argument | Type | Description |
---|---|---|
type | string | Must be vector-tile . |
metadata | VectorTileMetadata | Vector tileset metadata with a remote metadata URL. |
Python
Arguments
Argument | Type | Description |
---|---|---|
type | string | Must be vector-tile . |
metadata | VectorTileMetadata | Vector tileset metadata with a remote metadata URL. |
VectorTileDatasetCreationProps
VectorTileDatasetCreationProps
A set of properties used to create a vector tile dataset with provided metadata.
type VectorTileDatasetCreationProps = BaseDatasetCreationProps & {
type: 'vector-tile',
metadata: VectorTileCreationMetadata
};
Parent | Description |
---|---|
BaseDatasetCreationProps | Data used to create a dataset, in CSV, JSON, GeoJSON format. |
Arguments
Argument | Type | Description |
---|---|---|
type | string | Must be vector-tile . |
metadata | VectorTileCreationMetadata | Vector tileset metadata, following the metadata format generated by Tippecanoe. |
VectorTileDatasetRemoteCreationProps
VectorTileDatasetRemoteCreationProps
A set of properties used to create a vector tile dataset with provided metadata.
type VectorTileDatasetRemoteCreationProps = BaseDatasetCreationProps & {
type: 'vector-tile',
metadata: VectorTileRemoteMetadata
};
Parent | Description |
---|---|
BaseDatasetCreationProps | Data used to create a dataset, in CSV, JSON, GeoJSON format. |
Arguments
Argument | Type | Description |
---|---|---|
type | string | Must be vector-tile . |
metadata | VectorTileRemoteMetadata | Vector tileset metadata with a remote metadata URL. |
VectorTileLocalMetadata
VectorTileLocalMetadata
Python-exclusive type
Vector tileset metadata, following the metadata format generated by Tippecanoe. This metadata shape can be passed to the map to synchronously add a vector tileset. See https://github.com/mapbox/tippecanoe
class VectorTileLocalMetadata(VectorTileBaseMetadata):
metadata_url: Optional[str]
bounds: Optional[Union[str, List[Number]]]
center: Optional[Union[str, List[Number]]]
maxzoom: Optional[Number]
minzoom: Optional[Number]
Parent | Description |
---|---|
VectorTileBaseMetadata | Vector tileset base metadata. |
Arguments
Argument | Type | Description |
---|---|---|
metadata_url | string | URL for tileset metadata. |
bounds | Union[str, List[Number]] | Tileset bounds, as an array or comma-delimited string in format "w,s,e,n". |
center | Union[str, List[Number]] | Tileset center, as an array or comma-delimited string in format "lng,lat". |
maxZoom | Number | Maximum zoom supported by the tileset. |
minzoom | Number | Minimum zoom supported by the tileset. |
VectorTileMetadata
VectorTileMetadata
Vector tileset metadata.
type VectorTileMetadata = VectorTileCreationMetadata | VectorTileRemoteMetadata;
VectorTileMetadata = Union[VectorTileLocalMetadata, VectorTileRemoteMetadata]
Javascript
Member | Description |
---|---|
VectorTileCreationMetadata | Vector tileset metadata, following the metadata format generated by Tippecanoe. This metadata shape can be passed to the map to synchronously add a vector tileset. |
VectorTileRemoteMetadata | Vector tileset metadata. |
Python
Member | Description |
---|---|
VectorTileLocalMetadata | Vector tileset metadata, following the metadata format generated by Tippecanoe. This metadata shape can be passed to the map to synchronously add a vector tileset. See https://github.com/mapbox/tippecanoe |
VectorTileRemoteMetadata | Vector tileset metadata. |
VectorTileRemoteMetadata
VectorTileRemoteMetadata
Vector tileset metadata.
type VectorTileRemoteMetadata = VectorTileBaseMetadata & {
metadataUrl: string
};
class VectorTileRemoteMetadata(VectorTileBaseMetadata):
metadata_url: string
Parent | Description |
---|---|
VectorTileBaseMetadata | Vector tileset base metadata. |
Javascript
Arguments
Argument | Type | Description |
---|---|---|
metadataUrl | string | URL for tileset metadata. |
Python
Arguments
Argument | Type | Description |
---|---|---|
metadata_url | string | URL for tileset metadata. |
Filter Types
BaseFilter
BaseFilter
Type encapsulating common filter properties.
type BaseFilter<Type extends FilterType, Value> = {
id: string;
type: Type;
sources: FilterSource[];
value: Value;
};
class BaseFilter():
id: Optional[str]
type: FilterType
sources: List[FilterSource]
value: Any
Javascript
Arguments
Argument | Type | Description |
---|---|---|
id | string | Unique identifier of the filter. |
type | FilterType | Type of the filter. |
sources | FilterSource[] | Data source(s) to apply the filter to. Note that only TimeRangeFilter currently supports multiple sources. The first given source is used for all other filters. |
value | Value | Value to base the filters on. |
Python
Arguments
Argument | Type | Description |
---|---|---|
id | string | Unique identifier of the filter. |
type | FilterType | Type of the filter. |
sources | List[ FilterSource[] ] | Data source(s) to apply the filter to. Note that only TimeRangeFilter currently supports multiple sources. The first given source is used for all other filters. |
value | Any | Value to base the filters on. |
Filter
Filter
Union of available filter types.
type Filter = RangeFilter | SelectFilter | TimeRangeFilter | MultiSelectFilter;
Filter = Union[
RangeFilter,
SelectFilter,
TimeRangeFilter,
MultiSelectFilter,
]
Member | Description |
---|---|
RangeFilter | Filter type that filters a range of values. |
SelectFilter | Filter type that filters based on a boolean value. |
TimeRangeFilter | Filter type that filters data within a range of time. |
MultiSelectFilter | Filter type that filters based on multiple string values. |
FilterCreationProps
FilterCreationProps
A set of properties used to create a filter. If source dataId
is not provided, the filter will be applied to the first dataset with a given field name.
type FilterCreationProps = Optional<
Omit<Filter, 'sources'> & {sources: PartialFilterSource[]},
'id'
>;`
FilterCreationProps = _PartialFilter
Parent | Description |
---|---|
Filter | Union of available filter types. |
FilterEventHandlers
FilterEventHandlers
A set of event handlers that are called on appropriate filter events.
type FilterEventHandlers = {
onFilterUpdate?: (filter: Filter) => void
};