# WebMercatorTilingScheme

#### new Cesium.WebMercatorTilingScheme(options)
engine/Source/Core/WebMercatorTilingScheme.js 31

A tiling scheme for geometry referenced to a `WebMercatorProjection`, EPSG:3857. This is the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online.

Name | Type | Description
--- | --- | ---
`options` | object | optional Object with the following properties:
Name | Type | Default | Description
--- | --- | --- | ---
`ellipsoid` | Ellipsoid | `Ellipsoid.WGS84` | optional The ellipsoid whose surface is being tiled. Defaults to the WGS84 ellipsoid.
`numberOfLevelZeroTilesX` | number | `1` | optional The number of tiles in the X direction at level zero of the tile tree.
`numberOfLevelZeroTilesY` | number | `1` | optional The number of tiles in the Y direction at level zero of the tile tree.
`rectangleSouthwestInMeters` | Cartesian2 |  | optional The southwest corner of the rectangle covered by the tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire globe is covered in the longitude direction and an equal distance is covered in the latitude direction, resulting in a square projection.
`rectangleNortheastInMeters` | Cartesian2 |  | optional The northeast corner of the rectangle covered by the tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire globe is covered in the longitude direction and an equal distance is covered in the latitude direction, resulting in a square projection.

### Members

#### ellipsoid : Ellipsoid
engine/Source/Core/WebMercatorTilingScheme.js 84

Gets the ellipsoid that is tiled by this tiling scheme.

#### projection : MapProjection
engine/Source/Core/WebMercatorTilingScheme.js 106

Gets the map projection used by this tiling scheme.

#### rectangle : Rectangle
engine/Source/Core/WebMercatorTilingScheme.js 95

Gets the rectangle, in radians, covered by this tiling scheme.

### Methods

#### getNumberOfXTilesAtLevel(level) → number
engine/Source/Core/WebMercatorTilingScheme.js 119

Gets the total number of tiles in the X direction at a specified level-of-detail.

Name | Type | Description
--- | --- | ---
`level` | number | The level-of-detail.

##### Returns:

The number of tiles in the X direction at the given level.

#### getNumberOfYTilesAtLevel(level) → number
engine/Source/Core/WebMercatorTilingScheme.js 129

Gets the total number of tiles in the Y direction at a specified level-of-detail.

Name | Type | Description
--- | --- | ---
`level` | number | The level-of-detail.

##### Returns:

The number of tiles in the Y direction at the given level.

#### positionToTileXY(position, level, result) → Cartesian2
engine/Source/Core/WebMercatorTilingScheme.js 251

Calculates the tile x, y coordinates of the tile containing a given cartographic position.

Name | Type | Description
--- | --- | ---
`position` | Cartographic | The position.
`level` | number | The tile level-of-detail. Zero is the least detailed.
`result` | Cartesian2 | optional The instance to which to copy the result, or undefined if a new instance should be created.

##### Returns:

The specified 'result', or a new object containing the tile x, y coordinates if 'result' is undefined.

#### rectangleToNativeRectangle(rectangle, result) → Rectangle
engine/Source/Core/WebMercatorTilingScheme.js 143

Transforms a rectangle specified in geodetic radians to the native coordinate system of this tiling scheme.

Name | Type | Description
--- | --- | ---
`rectangle` | Rectangle | The rectangle to transform.
`result` | Rectangle | optional The instance to which to copy the result, or undefined if a new instance should be created.

##### Returns:

The specified 'result', or a new object containing the native rectangle if 'result' is undefined.

#### tileXYToNativeRectangle(x, y, level, result) → Rectangle
engine/Source/Core/WebMercatorTilingScheme.js 174

Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates of the tiling scheme.

Name | Type | Description
--- | --- | ---
`x` | number | The integer x coordinate of the tile.
`y` | number | The integer y coordinate of the tile.
`level` | number | The tile level-of-detail. Zero is the least detailed.
`result` | object | optional The instance to which to copy the result, or undefined if a new instance should be created.

##### Returns:

The specified 'result', or a new object containing the rectangle if 'result' is undefined.

#### tileXYToRectangle(x, y, level, result) → Rectangle
engine/Source/Core/WebMercatorTilingScheme.js 217

Converts tile x, y coordinates and level to a cartographic rectangle in radians.

Name | Type | Description
--- | --- | ---
`x` | number | The integer x coordinate of the tile.
`y` | number | The integer y coordinate of the tile.
`level` | number | The tile level-of-detail. Zero is the least detailed.
`result` | object | optional The instance to which to copy the result, or undefined if a new instance should be created.

##### Returns:

The specified 'result', or a new object containing the rectangle if 'result' is undefined.

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.