From 790b7f3ddb42b62748740f7812fe2afa524abf4e Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 16 Feb 2018 10:58:27 -0800 Subject: [PATCH] Update docs.json to include mapView.getCenter and mapView.getZoom --- docs/MapView.md | 13 ++++++++++--- docs/ShapeSource.md | 2 +- docs/docs.json | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/docs/MapView.md b/docs/MapView.md index 1115b1545..7ec7af857 100644 --- a/docs/MapView.md +++ b/docs/MapView.md @@ -24,7 +24,7 @@ | attributionEnabled | `bool` | `true` | `false` | The Mapbox terms of service, which governs the use of Mapbox-hosted vector tiles and styles,
[requires](https://www.mapbox.com/help/how-attribution-works/) these copyright notices to accompany any map that features Mapbox-designed styles, OpenStreetMap data, or other Mapbox data such as satellite or terrain data.
If that applies to this map view, do not hide this view or remove any notices from it.

You are additionally [required](https://www.mapbox.com/help/how-mobile-apps-work/#telemetry) to provide users with the option to disable anonymous usage and location sharing (telemetry).
If this view is hidden, you must implement this setting elsewhere in your app. See our website for [Android](https://www.mapbox.com/android-docs/map-sdk/overview/#telemetry-opt-out) and [iOS](https://www.mapbox.com/ios-sdk/#telemetry_opt_out) for implementation details.

Enable/Disable attribution on map. For iOS you need to add MGLMapboxMetricsEnabledSettingShownInApp=YES
to your Info.plist | | logoEnabled | `bool` | `true` | `false` | Enable/Disable the logo on the map. | | compassEnabled | `bool` | `none` | `false` | Enable/Disable the compass from appearing on the map | -| textureMode | `bool` | `false` | `false` | Enable/Disable TextureMode instead of SurfaceView | +| textureMode | `bool` | `false` | `false` | Enable/Disable TextureMode insted of SurfaceView | | onPress | `func` | `none` | `false` | Map press listener, gets called when a user presses the map | | onLongPress | `func` | `none` | `false` | Map long press listener, gets called when a user long presses the map | | onRegionWillChange | `func` | `none` | `false` | This event is triggered whenever the currently displayed map region is about to change. | @@ -224,21 +224,22 @@ Takes snapshot of map with current tiles and returns a URI to the image | `writeToDisk` | `Boolean` | `Yes` | If true will create a temp file, otherwise it is in base64 | - #### getZoom() Returns the current zoom of the map view. - ##### arguments | Name | Type | Required | Description | | ---- | :--: | :------: | :----------: | + + ```javascript const zoom = await this._map.getZoom(); ``` + #### getCenter() Returns the map's geographical centerpoint @@ -247,6 +248,12 @@ Returns the map's geographical centerpoint | Name | Type | Required | Description | | ---- | :--: | :------: | :----------: | + + + ```javascript const center = await this._map.getCenter(); ``` + + + diff --git a/docs/ShapeSource.md b/docs/ShapeSource.md index 0855b029f..c967b65f6 100644 --- a/docs/ShapeSource.md +++ b/docs/ShapeSource.md @@ -6,7 +6,7 @@ | ---- | :--: | :-----: | :------: | :----------: | | 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 collection. | +| 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.
A value of 512 produces a radius equal to the width of a tile.
The default value is 50. | | clusterMaxZoomLevel | `number` | `none` | `false` | Specifies the maximum zoom level at which to cluster points if clustering is enabled.
Defaults to one zoom level less than the value of maxZoomLevel so that, at the maximum zoom level,
the shapes are not clustered. | diff --git a/docs/docs.json b/docs/docs.json index e9c7a381a..0a23ebce2 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -1206,6 +1206,42 @@ }, "description": "Takes snapshot of map with current tiles and returns a URI to the image", "examples": [] + }, + { + "name": "getZoom", + "docblock": "Returns the current zoom of the map view.\n\n@example\nconst zoom = await this._map.getZoom();\n\n@return {Number}", + "modifiers": [ + "async" + ], + "params": [], + "returns": { + "description": null, + "type": { + "name": "Number" + } + }, + "description": "Returns the current zoom of the map view.", + "examples": [ + "\nconst zoom = await this._map.getZoom();\n\n" + ] + }, + { + "name": "getCenter", + "docblock": "Returns the map's geographical centerpoint\n\n@example\nconst center = await this._map.getCenter();\n\n@return {Array} Coordinates", + "modifiers": [ + "async" + ], + "params": [], + "returns": { + "description": "Coordinates", + "type": { + "name": "Array" + } + }, + "description": "Returns the map's geographical centerpoint", + "examples": [ + "\nconst center = await this._map.getCenter();\n\n" + ] } ], "props": [