-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eslint JSDoc fixes #8960
Eslint JSDoc fixes #8960
Changes from all commits
1469d23
8bcc7a9
c5e967a
54b7841
021056e
910b2b5
fe585c9
39c15d3
97ad850
8812751
f957713
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,10 +257,10 @@ class Transform { | |
|
||
/** | ||
* Return a zoom level that will cover all tiles the transform | ||
* @param {Object} options | ||
* @param {number} options.tileSize | ||
* @param {boolean} options.roundZoom | ||
* @returns {number} zoom level | ||
* @param {Object} options options | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are a lot of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's see how this looks on the live docs — we might need to come up with a way to filter this out or maybe PR the plugin repo with an option to ignore. |
||
* @param {number} options.tileSize Tile size, expressed in screen pixels. | ||
* @param {boolean} options.roundZoom Target zoom level. If true, the value will be rounded to the closest integer. Otherwise the value will be floored. | ||
* @returns {number} zoom level An integer zoom level at which all tiles will be visible. | ||
*/ | ||
coveringZoomLevel(options: {roundZoom?: boolean, tileSize: number}) { | ||
const z = (options.roundZoom ? Math.round : Math.floor)( | ||
|
@@ -310,6 +310,7 @@ class Transform { | |
* @param {boolean} options.reparseOverscaled | ||
* @param {boolean} options.renderWorldCopies | ||
* @returns {Array<OverscaledTileID>} OverscaledTileIDs | ||
* @private | ||
*/ | ||
coveringTiles( | ||
options: { | ||
|
@@ -460,6 +461,7 @@ class Transform { | |
* Given a location, return the screen point that corresponds to it | ||
* @param {LngLat} lnglat location | ||
* @returns {Point} screen point | ||
* @private | ||
*/ | ||
locationPoint(lnglat: LngLat) { | ||
return this.coordinatePoint(this.locationCoordinate(lnglat)); | ||
|
@@ -469,6 +471,7 @@ class Transform { | |
* Given a point on screen, return its lnglat | ||
* @param {Point} p screen point | ||
* @returns {LngLat} lnglat location | ||
* @private | ||
*/ | ||
pointLocation(p: Point) { | ||
return this.coordinateLocation(this.pointCoordinate(p)); | ||
|
@@ -479,6 +482,7 @@ class Transform { | |
* coordinate that represents it at this transform's zoom level. | ||
* @param {LngLat} lnglat | ||
* @returns {Coordinate} | ||
* @private | ||
*/ | ||
locationCoordinate(lnglat: LngLat) { | ||
return MercatorCoordinate.fromLngLat(lnglat); | ||
|
@@ -488,6 +492,7 @@ class Transform { | |
* Given a Coordinate, return its geographical position. | ||
* @param {Coordinate} coord | ||
* @returns {LngLat} lnglat | ||
* @private | ||
*/ | ||
coordinateLocation(coord: MercatorCoordinate) { | ||
return coord.toLngLat(); | ||
|
@@ -525,6 +530,7 @@ class Transform { | |
* Given a coordinate, return the screen point that corresponds to it | ||
* @param {Coordinate} coord | ||
* @returns {Point} screen point | ||
* @private | ||
*/ | ||
coordinatePoint(coord: MercatorCoordinate) { | ||
const p = [coord.x * this.worldSize, coord.y * this.worldSize, 0, 1]; | ||
|
@@ -535,6 +541,7 @@ class Transform { | |
/** | ||
* Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not | ||
* an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region. | ||
* @returns {LngLatBounds} Returns a {@link LngLatBounds} object describing the map's geographical bounds. | ||
*/ | ||
getBounds(): LngLatBounds { | ||
return new LngLatBounds() | ||
|
@@ -546,6 +553,7 @@ class Transform { | |
|
||
/** | ||
* Returns the maximum geographical bounds the map is constrained to, or `null` if none set. | ||
* @returns {LngLatBounds} {@link LngLatBounds} | ||
*/ | ||
getMaxBounds(): LngLatBounds | null { | ||
if (!this.latRange || this.latRange.length !== 2 || | ||
|
@@ -556,6 +564,7 @@ class Transform { | |
|
||
/** | ||
* Sets or clears the map's geographical constraints. | ||
* @param {LngLatBounds} bounds A {@link LngLatBounds} object describing the new geographic boundaries of the map. | ||
*/ | ||
setMaxBounds(bounds?: LngLatBounds) { | ||
if (bounds) { | ||
|
@@ -571,6 +580,7 @@ class Transform { | |
/** | ||
* Calculate the posMatrix that, given a tile coordinate, would be used to display the tile on a map. | ||
* @param {UnwrappedTileID} unwrappedTileID; | ||
* @private | ||
*/ | ||
calculatePosMatrix(unwrappedTileID: UnwrappedTileID, aligned: boolean = false): Float32Array { | ||
const posMatrixKey = unwrappedTileID.key; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,7 +137,7 @@ class ImageSource extends Evented implements Source { | |
* Updates the image URL and, optionally, the coordinates. To avoid having the image flash after changing, | ||
* set the `raster-fade-duration` paint property on the raster layer to 0. | ||
* | ||
* @param {Object} options | ||
* @param {Object} options Options object. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have the type annotations, should we use that instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that's a good long-term goal, but I think it's out of scope for this change. Or is there a technique you know of to link type annotations automatically? |
||
* @param {string} [options.url] Required image URL. | ||
* @param {Array<Array<number>>} [options.coordinates] Four geographical coordinates, | ||
* represented as arrays of longitude and latitude numbers, which define the corners of the image. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to prevent redundantly specifying
@private
on every method if the parent class is marked@private
anyway?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is not supported. From the JSDoc docs: