Class: S2GeometryProvider
api.S2GeometryProvider
classdesc
Geometry provider based on S2 cells.
example
class MyDataProvider extends DataProviderBase { ...}
const geometryProvider = new S2GeometryProvider();const dataProvider = new MyDataProvider(geometryProvider);
#
Hierarchy↳
S2GeometryProvider
#
Constructors#
constructor• new S2GeometryProvider(_level?
)
Create a new S2 geometry provider instance.
#
ParametersName | Type | Default value |
---|---|---|
_level | number | 17 |
#
OverridesGeometryProviderBase.constructor
#
Defined in#
Methods#
bboxToCellIdsâ–¸ bboxToCellIds(sw
, ne
): string
[]
Convert a geodetic bounding box to the the minimum set of cell ids containing the bounding box.
#
ParametersName | Type | Description |
---|---|---|
sw | LngLat | South west corner of bounding box. |
ne | LngLat | North east corner of bounding box. |
#
Returnsstring
[]
Array of cell ids.
#
OverridesGeometryProviderBase.bboxToCellIds
#
Defined in#
getAdjacentâ–¸ getAdjacent(cellId
): string
[]
Get the cell ids of all adjacent cells.
#
ParametersName | Type | Description |
---|---|---|
cellId | string | Id of cell. |
#
Returnsstring
[]
Array of cell ids. No specific order is guaranteed.
#
OverridesGeometryProviderBase.getAdjacent
#
Defined in#
getVerticesâ–¸ getVertices(cellId
): LngLat
[]
Get the vertices of a cell.
#
ParametersName | Type | Description |
---|---|---|
cellId | string | Id of cell. |
#
ReturnsLngLat
[]
Unclosed clockwise polygon.
#
OverridesGeometryProviderBase.getVertices
#
Defined in#
lngLatToCellIdâ–¸ lngLatToCellId(lngLat
): string
Convert geodetic coordinates to a cell id.
#
ParametersName | Type | Description |
---|---|---|
lngLat | LngLat | Longitude, latitude to convert. |
#
Returnsstring
Cell id for the longitude, latitude.
#
OverridesGeometryProviderBase.lngLatToCellId