Type Alias: PaddingValue
type PaddingValue = number | stringRepresents a padding value that can be:
- A number (interpreted as pixels)
- A string with a unit: “10%”, “5vh”, “5vw”, “100px”
Supported units:
px- Pixels (default if number)%- Percentage of the map container dimension (width for left/right, height for top/bottom)vh- Percentage of viewport heightvw- Percentage of viewport width
Example
// All equivalent to 50 pixels
padding: {
top: 50
}
padding: {
top: "50px"
}
// Percentage of container
padding: {
left: "30%"
} // 30% of container width
padding: {
top: "20%"
} // 20% of container height
// Viewport units
padding: {
top: "10vh"
} // 10% of viewport height
padding: {
left: "15vw"
} // 15% of viewport widthLast updated on