import type { LayerView2DMap, LayerView2DFor, MeshVertex, TessellatedMesh, ResizeAlign } from "@arcgis/core/views/2d/types.js";Type definitions
LayerView2DMap
- Since
- ArcGIS Maps SDK for JavaScript 5.0
LayerView2DFor
- Type parameters
- <TLayer extends Layer>
- Since
- ArcGIS Maps SDK for JavaScript 5.0
- Type
- LayerView2DMap[TLayer["type"]]
MeshVertex
- Since
- ArcGIS Maps SDK for JavaScript 5.0
A vertex of a tessellated mesh.
There are five different tessellation algorithms, one for each supported geometry type. The attributes in a vertex can be used to populate vertex and index buffers that can be rendered using appropriate shaders. See the SDK sample for a possible way of doing this using a single universal shader program that can render any of the supported geometry types.
There are four attributes; the first three are 2D points, and the last one is a scalar value. In total a mesh vertex contains 7 numeric values.
Geographic position (x, y) The geographic point associated to that vertex. For Extent and Polygon is equivalent to the position of the vertex itself; for Point and Multipoint is the geographic position of the point, and the anchor that will be associated to the corresponding marker symbol; for Polyline it lies on the centerline. The geographic position is usually expressed in map units and a custom vertex shader will generally need to transform it to normalized device coordinates.
Offset vector (xOffset, yOffset) This is an offset that is generally expressed in units other than the view's ones, and drives the extrusion of the geographic position into lines and quads. For Extent and Polygon is zero; for Point and Multipoint it goes from the anchor to the four vertices of the quad on screen; for Polyline it goes from the centerline to a vertex on the polyline's edge. The offset vector is usually expressed in some other units than map and will not need to be transformed by the same transform used for the geographic position. A common convention is to express the offset in points or pixels and code the vertex shader accordingly.

Texture coordinates (uTexcoord, vTexcoord) The texture coordinates associated to this vertex. For Extent the lower left vertex has coordinates (0, 0) and the upper right (1, 1); for Polygon the coordinates at each vertex match the interpolated coordinates that the smallest enclosing extent for that polygon would have at the same fragment; for Point and Multipoint each quad has (0, 0) as the lower left texture coordinate and (1, 1) as the upper right one; for Polyline the start cap is made of two vertices with texture coordinates (0, 0) and (0, 1) while the end cap is associated to (1, 0) and (1, 1).

Distance Valid only for Polyline; it is the distance, in map units, from the beginning of the polyline to this vertex.

xOffset
- Type
- number
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The x-offset in screen space; this is used to extrude points (into quads), markers and polylines, and is 0 for polygons.
yOffset
- Type
- number
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The y-offset in screen space; this is used to extrude points (into quads), markers and polylines, and is 0 for polygons.
uTexcoord
- Type
- number
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The u-coordinate for texture mapping. It varies between 0 and 1 horizontally for quads and polygons, and along the entire length of a polyline.
vTexcoord
- Type
- number
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The v-coordinate for texture mapping. It varies between 0 and 1 vertically for quads and polygons, and across the width of a polyline.
distance
- Type
- number
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The distance parameter for this vertex; this only applies when tessellating polylines. It starts from 0 and runs up to the total length of the polyline. It is expressed in map units.
TessellatedMesh
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The triangle mesh resulting from a tessellation operation.
An instance of Mesh can be obtained by calling one of the BaseLayerViewGL2D
tessellate* methods and passing an instance of Geometry.
vertices
- Type
- MeshVertex[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The vertices that make up the mesh. Each element is a MeshVertex.
indices
- Type
- number[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The indices of the triangles that connect vertices together; each consecutive triplet of indices denotes a triangle.
ResizeAlign
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Defines which anchor stays still while resizing the browser window. The default, center, ensures the view's center point remains constantly visible as the window size changes. The other options allow the respective portion of the view to remain visible when the window's size is changed.
- Type
- "bottom" | "bottom-left" | "bottom-right" | "center" | "left" | "right" | "top" | "top-left" | "top-right"