Skip to content

Commit

Permalink
Added docs for PointAnnotation and Callout
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick committed Oct 23, 2017
1 parent 70f4a1c commit 0440584
Show file tree
Hide file tree
Showing 4 changed files with 189 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/Callout.md
@@ -0,0 +1,14 @@
## <MapboxGL.Callout />
### Callout that displays information about a selected annotation near the annotation.

### props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| title | `string` | `none` | `false` | String that get's displayed in the default callout. |
| style | `any` | `none` | `false` | Style property for the Animated.View wrapper, apply animations to this |
| containerStyle | `any` | `none` | `false` | Style property for the native RCTMGLCallout container, set at your own risk. |
| contentStyle | `any` | `none` | `false` | Style property for the content bubble. |
| tipStyle | `any` | `none` | `false` | Style property for the triangle tip under the content. |
| textStyle | `any` | `none` | `false` | Style property for the title in the content bubble. |


15 changes: 15 additions & 0 deletions docs/MapView.md
Expand Up @@ -103,6 +103,21 @@ this.map.flyTo([lng, lat], 12000)
```


#### moveTo(coordinates[, duration])
##### arguments
| Name | Type | Required | Description |
| ---- | :--: | :------: | :----------: |
| `coordinates` | `Array` | `Yes` | Coordinates that map camera will move too |
| `duration` | `Number` | `No` | Duration of camera animation |



```javascript
this.map.moveTo([lng, lat], 200) // eases camera to new location based on duration
this.map.moveTo([lng, lat]) // snaps camera to new location without any easing
```


#### zoomTo(zoomLevel[, duration])
##### arguments
| Name | Type | Required | Description |
Expand Down
16 changes: 16 additions & 0 deletions docs/PointAnnotation.md
@@ -0,0 +1,16 @@
## <MapboxGL.PointAnnotation />
### PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.

### props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| id | `string` | `none` | `true` | A string that uniquely identifies the annotation |
| title | `string` | `none` | `false` | The string containing the annotation’s title. Note this is required to be set if you want to see a callout appear on iOS. |
| snippet | `string` | `none` | `false` | The string containing the annotation’s snippet(subtitle). Not displayed in the default callout. |
| selected | `bool` | `none` | `false` | Manually selects/deselects annotation<br/>@type {[type]} |
| coordinate | `arrayOf` | `none` | `true` | The center point (specified as a map coordinate) of the annotation. |
| anchor | `shape` | `{ x: 0.5, y: 0.5 }` | `false` | Specifies the anchor being set on a particular point of the annotation.<br/>The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],<br/>where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.<br/>Note this is only for custom annotations not the default pin view.<br/>Defaults to the center of the view. |
| onSelected | `func` | `none` | `false` | This callback is fired once this annotation is selected. Returns a Feature as the first param. |
| onDeselected | `func` | `none` | `false` | This callback is fired once this annotation is deselected. |


144 changes: 144 additions & 0 deletions docs/docs.json
Expand Up @@ -108,6 +108,55 @@
}
]
},
"Callout": {
"description": "Callout that displays information about a selected annotation near the annotation.",
"methods": [],
"props": [
{
"name": "title",
"required": false,
"type": "string",
"default": "none",
"description": "String that get's displayed in the default callout."
},
{
"name": "style",
"required": false,
"type": "any",
"default": "none",
"description": "Style property for the Animated.View wrapper, apply animations to this"
},
{
"name": "containerStyle",
"required": false,
"type": "any",
"default": "none",
"description": "Style property for the native RCTMGLCallout container, set at your own risk."
},
{
"name": "contentStyle",
"required": false,
"type": "any",
"default": "none",
"description": "Style property for the content bubble."
},
{
"name": "tipStyle",
"required": false,
"type": "any",
"default": "none",
"description": "Style property for the triangle tip under the content."
},
{
"name": "textStyle",
"required": false,
"type": "any",
"default": "none",
"description": "Style property for the title in the content bubble."
}
],
"name": "Callout"
},
"CircleLayer": {
"description": "CircleLayer is a style layer that renders one or more filled circles on the map.",
"methods": [],
Expand Down Expand Up @@ -948,6 +997,38 @@
"\nthis.map.flyTo([lng, lat])\nthis.map.flyTo([lng, lat], 12000)\n\n "
]
},
{
"name": "moveTo",
"docblock": "Map camera will move to new coordinate at the same zoom level\n\n@example\nthis.map.moveTo([lng, lat], 200) // eases camera to new location based on duration\nthis.map.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=} duration - Duration of camera animation\n @return {void}",
"modifiers": [],
"params": [
{
"name": "coordinates",
"description": "Coordinates that map camera will move too",
"type": {
"name": "Array"
}
},
{
"name": "duration",
"description": "Duration of camera animation",
"type": {
"name": "Number"
},
"optional": true
}
],
"returns": {
"description": null,
"type": {
"name": "void"
}
},
"description": "Map camera will move to new coordinate at the same zoom level",
"examples": [
"\nthis.map.moveTo([lng, lat], 200) // eases camera to new location based on duration\nthis.map.moveTo([lng, lat]) // snaps camera to new location without any easing\n\n "
]
},
{
"name": "zoomTo",
"docblock": "Map camera will zoom to specified level\n\n@example\nthis.map.zoomTo(16)\nthis.map.zoomTo(16, 100)\n\n@param {Number} zoomLevel - Zoom level that the map camera will animate too\n@param {Number=} duration - Duration of camera animation\n@return {void}",
Expand Down Expand Up @@ -1235,6 +1316,69 @@
],
"name": "MapView"
},
"PointAnnotation": {
"description": "PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.",
"methods": [],
"props": [
{
"name": "id",
"required": true,
"type": "string",
"default": "none",
"description": "A string that uniquely identifies the annotation"
},
{
"name": "title",
"required": false,
"type": "string",
"default": "none",
"description": "The string containing the annotation’s title. Note this is required to be set if you want to see a callout appear on iOS."
},
{
"name": "snippet",
"required": false,
"type": "string",
"default": "none",
"description": "The string containing the annotation’s snippet(subtitle). Not displayed in the default callout."
},
{
"name": "selected",
"required": false,
"type": "bool",
"default": "none",
"description": "Manually selects/deselects annotation\n@type {[type]}"
},
{
"name": "coordinate",
"required": true,
"type": "arrayOf",
"default": "none",
"description": "The center point (specified as a map coordinate) of the annotation."
},
{
"name": "anchor",
"required": false,
"type": "shape",
"default": "{ x: 0.5, y: 0.5 }",
"description": "Specifies the anchor being set on a particular point of the annotation.\nThe anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],\nwhere (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.\nNote this is only for custom annotations not the default pin view.\nDefaults to the center of the view."
},
{
"name": "onSelected",
"required": false,
"type": "func",
"default": "none",
"description": "This callback is fired once this annotation is selected. Returns a Feature as the first param."
},
{
"name": "onDeselected",
"required": false,
"type": "func",
"default": "none",
"description": "This callback is fired once this annotation is deselected."
}
],
"name": "PointAnnotation"
},
"RasterLayer": {
"description": "",
"methods": [],
Expand Down

0 comments on commit 0440584

Please sign in to comment.