Skip to content

Commit

Permalink
Docs: Improve list styles (#3657)
Browse files Browse the repository at this point in the history
* Docs: Fix list for TileState

https://maplibre.org/maplibre-gl-js/docs/API/types/TileState/

* Docs: Fix list for MercatorCoordinate

https://maplibre.org/maplibre-gl-js/docs/API/classes/MercatorCoordinate/

* Docs: Fix list for CustomLayerInterface

https://maplibre.org/maplibre-gl-js/docs/API/interfaces/CustomLayerInterface/

* Docs: Streamline list formatting

Follow up to 2ff14cb to get it in line with the other code comments.

* Docs: Fix list styles in ui/map

* Docs: Fix list style for ui/popup
  • Loading branch information
tordans authored Feb 5, 2024
1 parent 2ff14cb commit 3d3a268
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/geo/mercator_coordinate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function mercatorScale(lat: number) {
* A `MercatorCoordinate` object represents a projected three dimensional position.
*
* `MercatorCoordinate` uses the web mercator projection ([EPSG:3857](https://epsg.io/3857)) with slightly different units:
*
* - the size of 1 unit is the width of the projected world instead of the "mercator meter"
* - the origin of the coordinate space is at the north-west corner instead of the middle
*
Expand Down
1 change: 1 addition & 0 deletions src/source/tile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {ExpiryData} from '../util/ajax';

/**
* The tile's state, can be:
*
* - `loading` Tile data is in the process of loading.
* - `loaded` Tile data has been loaded. Tile can be rendered.
* - `reloading` Tile data has been loaded and is being updated. Tile can be rendered.
Expand Down
1 change: 1 addition & 0 deletions src/style/style_layer/custom_style_layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type CustomRenderMethod = (gl: WebGLRenderingContext|WebGL2RenderingContext, mat
* and they should appropriately handle {@link MapContextEvent} with `webglcontextlost` and `webglcontextrestored`.
*
* The `renderingMode` property controls whether the layer is treated as a `"2d"` or `"3d"` map layer. Use:
*
* - `"renderingMode": "3d"` to use the depth buffer and share it with other layers
* - `"renderingMode": "2d"` to add a layer with no depth. If you need to use the depth buffer for a `"2d"` layer you must use an offscreen
* framebuffer and {@link CustomLayerInterface#prerender}
Expand Down
10 changes: 7 additions & 3 deletions src/ui/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export type MapOptions = {
pitch?: number;
/**
* If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:
*
* - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire
* container, there will be blank space beyond 180 and -180 degrees longitude.
* - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the
Expand Down Expand Up @@ -1094,6 +1095,7 @@ export class Map extends Camera {

/**
* Returns the state of `renderWorldCopies`. If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:
*
* - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire
* container, there will be blank space beyond 180 and -180 degrees longitude.
* - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the
Expand All @@ -1111,6 +1113,7 @@ export class Map extends Camera {
* Sets the state of `renderWorldCopies`.
*
* @param renderWorldCopies - If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:
*
* - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire
* container, there will be blank space beyond 180 and -180 degrees longitude.
* - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the
Expand Down Expand Up @@ -2694,9 +2697,9 @@ export class Map extends Camera {
*
* This method can only be used with sources that have a `feature.id` attribute. The `feature.id` attribute can be defined in three ways:
*
* * For vector or GeoJSON sources, including an `id` attribute in the original data file.
* * For vector or GeoJSON sources, using the [`promoteId`](https://maplibre.org/maplibre-style-spec/sources/#vector-promoteId) option at the time the source is defined.
* * For GeoJSON sources, using the [`generateId`](https://maplibre.org/maplibre-style-spec/sources/#geojson-generateId) option to auto-assign an `id` based on the feature's index in the source data. If you change feature data using `map.getSource('some id').setData(..)`, you may need to re-apply state taking into account updated `id` values.
* - For vector or GeoJSON sources, including an `id` attribute in the original data file.
* - For vector or GeoJSON sources, using the [`promoteId`](https://maplibre.org/maplibre-style-spec/sources/#vector-promoteId) option at the time the source is defined.
* - For GeoJSON sources, using the [`generateId`](https://maplibre.org/maplibre-style-spec/sources/#geojson-generateId) option to auto-assign an `id` based on the feature's index in the source data. If you change feature data using `map.getSource('some id').setData(..)`, you may need to re-apply state taking into account updated `id` values.
*
* _Note: You can use the [`feature-state` expression](https://maplibre.org/maplibre-style-spec/expressions/#feature-state) to access the values in a feature's state object for the purposes of styling._
*
Expand Down Expand Up @@ -3012,6 +3015,7 @@ export class Map extends Camera {
/**
* @internal
* Call when a (re-)render of the map is required:
*
* - The style has changed (`setPaintProperty()`, etc.)
* - Source data has changed (e.g. tiles have finished loading)
* - The map has is moving (or just finished moving)
Expand Down
2 changes: 2 additions & 0 deletions src/ui/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ const defaultOptions = {

/**
* A pixel offset specified as:
*
* - a single number specifying a distance from the location
* - a {@link PointLike} specifying a constant offset
* - an object of {@link Point}s specifying an offset for each anchor position
*
* Negative offsets indicate left and up.
*/
export type Offset = number | PointLike | {
Expand Down

0 comments on commit 3d3a268

Please sign in to comment.