You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ce528a4
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/api-reference/aggregation-layers/hexagon-layer.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -517,6 +517,7 @@ This callback will be called when hexagon elevation domain has been calculated.
517
517
518
518
The [PickingInfo.object](../../developer-guide/interactivity.md#the-pickinginfo-object) field returned by hover/click events of this layer represents an aggregated hexagon. The object contains the following fields:
519
519
520
+
-`position` (number[] | null) - Center of the picked hexagon in the source CRS, or `null` when inverse projection is unavailable.
520
521
-`col` (number) - Column index of the picked hexagon.
521
522
-`row` (number) - Row index of the picked hexagon.
522
523
-`colorValue` (number) - Aggregated color value, as determined by `getColorWeight` and `colorAggregation`
@@ -28,7 +28,7 @@ Inherits [View options](./view.md#constructor), including layout, padding and co
28
28
| Option | Default | Description |
29
29
| --- | --- | --- |
30
30
|`crs`| Required | A supported planar CRS definition: an identifier such as `EPSG:3857`, a PROJ string, WKT, PROJJSON object, or math.gl spatial-reference object. Linear axis units are read from the descriptor. |
31
-
|`resolution`|`0`|Maximum subdivision cell size in WGS84 degrees for paths, polygons and bitmaps. Smaller positive values smooth projected curves at higher processing cost. Zero disables subdivision. |
31
+
|`resolution`|`0`|Subdivision intervals around the earth for paths, polygons and bitmaps. The step is `EarthCircumference / resolution`, converted to source CRS units. Higher values generate more detailed geometry. Zero disables subdivision. |
32
32
|`orthographic`|`false`| Use an orthographic camera instead of perspective. |
33
33
34
34
The descriptor supplies conversion functions, WGS84 normalization, target-coordinate bounds and ground distance scales. For example, Web Mercator normalizes longitude and clamps latitude to its supported range. Bounds describe the size-sampling rectangle; they do not clip geometry.
@@ -73,10 +73,10 @@ When displaying multiple views with different projections, create a separate lay
73
73
## Limitations
74
74
75
75
- Tiled layers and `WMSLayer` are not supported, including `TileLayer`, `Tile3DLayer`, `MVTLayer`, `TerrainLayer` and layers built on them.
76
-
-`BitmapLayer` approximates the projection with a triangle mesh. A positive `resolution` creates an interior grid in WGS84 and projects every grid vertex; smaller values improve the approximation at a higher processing cost. Image coordinates are linearly interpolated within each triangle. If the image is generated in a different coordinate system than WGS84, subdivision cannot correct its pixel-to-coordinate mapping.
76
+
-`BitmapLayer` approximates the projection with a triangle mesh. A positive `resolution` creates an interior grid in the source CRS and projects every grid vertex; higher values improve the approximation at a higher processing cost. Image coordinates are linearly interpolated within each triangle. Subdivision cannot correct an image's pixel-to-coordinate mapping when it differs from the declared source CRS.
77
77
- Great-circle paths are not supported by `GreatCircleLayer` or `ArcLayer` with `greatCircle: true`. They fall back to ordinary arcs between projected endpoints, as with `greatCircle: false`. To preserve a great-circle path, sample it in geographic coordinates and render the samples with `PathLayer`.
78
-
-`LineLayer`, `ArcLayer`, `PathLayer` and `SolidPolygonLayer` ignore `wrapLongitude` when the viewport uses preprojection. Split geometry at the desired longitude boundary before passing it to these layers.
79
-
- With `coordinateSystem: 'default'`, layer positions are interpreted as coordinates in WGS84. `modelMatrix`is applied before conversion, and `coordinateOrigin` is ignored. Bypass this behavior with `coordinateSystem: 'cartesian'`. Cartesian positions are in target CRS units in `crs`, and `modelMatrix` and `coordinateOrigin` both apply.
78
+
-`LineLayer`, `ArcLayer`, `PathLayer` and `SolidPolygonLayer` ignore `wrapLongitude` when the layer uses CPU preprojection or its source coordinates are not WGS84. Split geometry at the desired longitude boundary before passing it to these layers.
79
+
- With `coordinateSystem: 'default'`, layer positions are interpreted as coordinates in WGS84. `modelMatrix`and then `coordinateOrigin` are applied in the source CRS before conversion. Use a CRS identifier or PROJ string to declare another source CRS. Positions whose CRS signature matches the view's descriptor bypass CPU conversion. Legacy `coordinateSystem: 'cartesian'` also bypasses conversion. Cartesian positions are in target CRS units in `crs`, and `modelMatrix` and `coordinateOrigin` both apply.
80
80
- Split geometry at projection discontinuities before passing it to the layer. This view does not automatically clip geometry at those boundaries. The converter must return finite coordinates for the geometry you render.
81
81
- Picked coordinates are returned as world coordinates in WGS84. They may be unavailable where the descriptor’s inverse converter cannot return a valid position.
Copy file name to clipboardExpand all lines: docs/api-reference/core/custom-projection-viewport.md
+2-6Lines changed: 2 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,13 +48,9 @@ The local scale field samples the descriptor's finite target-coordinate `renderi
48
48
49
49
Inherits [Viewport](./viewport.md) methods with these coordinate semantics:
50
50
51
-
### `preproject(position)`
51
+
### `getPreprojection(sourceCrs)`
52
52
53
-
Normalizes WGS84 coordinates and converts them to target XYZ. Independent of camera state.
54
-
55
-
### `postUnproject(position)`
56
-
57
-
Delegates target XYZ conversion to `crs.converter.WGS84.to`. Returns `null` if math.gl reports a conversion failure.
53
+
Returns `{preproject, unpreproject, packedCrs}` for the resolved source descriptor. When its signature matches the viewport's descriptor, both functions are `null` and attributes remain in target CRS units. Otherwise, conversion goes through WGS84 and the target descriptor's normalization. `unpreproject` reverses the conversion. These functions are independent of camera state and exclude layer transforms; layers retain them in internal state.
Copy file name to clipboardExpand all lines: docs/api-reference/core/deck.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -259,6 +259,7 @@ Notes:
259
259
260
260
- `layerFilter` does not override the visibility if the layer is disabled via `visible:false` or `pickable:false` props.
261
261
- All the lifecycle methods other than `draw` are still triggered even a if a layer is filtered out using this method.
262
+
- To select a layer's initial viewport, accept it in `layerFilter` with `isPicking:false` and `renderPass:'screen'`. The first matching viewport supplies its initial projection context. The filter runs before initialization, so use layer props rather than initialized state. If none match, initialization uses the shared viewport context.
Copy file name to clipboardExpand all lines: docs/api-reference/core/layer.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -241,23 +241,27 @@ Normally only used when the application wants to work with coordinates that are
241
241
242
242
* Default: `'default'`
243
243
244
-
Specifies how layer positions and offsets should be geographically interpreted. One of:
244
+
Specifies the CRS of layer positions after `modelMatrix` and `coordinateOrigin` are applied. Built-in coordinate systems include:
245
245
246
246
-`'default'`
247
247
-`'cartesian'`
248
248
-`'lnglat'`
249
249
-`'meter-offsets'`
250
250
-`'lnglat-offsets'`
251
251
252
-
The default is to interpret positions as latitude and longitude, however it is also possible to interpret positions as meter offsets added to projection center specified by the `coordinateOrigin` prop.
252
+
`'lnglat'`, `'WGS84'`, `'EPSG:4326'`, and `'EPSG:4979'` identify WGS84 longitude/latitude/elevation. `'globe'` identifies geocentric meter coordinates on deck.gl's existing sphere; `'EPSG:4978'` identifies WGS84 ellipsoid geocentric coordinates. Other CRS identifiers and PROJ strings are resolved by `@math.gl/projection`. While resolution is pending, the layer waits before initialization or updates; failures are reported through the layer's error handler.
253
+
254
+
In [multi-view applications](../../developer-guide/views.md), the first viewport allowed by the layer filter determines the layer's CPU coordinate conversion. Use separate layer instances when views require different packed coordinate systems.
255
+
256
+
`'default'` uses WGS84 in geospatial views and Cartesian coordinates in non-geospatial views. Shader-supported source CRSs retain their attribute coordinates. Other source CRSs are converted on the CPU to WGS84, or to the target CRS of a custom projection.
253
257
254
258
See the article on [Coordinate Systems](../../developer-guide/coordinate-systems.md) for details.
Specifies a reference point for coordinates that are expressed as offsets. Used when the `coordinateSystem` is set to one of the following modes:
264
+
For an absolute CRS, this value is added in source CRS units after `modelMatrix`, before projection. For offset modes, it specifies the geographic reference point:
261
265
262
266
-`'cartesian'` (optional)
263
267
-`'meter-offsets'` (required)
@@ -856,7 +860,7 @@ Parameters:
856
860
-`modelMatrix` (Matrix4 | null) - defaults to `this.props.modelMatrix`. Pass `null` to skip the layer matrix.
857
861
-`coordinateOrigin` (number[3]) - defaults to `this.props.coordinateOrigin`.
858
862
-`coordinateSystem` (string) - defaults to `this.props.coordinateSystem`.
859
-
-`fromCoordinateOrigin` (number[3]) - defaults to passed `coordinateOrigin`.
863
+
-`fromCoordinateOrigin` (number[3]) - defaults to passed `coordinateOrigin` for the same source system, or `[0, 0, 0]` for a different system.
860
864
-`fromCoordinateSystem` (string) - defaults to passed `coordinateSystem`.
Copy file name to clipboardExpand all lines: docs/api-reference/core/project.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ The JavaScript uniforms are extracted from both contextual and per-layer props.
40
40
41
41
Uniforms are considered private to each shader module. They may change in between patch releases. Always use documented functions instead of accessing module uniforms directly.
42
42
43
-
The uniforms of the `project` shader module are prefixed with `project_` in their names.
43
+
The `project.coordinateFrame` uniform describes packed attributes as identity, geodetic, projected, or geocentric coordinates. It is distinct from a layer's `coordinateSystem` CRS string. Local meter and degree offsets select their own projection modes. Both numeric enum definitions are internal to the project shader module.
Copy file name to clipboardExpand all lines: docs/api-reference/core/view.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,10 @@ A relative (e.g. `'50%'`) or absolute extent. Accepts CSS-like expressions that
52
52
53
53
Padding around the viewport, in the shape of `{left, right, top, bottom}` where each value is either a relative (e.g. `'50%'`) or absolute pixels. These values support the same CSS-style expressions (numbers/percentages/`px` with parentheses and `calc()` addition/subtraction) as `x`, `y`, `width`, and `height`. This can be used to move the "look at"/target/vanishing point away from the center of the viewport rectangle.
Divide long straight lines in paths, polygons or meshes into smaller segments so that they closely follow the shape of the target CRS. Higher values produce finer geometry details but requires more processing and memory. Default `0` disables subdivision. See [geometry approximation](./viewport.md#geometry-approximation).
- Returns `{preproject, unpreproject, packedCrs}`. Both functions are `null` when the shader accepts the source CRS directly. Otherwise, `preproject` converts source coordinates to packed coordinates and `unpreproject` reverses that conversion. `packedCrs` describes the attribute coordinates. These functions do not apply the layer's model matrix or coordinate origin.
155
+
149
156
#### `getBounds` {#getbounds}
150
157
151
158
Extracts the axis-aligned bounding box of the current visible area.
@@ -200,6 +207,24 @@ if (outDir) {
200
207
* To support pixel project/unproject functions (in addition to the clipspace projection that Camera classes typically manage), the `Viewport` is also aware of the viewport extents.
201
208
* In geospatial setups, Viewports can contain geospatial anchors.
Left to right: same polygons in resolution 0, 10, 60, rendering 487, 501, 591 outline vertices respectively.
217
+
Notice the shape of the 49th-parallel.
218
+
<br/><i>Natural Earth 1:110 country boundaries of continental Canada and United States. Albers projection, central metidian -96°, standard parallels 29.5° / 45.5°</i>
219
+
</small>
220
+
221
+
222
+
When a geometry is displayed in a different CRS from its definition, long segments are still rendered as straight lines, instead of warping along the surface of the new CRS.
223
+
224
+
Use `resolution` to divide long straight lines into smaller segments to better follow the shape of the target CRS. Subdivision adds vertices before projection so paths, polygon edges and bitmap meshes can follow projected curves more closely. Higher values produce finer detail, with more processing and memory overhead. Subdivision is by default disabled.
225
+
226
+
The setting is relative to the earth's circumference and works across source CRSs with different units. For example, `resolution: 36` gives a 10-degree step for WGS84 geometry. When implementing a custom layer, use `context.viewport.getSubdivisionStep(sourceCrs)` to retrieve a step in the geometry's source CRS units.
Copy file name to clipboardExpand all lines: docs/api-reference/extensions/fill-style-extension.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -231,7 +231,7 @@ the pattern and the background color styles the area behind it.
231
231
The units of the pattern size, one of `'meters'`, `'common'` and `'pixels'`. See [unit system](../../developer-guide/coordinate-systems.md#supported-units). A 24 x 24 pixel pattern at [`getFillPatternScale: 1`](#getfillpatternscale) covers 24 units of the chosen unit. Procedural pattern stroke widths, gaps, and radii use the same units.
232
232
233
233
+`'meters'` anchors the pattern to the ground, so it zooms along with the rest of the map.
234
-
+`'common'` sizes the pattern in [common space](../../developer-guide/coordinate-systems.md) units, which is what a non-geospatial view (`COORDINATE_SYSTEM.CARTESIAN`) wants - meters are converted with a fixed Web Mercator ratio and are not meaningful there.
234
+
+`'common'` sizes the pattern in [common space](../../developer-guide/coordinate-systems.md) units, which is what a non-geospatial view (`'cartesian'`) wants - meters are converted with a fixed Web Mercator ratio and are not meaningful there.
235
235
+`'pixels'` keeps the pattern at a constant size on screen instead. The size is re-anchored at each integer zoom level rather than followed continuously, so that the tiling stays put while zooming within a level; the pattern therefore stays within a factor of `sqrt(2)` of its nominal pixel size.
0 commit comments