Skip to content

Commit

Permalink
docs: generate
Browse files Browse the repository at this point in the history
  • Loading branch information
KiwiKilian committed Oct 21, 2024
1 parent 9f0566f commit ffa55e7
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 133 deletions.
31 changes: 12 additions & 19 deletions docs/Camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
| pitch | `number` | `none` | `false` | The pitch of the map. |
| zoomLevel | `number` | `none` | `false` | The zoom level of the map. |
| padding | `CameraPadding` | `none` | `false` | The viewport padding in points. |
| animationDuration | `number` | `2000` | `false` | The duration the map takes to animate to a new configuration. |
| animationMode | `"flyTo" \| "easeTo" \| "linearTo" \| "moveTo"` | `"easeTo"` | `false` | The easing or path the camera uses to animate to a new configuration. |
| animationDuration | `number` | `none` | `false` | The duration the map takes to animate to a new configuration. |
| animationMode | `"flyTo" \| "easeTo" \| "linearTo" \| "moveTo"` | `none` | `false` | The easing or path the camera uses to animate to a new configuration. |
| allowUpdates | `boolean` | `true` | `false` | If false, the camera will not send any props to the native module. Intended to be used to prevent unnecessary tile fetching and improve performance when the map is not visible. Defaults to true. |
| defaultSettings | `CameraStop` | `none` | `false` | Default view settings applied on camera |
| minZoomLevel | `number` | `none` | `false` | The minimun zoom level of the map |
Expand All @@ -23,21 +23,17 @@
| followZoomLevel | `number` | `none` | `false` | The zoomLevel on map while followUserLocation is set to `true` |
| followPitch | `number` | `none` | `false` | The pitch on map while followUserLocation is set to `true` |
| followHeading | `number` | `none` | `false` | The heading on map while followUserLocation is set to `true` |
| triggerKey | `string \| number` | `none` | `false` | Manually update the camera - helpful for when props did not update, however you still want the camera to move |
| onUserTrackingModeChange | `func` | `none` | `false` | FIX ME NO DESCRIPTION<br/>*signature:*`(event:MaplibreGLEvent) => void` |

### methods
#### fitBounds(northEastCoordinates, southWestCoordinates[, padding][, animationDuration])
#### fitBounds()

Map camera transitions to fit provided bounds

##### arguments
| Name | Type | Required | Description |
| ---- | :--: | :------: | :----------: |
| `northEastCoordinates` | `GeoJSON.Position` | `Yes` | North east coordinate of bound |
| `southWestCoordinates` | `GeoJSON.Position` | `Yes` | South west coordinate of bound |
| `padding` | `Number \| Array` | `No` | Padding for the bounds |
| `animationDuration` | `Number` | `No` | Duration of camera animation |




Expand All @@ -49,15 +45,14 @@ this.camera.fitBounds([lng, lat], [lng, lat], [top, right, bottom, left], 1000)
```


#### flyTo(coordinates[, animationDuration])
#### flyTo()

Map camera will fly to new coordinate

##### arguments
| Name | Type | Required | Description |
| ---- | :--: | :------: | :----------: |
| `coordinates` | `GeoJSON.Position` | `Yes` | Coordinates that map camera will jump too |
| `animationDuration` | `Number` | `No` | Duration of camera animation |




Expand All @@ -67,15 +62,14 @@ this.camera.flyTo([lng, lat], 12000)
```


#### moveTo(coordinates[, animationDuration])
#### moveTo()

Map camera will move to new coordinate at the same zoom level

##### arguments
| Name | Type | Required | Description |
| ---- | :--: | :------: | :----------: |
| `coordinates` | `GeoJSON.Position` | `Yes` | Coordinates that map camera will move too |
| `animationDuration` | `Number` | `No` | Duration of camera animation |




