Skip to content

Commit

Permalink
Added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick committed Oct 23, 2017
1 parent a58c493 commit a7c756d
Show file tree
Hide file tree
Showing 10 changed files with 1,848 additions and 181 deletions.
32 changes: 32 additions & 0 deletions docs/CircleLayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## <MapboxGL.CircleLayer />
### CircleLayer is a style layer that renders one or more filled circles on the map.

### props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| id | `string` | `none` | `false` | A string that uniquely identifies the source in the style to which it is added. |
| sourceID | `string` | `MapboxGL.StyleSource.DefaultSourceID` | `false` | The source from which to obtain the data to style.<br/>If the source has not yet been added to the current style, the behavior is undefined. |
| sourceLayerID | `string` | `none` | `false` | Identifier of the layer within the source identified by the sourceID property<br/>from which the receiver obtains the data to style. |
| aboveLayerID | `string` | `none` | `false` | Inserts a layer above aboveLayerID. |
| belowLayerID | `string` | `none` | `false` | Inserts a layer below belowLayerID |
| layerIndex | `number` | `none` | `false` | Inserts a layer at a specified index |
| filter | `array` | `none` | `false` | Filter only the features in the source layer that satisfy a condition that you define |
| minZoomLevel | `number` | `none` | `false` | The minimum zoom level at which the layer gets parsed and appears. |
| maxZoomLevel | `number` | `none` | `false` | The maximum zoom level at which the layer gets parsed and appears. |
| style | `custom` | `none` | `false` | Customizable style attributes |


### styles
| Name | Type | Requires | Disabled By | Description |
| ---- | :--: | :------: | :---------: | :----------: |
| `visibility` | `enum` | `none` | `none` | Whether this layer is displayed. |
| `circleRadius` | `number` | `none` | `none` | Circle radius. |
| `circleColor` | `color` | `none` | `none` | The fill color of the circle. |
| `circleBlur` | `number` | `none` | `none` | Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity. |
| `circleOpacity` | `number` | `none` | `none` | The opacity at which the circle will be drawn. |
| `circleTranslate` | `array` | `none` | `none` | The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. |
| `circleTranslateAnchor` | `enum` | `circle-translate` | `none` | Controls the translation reference point. |
| `circlePitchScale` | `enum` | `none` | `none` | Controls the scaling behavior of the circle when the map is pitched. |
| `circleStrokeWidth` | `number` | `none` | `none` | The width of the circle's stroke. Strokes are placed outside of the `circle-radius`. |
| `circleStrokeColor` | `color` | `none` | `none` | The stroke color of the circle. |
| `circleStrokeOpacity` | `number` | `none` | `none` | The opacity of the circle's stroke. |
29 changes: 29 additions & 0 deletions docs/FillExtrusionLayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## <MapboxGL.FillExtrusionLayer />
### FillExtrusionLayer is a style layer that renders one or more 3D extruded polygons on the map.

### props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| id | `string` | `none` | `false` | A string that uniquely identifies the source in the style to which it is added. |
| sourceID | `string` | `MapboxGL.StyleSource.DefaultSourceID` | `false` | The source from which to obtain the data to style. If the source has not yet been added to the current style, the behavior is undefined. |
| sourceLayerID | `string` | `none` | `false` | Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. |
| aboveLayerID | `string` | `none` | `false` | Inserts a layer above aboveLayerID. |
| belowLayerID | `string` | `none` | `false` | Inserts a layer below belowLayerID |
| layerIndex | `number` | `none` | `false` | Inserts a layer at a specified index |
| filter | `array` | `none` | `false` | Filter only the features in the source layer that satisfy a condition that you define |
| minZoomLevel | `number` | `none` | `false` | The minimum zoom level at which the layer gets parsed and appears. |
| maxZoomLevel | `number` | `none` | `false` | The maximum zoom level at which the layer gets parsed and appears. |
| style | `custom` | `none` | `false` | Customizable style attributes |


