diff --git a/docs/Camera.md b/docs/Camera.md index 9408680a5..6308f4e09 100644 --- a/docs/Camera.md +++ b/docs/Camera.md @@ -90,14 +90,9 @@ The zoom level of the map. ### padding ```tsx -type Padding = { - paddingLeft: number; /* Left padding in points */ - paddingRight: number; /* Right padding in points */ - paddingTop: number; /* Top padding in points */ - paddingBottom: number; /* Bottom padding in points */ -} +Partial ``` -The viewport padding in points. +The viewport padding in points. Individual edges may be omitted. @@ -218,7 +213,7 @@ compatibility; the root `padding` prop should be used instead. */ heading: number; /* Heading (bearing, orientation) of the map, measured in degrees clockwise from true north. */ pitch: number; /* The pitch toward the horizon measured in degrees, with 0 degrees resulting in a top-down view for a two-dimensional map. */ zoomLevel: number; /* The zoom level of the map. */ - padding: signature; /* The viewport padding in points. */ + padding: Partial; /* The viewport padding in points. Individual edges may be omitted. */ animationDuration: number; /* The duration the map takes to animate to a new configuration. */ animationMode: 'flyTo' \| 'easeTo' \| 'linearTo' \| 'moveTo' \| 'none'; /* The easing or path the camera uses to animate to a new configuration. */ } diff --git a/docs/docs.json b/docs/docs.json index e27e8cc67..81749326f 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -793,41 +793,9 @@ { "name": "padding", "required": false, - "type": { - "name": "shape", - "value": [ - { - "name": "paddingLeft", - "required": true, - "type": "number", - "default": "none", - "description": "Left padding in points" - }, - { - "name": "paddingRight", - "required": true, - "type": "number", - "default": "none", - "description": "Right padding in points" - }, - { - "name": "paddingTop", - "required": true, - "type": "number", - "default": "none", - "description": "Top padding in points" - }, - { - "name": "paddingBottom", - "required": true, - "type": "number", - "default": "none", - "description": "Bottom padding in points" - } - ] - }, + "type": "Partial", "default": "none", - "description": "The viewport padding in points." + "description": "The viewport padding in points. Individual edges may be omitted." }, { "name": "animationDuration", @@ -975,9 +943,9 @@ { "name": "padding", "required": false, - "type": "signature", + "type": "Partial", "default": "none", - "description": "The viewport padding in points." + "description": "The viewport padding in points. Individual edges may be omitted." }, { "name": "animationDuration", diff --git a/src/components/Camera.tsx b/src/components/Camera.tsx index c8e61a0d9..c7bc63126 100644 --- a/src/components/Camera.tsx +++ b/src/components/Camera.tsx @@ -147,8 +147,8 @@ export type CameraStop = { pitch?: number; /** The zoom level of the map. */ zoomLevel?: number; - /** The viewport padding in points. */ - padding?: CameraPadding; + /** The viewport padding in points. Individual edges may be omitted. */ + padding?: Partial; /** The duration the map takes to animate to a new configuration. */ animationDuration?: number; /** The easing or path the camera uses to animate to a new configuration. */