Skip to content

Commit

Permalink
Update docs (#977)
Browse files Browse the repository at this point in the history
Co-authored-by: Your Name <[email protected]>
  • Loading branch information
ferdicus and Your Name authored Aug 3, 2020
1 parent d9d83b3 commit 9bb9054
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 28 deletions.
6 changes: 3 additions & 3 deletions docs/MarkerView.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!-- This file was autogenerated from MarkerView.js do not modify -->
## <MapboxGL.MarkerView />
### MarkerView allows you to place a interactive react native marker to the map. If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance.<br/>This is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on android and PointAnnotation on iOS.
### MarkerView allows you to place a interactive react native marker to the map.<br/><br/>If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance<br/>.<br/>This is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on Android<br/>and PointAnnotation on iOS.

### props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| coordinate | `array` | `none` | `true` | The center point (specified as a map coordinate) of the marker.<br/>See also #anchor. |
| 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. |
| &nbsp;&nbsp;x | `number` | `none` | `true` | FIX ME NO DESCRIPTION |
| &nbsp;&nbsp;y | `number` | `none` | `true` | FIX ME NO DESCRIPTION |
| &nbsp;&nbsp;x | `number` | `none` | `true` | `x` of anchor |
| &nbsp;&nbsp;y | `number` | `none` | `true` | `y` of anchor |
| children | `element` | `none` | `true` | Expects one child - can be container with multiple elements |


6 changes: 3 additions & 3 deletions docs/PointAnnotation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- This file was autogenerated from PointAnnotation.js do not modify -->
## <MapboxGL.PointAnnotation />
### PointAnnotation represents a one-dimensional shape located at a single geographical coordinate. Consider using ShapeSource and SymbolLayer instead, if you have many points and you have static images, they'll offer much better performance.<br/>If you need interctive views please use MarkerView, as with PointAnnotation on android child views are rendered onto a bitmap for better performance.
### PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.<br/><br/>Consider using ShapeSource and SymbolLayer instead, if you have many points and you have static images,<br/>they'll offer much better performance<br/><br/>.<br/>If you need interctive views please use MarkerView,<br/>as with PointAnnotation on Android child views are rendered onto a bitmap for better performance.

### props
| Prop | Type | Default | Required | Description |
Expand All @@ -12,8 +12,8 @@
| draggable | `bool` | `false` | `false` | Enable or disable dragging. Defaults to false. |
| coordinate | `array` | `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. |
| &nbsp;&nbsp;x | `number` | `none` | `true` | FIX ME NO DESCRIPTION |
| &nbsp;&nbsp;y | `number` | `none` | `true` | FIX ME NO DESCRIPTION |
| &nbsp;&nbsp;x | `number` | `none` | `true` | See anchor |
| &nbsp;&nbsp;y | `number` | `none` | `true` | See anchor |
| 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. |
| onDragStart | `func` | `none` | `false` | This callback is fired once this annotation has started being dragged. |
Expand Down
4 changes: 2 additions & 2 deletions docs/ShapeSource.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
| tolerance | `number` | `none` | `false` | Specifies the Douglas-Peucker simplification tolerance.<br/>A greater value produces simpler geometries and improves performance.<br/>The default value is 0.375. |
| onPress | `func` | `none` | `false` | Source press listener, gets called when a user presses one of the children layers only<br/>if that layer has a higher z-index than another source layers |
| hitbox | `shape` | `none` | `false` | Overrides the default touch hitbox(44x44 pixels) for the source layers |
| &nbsp;&nbsp;width | `number` | `none` | `true` | FIX ME NO DESCRIPTION |
| &nbsp;&nbsp;height | `number` | `none` | `true` | FIX ME NO DESCRIPTION |
| &nbsp;&nbsp;width | `number` | `none` | `true` | `width` of hitbox |
| &nbsp;&nbsp;height | `number` | `none` | `true` | `height` of hitbox |

### methods
#### features([filter])
Expand Down
4 changes: 2 additions & 2 deletions docs/UserLocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| animated | `bool` | `true` | `false` | Whether location icon is animated between updates |
| renderMode | `enum` | `'normal'` | `false` | FIX ME NO DESCRIPTION |
| renderMode | `enum` | `'normal'` | `false` | Which render mode to use.<br/>Can either be `normal` or `native` |
| androidRenderMode | `enum` | `none` | `false` | native/android only render mode<br/><br/> - normal: just a circle<br/> - compass: triangle with heading<br/> - gps: large arrow<br/><br/>@platform android |
| visible | `bool` | `true` | `false` | Whether location icon is visible |
| onPress | `func` | `none` | `false` | Callback that is triggered on location icon press |
| onUpdate | `func` | `none` | `false` | Callback that is triggered on location update |
| showsUserHeadingIndicator | `bool` | `false` | `false` | Show or hide small arrow which indicates direction the device is pointing relative to north. |
| minDisplacement | `number` | `0` | `false` | FIX ME NO DESCRIPTION |
| minDisplacement | `number` | `0` | `false` | Minimum amount of movement before GPS location is updated in meters |
| children | `any` | `none` | `false` | Custom location icon of type mapbox-gl-native components |

### methods
Expand Down
4 changes: 2 additions & 2 deletions docs/VectorSource.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
| attribution | `string` | `none` | `false` | An HTML or literal text string defining the buttons to be displayed in an action sheet when the<br/>source is part of a map view’s style and the map view’s attribution button is pressed. |
| onPress | `func` | `none` | `false` | Source press listener, gets called when a user presses one of the children layers only<br/>if that layer has a higher z-index than another source layers |
| hitbox | `shape` | `none` | `false` | Overrides the default touch hitbox(44x44 pixels) for the source layers |
| &nbsp;&nbsp;width | `number` | `none` | `true` | FIX ME NO DESCRIPTION |
| &nbsp;&nbsp;height | `number` | `none` | `true` | FIX ME NO DESCRIPTION |
| &nbsp;&nbsp;width | `number` | `none` | `true` | `width` of hitbox |
| &nbsp;&nbsp;height | `number` | `none` | `true` | `height` of hitbox |

### methods
#### features([layerIDs][, filter])
Expand Down
24 changes: 12 additions & 12 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3005,7 +3005,7 @@
"name": "MapView"
},
"MarkerView": {
"description": "MarkerView allows you to place a interactive react native marker to the map. If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance.\nThis is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on android and PointAnnotation on iOS.",
"description": "MarkerView allows you to place a interactive react native marker to the map.\n\nIf you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance\n.\nThis is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on Android\nand PointAnnotation on iOS.",
"displayName": "MarkerView",
"methods": [],
"props": [
Expand All @@ -3032,14 +3032,14 @@
"required": true,
"type": "number",
"default": "none",
"description": "FIX ME NO DESCRIPTION"
"description": "`x` of anchor"
},
{
"name": "y",
"required": true,
"type": "number",
"default": "none",
"description": "FIX ME NO DESCRIPTION"
"description": "`y` of anchor"
}
]
},
Expand Down Expand Up @@ -3082,7 +3082,7 @@
"name": "NativeUserLocation"
},
"PointAnnotation": {
"description": "PointAnnotation represents a one-dimensional shape located at a single geographical coordinate. Consider using ShapeSource and SymbolLayer instead, if you have many points and you have static images, they'll offer much better performance.\nIf you need interctive views please use MarkerView, as with PointAnnotation on android child views are rendered onto a bitmap for better performance.",
"description": "PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.\n\nConsider using ShapeSource and SymbolLayer instead, if you have many points and you have static images,\nthey'll offer much better performance\n\n.\nIf you need interctive views please use MarkerView,\nas with PointAnnotation on Android child views are rendered onto a bitmap for better performance.",
"displayName": "PointAnnotation",
"methods": [
{
Expand Down Expand Up @@ -3154,14 +3154,14 @@
"required": true,
"type": "number",
"default": "none",
"description": "FIX ME NO DESCRIPTION"
"description": "See anchor"
},
{
"name": "y",
"required": true,
"type": "number",
"default": "none",
"description": "FIX ME NO DESCRIPTION"
"description": "See anchor"
}
]
},
Expand Down Expand Up @@ -3709,14 +3709,14 @@
"required": true,
"type": "number",
"default": "none",
"description": "FIX ME NO DESCRIPTION"
"description": "`width` of hitbox"
},
{
"name": "height",
"required": true,
"type": "number",
"default": "none",
"description": "FIX ME NO DESCRIPTION"
"description": "`height` of hitbox"
}
]
},
Expand Down Expand Up @@ -5215,7 +5215,7 @@
"required": false,
"type": "enum",
"default": "'normal'",
"description": "FIX ME NO DESCRIPTION"
"description": "Which render mode to use.\nCan either be `normal` or `native`"
},
{
"name": "androidRenderMode",
Expand Down Expand Up @@ -5257,7 +5257,7 @@
"required": false,
"type": "number",
"default": "0",
"description": "FIX ME NO DESCRIPTION"
"description": "Minimum amount of movement before GPS location is updated in meters"
},
{
"name": "children",
Expand Down Expand Up @@ -5433,14 +5433,14 @@
"required": true,
"type": "number",
"default": "none",
"description": "FIX ME NO DESCRIPTION"
"description": "`width` of hitbox"
},
{
"name": "height",
"required": true,
"type": "number",
"default": "none",
"description": "FIX ME NO DESCRIPTION"
"description": "`height` of hitbox"
}
]
},
Expand Down
14 changes: 12 additions & 2 deletions javascript/components/MarkerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ import PointAnnotation from './PointAnnotation';
export const NATIVE_MODULE_NAME = 'RCTMGLMarkerView';

/**
* MarkerView allows you to place a interactive react native marker to the map. If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance.
* This is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on android and PointAnnotation on iOS.
* MarkerView allows you to place a interactive react native marker to the map.
*
* If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance
* .
* This is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on Android
* and PointAnnotation on iOS.
*/
class MarkerView extends React.PureComponent {
static propTypes = {
Expand All @@ -31,7 +35,13 @@ class MarkerView extends React.PureComponent {
* Defaults to the center of the view.
*/
anchor: PropTypes.shape({
/**
* `x` of anchor
*/
x: PropTypes.number.isRequired,
/**
* `y` of anchor
*/
y: PropTypes.number.isRequired,
}),

Expand Down
16 changes: 14 additions & 2 deletions javascript/components/PointAnnotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ const styles = StyleSheet.create({
});

/**
* PointAnnotation represents a one-dimensional shape located at a single geographical coordinate. Consider using ShapeSource and SymbolLayer instead, if you have many points and you have static images, they'll offer much better performance.
* If you need interctive views please use MarkerView, as with PointAnnotation on android child views are rendered onto a bitmap for better performance.
* PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.
*
* Consider using ShapeSource and SymbolLayer instead, if you have many points and you have static images,
* they'll offer much better performance
*
* .
* If you need interctive views please use MarkerView,
* as with PointAnnotation on Android child views are rendered onto a bitmap for better performance.
*/
class PointAnnotation extends React.PureComponent {
static propTypes = {
Expand Down Expand Up @@ -68,7 +74,13 @@ class PointAnnotation extends React.PureComponent {
* Defaults to the center of the view.
*/
anchor: PropTypes.shape({
/**
* See anchor
*/
x: PropTypes.number.isRequired,
/**
* See anchor
*/
y: PropTypes.number.isRequired,
}),

Expand Down
6 changes: 6 additions & 0 deletions javascript/components/ShapeSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ class ShapeSource extends NativeBridgeComponent(AbstractSource) {
* Overrides the default touch hitbox(44x44 pixels) for the source layers
*/
hitbox: PropTypes.shape({
/**
* `width` of hitbox
*/
width: PropTypes.number.isRequired,
/**
* `height` of hitbox
*/
height: PropTypes.number.isRequired,
}),
};
Expand Down
7 changes: 7 additions & 0 deletions javascript/components/UserLocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ class UserLocation extends React.Component {
*/
animated: PropTypes.bool,

/**
* Which render mode to use.
* Can either be `normal` or `native`
*/
renderMode: PropTypes.oneOf(['normal', 'native']),

/**
Expand Down Expand Up @@ -93,6 +97,9 @@ class UserLocation extends React.Component {
*/
showsUserHeadingIndicator: PropTypes.bool,

/**
* Minimum amount of movement before GPS location is updated in meters
*/
minDisplacement: PropTypes.number,

/**
Expand Down
6 changes: 6 additions & 0 deletions javascript/components/VectorSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ class VectorSource extends NativeBridgeComponent(AbstractSource) {
* Overrides the default touch hitbox(44x44 pixels) for the source layers
*/
hitbox: PropTypes.shape({
/**
* `width` of hitbox
*/
width: PropTypes.number.isRequired,
/**
* `height` of hitbox
*/
height: PropTypes.number.isRequired,
}),
};
Expand Down

0 comments on commit 9bb9054

Please sign in to comment.