### styles
| Name | Type | Requires | Disabled By | Description |
| ---- | :--: | :------: | :---------: | :----------: |
| `visibility` | `enum` | `none` | `none` | Whether this layer is displayed. |
| `fillExtrusionOpacity` | `number` | `none` | `none` | The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available. |
| `fillExtrusionColor` | `color` | `none` | `fill-extrusion-pattern` | The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity. |
| `fillExtrusionTranslate` | `array` | `none` | `none` | The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively. |
| `fillExtrusionTranslateAnchor` | `enum` | `fill-extrusion-translate` | `none` | Controls the translation reference point. |
| `fillExtrusionPattern` | `string` | `none` | `none` | Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). |
| `fillExtrusionHeight` | `number` | `none` | `none` | The height with which to extrude this layer. |
| `fillExtrusionBase` | `number` | `fill-extrusion-height` | `none` | The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`. |
28 changes: 28 additions & 0 deletions docs/FillLayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## <MapboxGL.FillLayer />
### FillLayer is a style layer that renders one or more filled (and optionally stroked) polygons on the map.

### props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| id | `string` | `none` | `false` | A string that uniquely identifies the source in the style to which it is added. |
| sourceID | `string` | `MapboxGL.StyleSource.DefaultSourceID` | `false` | The source from which to obtain the data to style. If the source has not yet been added to the current style, the behavior is undefined. |
| aboveLayerID | `string` | `none` | `false` | Inserts a layer above aboveLayerID. |
| belowLayerID | `string` | `none` | `false` | Inserts a layer below belowLayerID |
| layerIndex | `number` | `none` | `false` | Inserts a layer at a specified index |
| filter | `array` | `none` | `false` | Filter only the features in the source layer that satisfy a condition that you define |
| minZoomLevel | `number` | `none` | `false` | The minimum zoom level at which the layer gets parsed and appears. |
| maxZoomLevel | `number` | `none` | `false` | The maximum zoom level at which the layer gets parsed and appears. |
| style | `custom` | `none` | `false` | Customizable style attributes |


### styles
| Name | Type | Requires | Disabled By | Description |
| ---- | :--: | :------: | :---------: | :----------: |
| `visibility` | `enum` | `none` | `none` | Whether this layer is displayed. |
| `fillAntialias` | `boolean` | `none` | `none` | Whether or not the fill should be antialiased. |
| `fillOpacity` | `number` | `none` | `none` | The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used. |
| `fillColor` | `color` | `none` | `fill-pattern` | The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used. |
| `fillOutlineColor` | `color` | `none` | `fill-pattern` | The outline color of the fill. Matches the value of `fill-color` if unspecified. |
| `fillTranslate` | `array` | `none` | `none` | The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. |
| `fillTranslateAnchor` | `enum` | `fill-translate` | `none` | Controls the translation reference point. |
| `fillPattern` | `string` | `none` | `none` | Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). |
36 changes: 36 additions & 0 deletions docs/LineLayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## <MapboxGL.LineLayer />
### LineLayer is a style layer that renders one or more stroked polylines on the map.

### props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| id | `string` | `none` | `false` | A string that uniquely identifies the source in the style to which it is added. |
| sourceID | `string` | `MapboxGL.StyleSource.DefaultSourceID` | `false` | The source from which to obtain the data to style.<br/>If the source has not yet been added to the current style, the behavior is undefined. |
| sourceLayerID | `string` | `none` | `false` | Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. |
| aboveLayerID | `string` | `none` | `false` | Inserts a layer above aboveLayerID. |
| belowLayerID | `string` | `none` | `false` | Inserts a layer below belowLayerID |
| layerIndex | `number` | `none` | `false` | Inserts a layer at a specified index |
| filter | `array` | `none` | `false` | Filter only the features in the source layer that satisfy a condition that you define |
| minZoomLevel | `number` | `none` | `false` | The minimum zoom level at which the layer gets parsed and appears. |
| maxZoomLevel | `number` | `none` | `false` | The maximum zoom level at which the layer gets parsed and appears. |
| style | `custom` | `none` | `false` | Customizable style attributes |


### styles
| Name | Type | Requires | Disabled By | Description |
| ---- | :--: | :------: | :---------: | :----------: |
| `lineCap` | `enum` | `none` | `none` | The display of line endings. |
| `lineJoin` | `enum` | `none` | `none` | The display of lines when joining. |
| `lineMiterLimit` | `number` | `none` | `none` | Used to automatically convert miter joins to bevel joins for sharp angles. |
| `lineRoundLimit` | `number` | `none` | `none` | Used to automatically convert round joins to miter joins for shallow angles. |
| `visibility` | `enum` | `none` | `none` | Whether this layer is displayed. |
| `lineOpacity` | `number` | `none` | `none` | The opacity at which the line will be drawn. |
| `lineColor` | `color` | `none` | `line-pattern` | The color with which the line will be drawn. |
| `lineTranslate` | `array` | `none` | `none` | The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. |
| `lineTranslateAnchor` | `enum` | `line-translate` | `none` | Controls the translation reference point. |
| `lineWidth` | `number` | `none` | `none` | Stroke thickness. |
| `lineGapWidth` | `number` | `none` | `none` | Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap. |
| `lineOffset` | `number` | `none` | `none` | The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset. |
| `lineBlur` | `number` | `none` | `none` | Blur applied to the line, in pixels. |
| `lineDasharray` | `array` | `none` | `line-pattern` | Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. |
| `linePattern` | `string` | `none` | `none` | Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). |
17 changes: 2 additions & 15 deletions docs/MapView.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
## <MapboxGL.MapView />
### MapView backed by Mapbox Native GL


### props
| Prop | Type | Default | Required | Description |
Expand Down Expand Up @@ -36,14 +35,9 @@
| onFlyToComplete | `func` | `none` | `false` | This event is triggered when a fly to animation is cancelled or completed after calling flyTo |
| onSetCameraComplete | `func` | `none` | `false` | This event is triggered once the camera is finished after calling setCamera |


### methods


#### fitBounds(northEastCoordinates, southWestCoordinates[, padding][, duration])

##### arguments

| Name | Type | Required | Description |
| ---- | :--: | :------: | :----------: |
| `northEastCoordinates` | `Array` | `Yes` | North east coordinate of bound |
Expand All @@ -59,11 +53,8 @@ this.map.fitBounds([lng, lat], [lng, lat], 20, 1000)
```



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

