@xylabs/geo
v5.0.80
Published
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Readme
@xylabs/geo
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Reference
@xylabs/geo
Classes
Type Aliases
Variables
Functions
- boundingBoxToBoundary
- boundingBoxToCenter
- boundingBoxToPolygon
- tileFromPoint
- tileFromQuadkey
- tileToBoundingBox
- tileToChildren
- tileToGeoJson
- tileToParent
- tileToPoint
- tileToQuadkey
- tileToSiblings
- tilesEqual
- tilesFromBoundingBox
- hasSiblings
- tilesHasTile
classes
GeoJson
Constructors
Constructor
new GeoJson(quadkey): GeoJson;Parameters
quadkey
string
Returns
GeoJson
Methods
featureCollection()
static featureCollection(features): FeatureCollection;Parameters
features
Feature<Geometry, GeoJsonProperties>[]
Returns
FeatureCollection
featuresSource()
static featuresSource(data): GeoJSONSourceSpecification;Parameters
data
FeatureCollection
Returns
GeoJSONSourceSpecification
geometryFeature()
static geometryFeature(geometry): Feature;Parameters
geometry
Geometry
Returns
Feature
center()
center(): LngLat;Returns
LngLat
point()
point(): Point;Returns
Point
pointFeature()
pointFeature(): Feature;Returns
Feature
pointFeatureCollection()
pointFeatureCollection(): FeatureCollection;Returns
FeatureCollection
pointSource()
pointSource(): GeoJSONSourceSpecification;Returns
GeoJSONSourceSpecification
polygon()
polygon(): Polygon;Returns
Polygon
polygonFeature()
polygonFeature(): Feature;Returns
Feature
polygonFeatureCollection()
polygonFeatureCollection(): FeatureCollection;Returns
FeatureCollection
polygonSource()
polygonSource(): GeoJSONSourceSpecification;Returns
GeoJSONSourceSpecification
zoom()
zoom(): number;Returns
number
LayerBase
Type Parameters
T
T extends MapBox.Layer
Constructors
Constructor
new LayerBase<T>(id, source): LayerBase<T>;Parameters
id
string
source
string
Returns
LayerBase<T>
Properties
id
id: string;source
source: string;Methods
update()
update(map, show): void;Parameters
map
Map$1
show
boolean = true
Returns
void
buildLayer()
abstract buildLayer(): T;Returns
T
MercatorBoundingBox
Extends
LngLatBounds
Constructors
Constructor
new MercatorBoundingBox(sw?, ne?): MercatorBoundingBox;Parameters
sw?
[number, number, number, number] | LngLatLike | [LngLatLike, LngLatLike]
ne?
LngLatLike
Returns
MercatorBoundingBox
Inherited from
MapBox.LngLatBounds.constructorMercatorLngLat
Extends
LngLat
Constructors
Constructor
new MercatorLngLat(lng, lat): MercatorLngLat;Parameters
lng
number
lat
number
Returns
MercatorLngLat
Inherited from
MapBox.LngLat.constructorfunctions
boundingBoxToBoundary
function boundingBoxToBoundary(box): MercatorBoundary;Parameters
box
Returns
boundingBoxToCenter
function boundingBoxToCenter(boundingBox, decimal): number[];Parameters
boundingBox
decimal
number = 6
Returns
number[]
boundingBoxToPolygon
function boundingBoxToPolygon(box): Polygon;Parameters
box
Returns
Polygon
hasSiblings
function hasSiblings(tiles, tile): boolean;Parameters
tiles
tile
Returns
boolean
tileFromPoint
function tileFromPoint(point, z): number[];Parameters
point
z
number
Returns
number[]
tileFromQuadkey
function tileFromQuadkey(quadkey): number[];Parameters
quadkey
string
Returns
number[]
tileToBoundingBox
function tileToBoundingBox(tile): MercatorBoundingBox;Parameters
tile
Returns
tileToChildren
function tileToChildren(tile): number[][];Parameters
tile
Returns
number[][]
tileToGeoJson
function tileToGeoJson(tile): Polygon;Parameters
tile
Returns
Polygon
tileToParent
function tileToParent(tile): MercatorTile;Parameters
tile
Returns
tileToPoint
function tileToPoint(tile): MercatorLngLat;Parameters
tile
Returns
tileToQuadkey
function tileToQuadkey(tile): string;Parameters
tile
Returns
string
tileToSiblings
function tileToSiblings(tile): MercatorTile[];Parameters
tile
Returns
tilesEqual
function tilesEqual(tile1, tile2): boolean;Parameters
tile1
tile2
Returns
boolean
tilesFromBoundingBox
function tilesFromBoundingBox(box, zoom): MercatorTile[];Parameters
box
zoom
number
Returns
tilesHasTile
function tilesHasTile(tiles, tile): boolean;Parameters
tiles
tile
Returns
boolean
type-aliases
MercatorBoundary
type MercatorBoundary = MercatorLngLat[];MercatorTile
type MercatorTile = number[];variables
d2r
const d2r: number;r2d
const r2d: number;Part of sdk-js
Maintainers
License
See the LICENSE file for license details
