Optional
margin?: numberMargin around the label and marker in pixels. This will affect label density. Minimum is 6px.
6
Optional
marker?: { Optional
backgroundOptional
active?: stringBackground color of the marker when it is active. Color can be set using CSS colors names DarkGoldenRod
, as Hex strings #0000FF
or the rgb values rgb(255,0,0)
.
Optional
inactive?: stringBackground color of the marker when it is inactive (grayed out due to being outranked by other labels around). Color can be set using CSS colors names DarkGoldenRod
, as Hex strings #0000FF
or the rgb values rgb(255,0,0)
.
Optional
foregroundOptional
active?: stringForeground color of the marker when it is active. Color can be set using CSS colors names DarkGoldenRod
, as Hex strings #0000FF
or the rgb values rgb(255,0,0)
.
Optional
inactive?: stringForeground color of the marker when it is inactive (grayed out due to being outranked by other labels around). Color can be set using CSS colors names DarkGoldenRod
, as Hex strings #0000FF
or the rgb values rgb(255,0,0)
.
Optional
icon?: stringIcon to be placed inside label. Supports SVG or a URL to png or jpeg.
// SVG
mapView.Labels.add(space, space.name, {
appearance: {
icon: `<svg>...</svg>`
},
});
// Image URL
mapView.Labels.add(space, space.name, {
appearance: {
icon: 'https://example.com/icon.png',
},
});
Optional
iconHow the icon should fit inside the marker.
fill
will stretch the icon to fill the marker.cover
will maintain aspect ratio and fill the marker.contain
will maintain aspect ratio and fit the icon inside the marker.'cover'
Optional
iconPadding around the icon, in pixels.
4
Optional
iconSize of bounding box of the icon in pixels
10
Optional
iconDefines when the icon becomes visible relative to the current zoom level anything below 0 will result in icons never showing up 0 ensures icons show up at maxZoom (fully zoomed in) 1 ensures they always show up
Optional
size?: numberSize of the marker in pixels
Behavior when using this along with iconVisibilityThreshold
and icon
is undefined
Optional
text?: { Optional
backgroundText background color. Color can be set using CSS colors names DarkGoldenRod
, as Hex strings #0000FF
or the rgb values rgb(255,0,0)
.
Optional
foregroundText foreground color. Color can be set using CSS colors names DarkGoldenRod
, as Hex strings #0000FF
or the rgb values rgb(255,0,0)
.
Optional
lineLine height sets the height of a line box. It's commonly used to set the distance between lines of text.
1.2
Optional
maxMaxiumum width of text in pixels.
Optional
numNumber of lines to display when text spans multiple lines.
Optional
size?: numberText size in pixels
Control how a Label looks