Expand All @@ -85,15 +79,14 @@ this.camera.moveTo([lng, lat]) // snaps camera to new location without any easin
```


#### zoomTo(zoomLevel[, animationDuration])
#### zoomTo()

Map camera will zoom to specified level

##### arguments
| Name | Type | Required | Description |
| ---- | :--: | :------: | :----------: |
| `zoomLevel` | `number` | `Yes` | Zoom level that the map camera will animate too |
| `animationDuration` | `Number` | `No` | Duration of camera animation |




Expand All @@ -103,14 +96,14 @@ this.camera.zoomTo(16, 100)
```


#### setCamera([config])
#### setCamera()

Map camera will perform updates based on provided config. Advanced use only!

##### arguments
| Name | Type | Required | Description |
| ---- | :--: | :------: | :----------: |
| `config` | `Object` | `No` | Camera configuration |




Expand Down
122 changes: 9 additions & 113 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,40 +255,7 @@
"name": "fitBounds",
"docblock": "Map camera transitions to fit provided bounds\n\n@example\nthis.camera.fitBounds([lng, lat], [lng, lat])\nthis.camera.fitBounds([lng, lat], [lng, lat], 20, 1000) // padding for all sides\nthis.camera.fitBounds([lng, lat], [lng, lat], [verticalPadding, horizontalPadding], 1000)\nthis.camera.fitBounds([lng, lat], [lng, lat], [top, right, bottom, left], 1000)\n\n@param {Array<Number>} northEastCoordinates - North east coordinate of bound\n@param {Array<Number>} southWestCoordinates - South west coordinate of bound\n@param {Number|Array<Number>|undefined} padding - Padding for the bounds\n@param {Number=} animationDuration - Duration of camera animation\n@return {void}",
"modifiers": [],
"params": [
{
"name": "northEastCoordinates",
"description": "North east coordinate of bound",
"type": {
"name": "GeoJSON.Position"
},
"optional": false
},
{
"name": "southWestCoordinates",
"description": "South west coordinate of bound",
"type": {
"name": "GeoJSON.Position"
},
"optional": false
},
{
"name": "padding",
"description": "Padding for the bounds",
"type": {
"name": "Number \\| Array"
},
"optional": true
},
{
"name": "animationDuration",
"description": "Duration of camera animation",
"type": {
"name": "Number"
},
"optional": true
}
],
"params": [],
"returns": {
"description": null,
"type": {
Expand All @@ -304,24 +271,7 @@
"name": "flyTo",
"docblock": "Map camera will fly to new coordinate\n\n@example\nthis.camera.flyTo([lng, lat])\nthis.camera.flyTo([lng, lat], 12000)\n\n @param {Array<Number>} coordinates - Coordinates that map camera will jump too\n @param {Number=} animationDuration - Duration of camera animation\n @return {void}",
"modifiers": [],
"params": [
{
"name": "coordinates",
"description": "Coordinates that map camera will jump too",
"type": {
"name": "GeoJSON.Position"
},
"optional": false
},
{
"name": "animationDuration",
"description": "Duration of camera animation",
"type": {
"name": "Number"
},
"optional": true
}
],
"params": [],
"returns": {
"description": null,
"type": {
Expand All @@ -337,24 +287,7 @@
"name": "moveTo",
"docblock": "Map camera will move to new coordinate at the same zoom level\n\n@example\nthis.camera.moveTo([lng, lat], 200) // eases camera to new location based on duration\nthis.camera.moveTo([lng, lat]) // snaps camera to new location without any easing\n\n @param {Array<Number>} coordinates - Coordinates that map camera will move too\n @param {Number=} animationDuration - Duration of camera animation\n @return {void}",
"modifiers": [],
"params": [
{
"name": "coordinates",
"description": "Coordinates that map camera will move too",
"type": {
"name": "GeoJSON.Position"
},
"optional": false
},
{
"name": "animationDuration",
"description": "Duration of camera animation",
"type": {
"name": "Number"
},
"optional": true
}
],
"params": [],
"returns": {
"description": null,
"type": {
Expand All @@ -370,24 +303,7 @@
"name": "zoomTo",
"docblock": "Map camera will zoom to specified level\n\n@example\nthis.camera.zoomTo(16)\nthis.camera.zoomTo(16, 100)\n\n@param {Number} zoomLevel - Zoom level that the map camera will animate too\n@param {Number=} animationDuration - Duration of camera animation\n@return {void}",
"modifiers": [],
"params": [
{
"name": "zoomLevel",
"description": "Zoom level that the map camera will animate too",
"type": {
"name": "number"
},
"optional": false
},
{
"name": "animationDuration",
"description": "Duration of camera animation",
"type": {
"name": "Number"
},
"optional": true
}
],
"params": [],
"returns": {
"description": null,
"type": {
Expand All @@ -403,21 +319,8 @@
"name": "setCamera",
"docblock": "Map camera will perform updates based on provided config. Advanced use only!\n\n@example\nthis.camera.setCamera({\n centerCoordinate: [lng, lat],\n zoomLevel: 16,\n animationDuration: 2000,\n})\n\nthis.camera.setCamera({\n stops: [\n { pitch: 45, animationDuration: 200 },\n { heading: 180, animationDuration: 300 },\n ]\n})\n\n @param {Object} config - Camera configuration",
"modifiers": [],
"params": [
{
"name": "config",
"description": "Camera configuration",
"type": {
"name": "Object"
},
"optional": true
}
],
"returns": {
"type": {
"name": "void"
}
},
"params": [],
"returns": null,
"description": "Map camera will perform updates based on provided config. Advanced use only!",
"examples": [
"\nthis.camera.setCamera({\n centerCoordinate: [lng, lat],\n zoomLevel: 16,\n animationDuration: 2000,\n})\n\nthis.camera.setCamera({\n stops: [\n { pitch: 45, animationDuration: 200 },\n { heading: 180, animationDuration: 300 },\n ]\n})\n\n "
Expand Down Expand Up @@ -471,14 +374,14 @@
"name": "animationDuration",
"required": false,
"type": "number",
"default": "2000",
"default": "none",
"description": "The duration the map takes to animate to a new configuration."
},
{
"name": "animationMode",
"required": false,
"type": "\"flyTo\" \\| \"easeTo\" \\| \"linearTo\" \\| \"moveTo\"",
"default": "\"easeTo\"",
"default": "none",
"description": "The easing or path the camera uses to animate to a new configuration."
},
{
Expand Down Expand Up @@ -551,13 +454,6 @@
"default": "none",
"description": "The heading on map while followUserLocation is set to `true`"
},
{
"name": "triggerKey",
"required": false,
"type": "string \\| number",
"default": "none",
"description": "Manually update the camera - helpful for when props did not update, however you still want the camera to move"
},
{
"name": "onUserTrackingModeChange",
"required": false,
Expand All @@ -570,7 +466,7 @@
}
],
"composes": [
"Omit"
"BaseProps"
],
"fileNameWithExt": "Camera.tsx",
"name": "Camera"
Expand Down
33 changes: 32 additions & 1 deletion style-spec/v8.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,38 @@
"default": 0,
"units": "degrees",
"doc": "Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
"example": 50
"example": 50,
"sdk-support": {
"0-60 degrees": {
"js": "0.8.0",
"android": "1.0.0",
"ios": "1.0.0"
},
"0-85 degrees": {
"js": "2.0.0",
"android": "https://github.com/maplibre/maplibre-native/issues/1909",
"ios": "https://github.com/maplibre/maplibre-native/issues/1909"
},
"0-180 degrees": {
"js": "5.0.0",
"android": "https://github.com/maplibre/maplibre-native/issues/1909",
"ios": "https://github.com/maplibre/maplibre-native/issues/1909"
}
}
},
"roll": {
"type": "number",
"default": 0,
"units": "degrees",
"doc": "Default roll, in degrees. The roll angle is measured counterclockwise about the camera boresight. The style roll will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
"example": 45,
"sdk-support": {
"basic functionality": {
"js": "5.0.0",
"android": "https://github.com/maplibre/maplibre-native/issues/2941",
"ios": "https://github.com/maplibre/maplibre-native/issues/2941"
}
}
},
"light": {
"type": "light",
Expand Down

0 comments on commit ffa55e7

Please sign in to comment.