MapTilingScheme Class

A scheme for converting between two representations of the surface of the Earth: an ellipsoid and a rectangular tiled map. Positions on the surface of the ellipsoid are expressed in Cartographic coordinates. Rectangular MapTiles are projected onto this ellipsoid by the tiling scheme. Tile coordinates are represented by QuadIds.

The tiling scheme represents the (x,y) coordinates of its tiles as fractions in [0,1] along the X and Y axes. An X fraction of 0 corresponds to the easternmost longitude and an X fraction of 1 to the westernmost longitude. The scheme can choose to correlate a Y fraction of 0 with either the north or south pole, as specified by rowZeroAtNorthPole. Implementing a tiling scheme only requires implementing the abstract method yFractionToLatitude and its inverse, latitudeToYFraction.

Extended by

Methods

Name Description
constructor(numberOfLevelZeroTilesX: number, numberOfLevelZeroTilesY: number, rowZeroAtNorthPole: boolean): MapTilingScheme Protected    
cartographicToFraction(latitudeRadians: number, longitudeRadians: number, result: Point2d): Point2d Given a cartographic location on the surface of the Earth, convert it to fractional coordinates in the XY plane.  
cartographicToTileXY(carto: Cartographic, level: number, result?: Point2d): Point2d Given a cartographic position, compute the corresponding position on the surface of the Earth as fractional distances along the  
fractionToCartographic(xFraction: number, yFraction: number, result: Cartographic, height: number0): Cartographic Given fractional coordinates in the XY plane and an elevation, compute the corresponding cartographic position.  
getNumberOfXTilesAtLevel(level: number): number The total number of tiles in the X direction at the specified level of detail.  
getNumberOfYTilesAtLevel(level: number): number The total number of tiles in the Y direction at the specified level of detail.  
latitudeToYFraction(latitude: number): number Abstract Convert a latitude in [-pi/2, pi/2] radians into a fraction in [0, 1] along the Y axis.  
longitudeToXFraction(longitude: number): number Convert a longitude in [-pi, pi] radisn to a fraction in [0, 1] along the X axis.  
tileBordersNorthPole(row: number, level: number): boolean Returns true if the tile at the specified X coordinate and level is adjacent to the north pole.  
tileBordersSouthPole(row: number, level: number): boolean Returns true if the tile at the specified X coordinate and level is adjacent to the south pole.  
tileXToFraction(x: number, level: number): number Given the X component and level of a QuadId, convert it to a fractional distance along the X axis.  
tileXToLongitude(x: number, level: number): number Given the X component and level of a QuadId, compute its longitude in [-pi, pi] radians.  
tileXYToCartographic(x: number, y: number, level: number, result: Cartographic, height: number0): Cartographic Given the components of a QuadId and an elevation, compute the corresponding Cartographic position.  
tileXYToFraction(x: number, y: number, level: number, result?: Point2d): Point2d Given the components of a QuadId, compute its fractional coordinates in the XY plane.  
tileXYToRectangle(x: number, y: number, level: number, result?: MapCartoRectangle): MapCartoRectangle Given the components of a QuadId, compute the corresponding region of the Earth's surface.  
tileYToFraction(y: number, level: number): number Given the Y component and level of a QuadId, convert it to a fractional distance along the Y axis.  
tileYToLatitude(y: number, level: number): number Given the Y component and level of a QuadId, compute its latitude in [-pi/2, pi/2] radians.  
xFractionToLongitude(xFraction: number): number Convert a fraction in [0, 1] along the X axis into a longitude in [-pi, pi] radians.  
xFractionToTileX(xFraction: number, level: number): number Given a fractional distance along the X axis and a level of the quad tree, compute the X component of the corresponding QuadId.  
yFractionToLatitude(yFraction: number): number Abstract Convert a fraction in [0, 1] along the Y axis into a latitude in [-pi/2, pi/2] radians.  
yFractionToTileY(yFraction: number, level: number): number Given a fractional distance along the Y axis and a level of the quad tree, compute the Y component of the corresponding QuadId.  

Properties

Name Type Description
numberOfLevelZeroTilesX Readonly number The number of tiles in the X direction at level 0 of the quad tree.  
numberOfLevelZeroTilesY Readonly number The number of tiles in the Y direction at level 0 of the quad tree.  
rowZeroAtNorthPole Readonly boolean If true, the fractional Y coordinate 0 corresponds to the north pole and 1 to the south pole; otherwise,  

Defined in

Last Updated: 17 December, 2024