##### arguments

| Name | Type | Required | Description |
| ---- | :--: | :------: | :----------: |
| `coordinates` | `Array` | `Yes` | Coordinates that map camera will jump too |
Expand All @@ -77,11 +68,8 @@ this.map.flyTo([lng, lat], 12000)
```



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

##### arguments

| Name | Type | Required | Description |
| ---- | :--: | :------: | :----------: |
| `zoomLevel` | `Number` | `Yes` | Zoom level that the map camera will animate too |
Expand All @@ -95,11 +83,8 @@ this.map.zoomTo(16, 100)
```



#### setCamera(config)

##### arguments

| Name | Type | Required | Description |
| ---- | :--: | :------: | :----------: |
| `config` | `Object` | `Yes` | Camera configuration |
Expand All @@ -121,3 +106,5 @@ this.map.setCamera({
})
```



17 changes: 17 additions & 0 deletions docs/ShapeSource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## <MapboxGL.ShapeSource />
### ShapeSource is a map content source that supplies vector shapes to be shown on the map.<br/>The shape may be a url or a GeoJSON object

### props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| id | `string` | `MapboxGL.StyleSource.DefaultSourceID` | `false` | A string that uniquely identifies the source. |
| url | `string` | `none` | `false` | An HTTP(S) URL, absolute file URL, or local file URL relative to the current application’s resource bundle. |
| shape | `object` | `none` | `false` | The contents of the source. A shape can represent a GeoJSON geometry, a feature, or a feature colllection. |
| cluster | `bool` | `none` | `false` | Enables clustering on the source for point shapes. |
| clusterRadius | `number` | `none` | `false` | Specifies the radius of each cluster if clustering is enabled.<br/>A value of 512 produces a radius equal to the width of a tile.<br/>The default value is 50. |
| clusterMaxZoomLevel | `number` | `none` | `false` | Specifies the maximum zoom level at which to cluster points if clustering is enabled.<br/>Defaults to one zoom level less than the value of maxZoomLevel so that, at the maximum zoom level,<br/>the shapes are not clustered. |
| maxZoomLevel | `number` | `none` | `false` | Specifies the maximum zoom level at which to create vector tiles.<br/>A greater value produces greater detail at high zoom levels.<br/>The default value is 18. |
| buffer | `number` | `none` | `false` | Specifies the size of the tile buffer on each side.<br/>A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself.<br/>Larger values produce fewer rendering artifacts near tile edges and slower performance.<br/>The default value is 128. |
| 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. |


Loading

0 comments on commit a7c756d

Please sign in to comment.