Skip to content

Commit

Permalink
docs(camera): updated descriptions (rnmapbox#946)
Browse files Browse the repository at this point in the history
* Fixed doc descriptions for Camera

* Fixed documentation for Camera
  • Loading branch information
soumyashisPR authored Jul 2, 2020
1 parent 8f9170e commit 396e77c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
14 changes: 7 additions & 7 deletions docs/Camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
| ---- | :--: | :-----: | :------: | :----------: |
| animationDuration | `number` | `2000` | `false` | The duration a camera update takes (in ms) |
| animationMode | `enum` | `'easeTo'` | `false` | The animationstyle when the camara updates. One of; `flyTo`, `easeTo`, `moveTo` |
| defaultSettings | `shape` | `none` | `false` | FIX ME NO DESCRIPTION |
| defaultSettings | `shape` | `none` | `false` | Default view settings applied on camera |
|   centerCoordinate | `array` | `none` | `false` | Center coordinate on map [lng, lat] |
|   heading | `number` | `none` | `false` | Heading on map |
|   pitch | `number` | `none` | `false` | Pitch on map |
|   bounds | `shape` | `none` | `false` | FIX ME NO DESCRIPTION |
|     ne | `array` | `none` | `true` | northEastCoordinates - North east coordinate of bound |
|     sw | `array` | `none` | `true` | southWestCoordinates - North east coordinate of bound |
|   bounds | `shape` | `none` | `false` | Represents a rectangle in geographical coordinates marking the visible area of the map. |
|     ne | `array` | `none` | `true` | North east coordinate of bound |
|     sw | `array` | `none` | `true` | South west coordinate of bound |
|     paddingLeft | `number` | `none` | `false` | Left camera padding for bounds |
|     paddingRight | `number` | `none` | `false` | Right camera padding for bounds |
|     paddingTop | `number` | `none` | `false` | Top camera padding for bounds |
Expand All @@ -22,9 +22,9 @@
| centerCoordinate | `array` | `none` | `false` | Center coordinate on map [lng, lat] |
| heading | `number` | `none` | `false` | Heading on map |
| pitch | `number` | `none` | `false` | Pitch on map |
| bounds | `shape` | `none` | `false` | FIX ME NO DESCRIPTION |
|   ne | `array` | `none` | `true` | northEastCoordinates - North east coordinate of bound |
|   sw | `array` | `none` | `true` | southWestCoordinates - North east coordinate of bound |
| bounds | `shape` | `none` | `false` | Represents a rectangle in geographical coordinates marking the visible area of the map. |
|   ne | `array` | `none` | `true` | North east coordinate of bound |
|   sw | `array` | `none` | `true` | South west coordinate of bound |
|   paddingLeft | `number` | `none` | `false` | Left camera padding for bounds |
|   paddingRight | `number` | `none` | `false` | Right camera padding for bounds |
|   paddingTop | `number` | `none` | `false` | Top camera padding for bounds |
Expand Down
14 changes: 7 additions & 7 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@
}
},
"default": "none",
"description": "northEastCoordinates - North east coordinate of bound"
"description": "North east coordinate of bound"
},
{
"name": "sw",
Expand All @@ -476,7 +476,7 @@
}
},
"default": "none",
"description": "southWestCoordinates - North east coordinate of bound"
"description": "South west coordinate of bound"
},
{
"name": "paddingLeft",
Expand Down Expand Up @@ -509,7 +509,7 @@
]
},
"default": "none",
"description": "FIX ME NO DESCRIPTION"
"description": "Represents a rectangle in geographical coordinates marking the visible area of the map."
},
{
"name": "zoomLevel",
Expand All @@ -521,7 +521,7 @@
]
},
"default": "none",
"description": "FIX ME NO DESCRIPTION"
"description": "Default view settings applied on camera"
},
{
"name": "centerCoordinate",
Expand Down Expand Up @@ -565,7 +565,7 @@
}
},
"default": "none",
"description": "northEastCoordinates - North east coordinate of bound"
"description": "North east coordinate of bound"
},
{
"name": "sw",
Expand All @@ -577,7 +577,7 @@
}
},
"default": "none",
"description": "southWestCoordinates - North east coordinate of bound"
"description": "South west coordinate of bound"
},
{
"name": "paddingLeft",
Expand Down Expand Up @@ -610,7 +610,7 @@
]
},
"default": "none",
"description": "FIX ME NO DESCRIPTION"
"description": "Represents a rectangle in geographical coordinates marking the visible area of the map."
},
{
"name": "zoomLevel",
Expand Down
11 changes: 8 additions & 3 deletions javascript/components/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ const SettingsPropTypes = {
*/
pitch: PropTypes.number,

/**
* Represents a rectangle in geographical coordinates marking the visible area of the map.
*/
bounds: PropTypes.shape({
/**
* northEastCoordinates - North east coordinate of bound
* North east coordinate of bound
*/
ne: PropTypes.arrayOf(PropTypes.number).isRequired,

/**
* southWestCoordinates - North east coordinate of bound
* South west coordinate of bound
*/
sw: PropTypes.arrayOf(PropTypes.number).isRequired,

Expand Down Expand Up @@ -77,7 +80,9 @@ class Camera extends React.Component {
*/
animationMode: PropTypes.oneOf(['flyTo', 'easeTo', 'moveTo']),

// default - view settings
/**
* Default view settings applied on camera
*/
defaultSettings: PropTypes.shape(SettingsPropTypes),

// normal - view settings
Expand Down

0 comments on commit 396e77c

Please sign in to comment.