Class: WebMercatorTilingScheme

WebMercatorTilingScheme

new WebMercatorTilingScheme()

WMTS projection class reference WebMercatorProjection is a geometric tile scheme based on Web Mercator Projection (EPSG: 3857), which is adopted by Google Maps, Microsoft Bing Maps, and most ESRI ArcGIS Online. The Web Mercator projection is an improved version of the Mercator projection that uses the WGS 84 geographic coordinate system and converts it to the Mercator projection using spherical formulas (rather than ellipsoidal formulas)

Name Type Default Description
options.ellipsoid Ellipsoid Ellipsoid.WGS84 optional

The ellipsoidal surface being tiled. The default is an ellipsoid.

options.numberOfLevelZeroTilesX Number 1 optional

The number of tiles in the X direction on the 0th layer of the tile tree.

options.numberOfLevelZeroTilesY Number 1 optional

The number of tiles in the Y direction on the 0th layer of the tile tree.

options.rectangleSouthwestInMeters Cartesian2 optional

The southwest corner of the rectangle covered by the slicing scheme, measured in meters. If this parameter or rectangleNorthInMeters is not specified, it covers the entire Earth in the longitude direction and covers equal distances in the latitude direction, forming a square projection.

options.rectangleNortheastInMeters Cartesian2 optional

The northeast corner of the rectangle covered by the slicing scheme, measured in meters. If this parameter or rectangleSouthwestInMeters is not specified, it covers the entire Earth in the longitude direction and covers equal distances in the latitude direction, forming a square projection.

options.customDPI Cartesian2 optional

The DPI used in this tile partitioning scheme.

options.scaleDenominators Array optional

The reciprocal of the scale corresponding to each level in the tile partitioning scheme.

options.origin Cartesian2 optional

The origin position of the tile partition scheme.

options.tileWidth Number 256 optional

The width of each tile.

options.tileHeight Number 256 optional

The height of each tile.

Members

ellipsoidEllipsoid

Gets the ellipsoid on which this tiling scheme is based.

originCartesian2

Gets the origin of the tile (for WMTS), compatible with the issue in newer iServer versions where the top-left corner of the image extent does not match the tile origin.

projectionMapProjection

Gets the map projection used by this tiling scheme.

rectangleRectangle

Gets the rectangular area covered by this tiling scheme (in radians).

Methods

getNumberOfXTilesAtLevel(level){Number}

Obtain the total number of tiles in the X direction according to the specified level of refinement.

Name Type Description
level Number

Level of detail.

Returns:
Type Description
Number The number of tiles in the X direction at a given level.

getNumberOfYTilesAtLevel(level){Number}

Obtain the total number of tiles in the Y direction according to the specified level of refinement.

Name Type Description
level Number

Level of detail.

Returns:
Type Description
Number The number of tiles in the X direction at a given level.

positionToTileXY(position, level, result){Cartesian2}

Calculate the x and y coordinates of tiles containing the given map projection position.

Name Type Description
position Cartographic

Location.

level Number

The level of tiles. 0 is the least refined.

result Cartesian2 optional

The instance to copy the result to, or undefined to create a new instance.

Returns:
Type Description
Cartesian2 The specified 'result', if undefined, is a new object containing the tile's x and y coordinates.

rectangleToNativeRectangle(rectangle, result){Rectangle}

Convert the rectangle specified in radians of the earth to the local coordinate system of the tile scheme.

Name Type Description
rectangle Rectangle

The rectangle to convert.

result Rectangle optional

The instance to copy the result to, or undefined to create a new instance.

Returns:
Type Description
Rectangle The specified 'result', if undefined, is a new object containing a local rectangle.

tileXYToNativeRectangle(x, y, level, result){Rectangle}

Convert the x, y coordinates and levels of the tiles into rectangles represented by the local coordinates of the tile scheme.

Name Type Description
x Number

The x-coordinate integer of the tile.

y Number

The y-coordinate integer of the tile.

level Number

The level of tiles. 0 is the least refined.

result Object optional

The instance to copy the result to, or undefined to create a new instance.

Returns:
Type Description
Rectangle The specified 'result', if undefined, is a new object containing a rectangle.

tileXYToRectangle(x, y, level, result){Rectangle}

Convert the x, y coordinates, and levels of tiles into a map projection rectangle in radians.

Name Type Description
x Number

The x-coordinate integer of the tile.

y Number

The y-coordinate integer of the tile.

level Number

The level of tiles. 0 is the least refined.

result Object optional

The instance to copy the result to, or undefined to create a new instance.

Returns:
Type Description
Rectangle The specified 'result', if undefined, is a new object containing a rectangle.