Class OverscaledTileID
Constructors
constructor
- new OverscaledTileID(
overscaledZ: number,
wrap: number,
z: number,
x: number,
y: number,
): OverscaledTileIDParameters
- overscaledZ: number
- wrap: number
- z: number
- x: number
- y: number
Returns OverscaledTileID
Properties
canonical
key
overscaledZ
terrainRttPosMatrix32f
This matrix is used during terrain's render-to-texture stage only. If the render-to-texture stage is active, this matrix will be present and should be used, otherwise this matrix will be null. The matrix should be float32 in order to avoid slow WebGL calls in Chrome.
wrap
Methods
calculateScaledKey
Parameters
- targetZ: number
- withWrap: boolean
Returns string
children
Parameters
- sourceMaxZoom: number
Returns OverscaledTileID[]
clone
Returns OverscaledTileID
equals
Parameters
- id: OverscaledTileID
Returns boolean
getTilePoint
Parameters
- coord: MercatorCoordinate
Returns Point
isChildOf
Parameters
- parent: OverscaledTileID
Returns boolean
isLessThan
Parameters
- rhs: OverscaledTileID
Returns boolean
isOverscaled
Returns boolean
normalizeCoordinates
- normalizeCoordinates(
x: number,
y: number,
extent?: number,
): { tileID: OverscaledTileID; x: number; y: number } | nullMaps tile-local coordinates that may fall outside the
[0, extent)range to the correct neighbor tile and the corresponding in-tile position.Coordinates can exceed tile bounds when geometry (e.g. symbol labels along lines) extends across tile edges. This method resolves such coordinates to the appropriate adjacent tile, wrapping horizontally across world boundaries and returning
nullwhen the target falls beyond the polar tile-grid limits.When the coordinates are already in bounds, the original tile ID is returned.
Parameters
- x: number
x coordinate relative to this tile, may be outside
[0, extent) - y: number
y coordinate relative to this tile, may be outside
[0, extent) Optionalextent: numbertile coordinate extent, default EXTENT
Returns { tileID: OverscaledTileID; x: number; y: number } | null
the resolved tile ID and in-tile coordinates, or
nullif the target is beyond the tile grid (e.g. past the poles) - x: number
overscaleFactor
Returns number
scaledTo
Returns a new
OverscaledTileIDrepresenting the tile at the target zoom level. When targetZ is greater than the current canonical z, the canonical coordinates are unchanged. When targetZ is less than the current canonical z, the canonical coordinates are updated.Parameters
- targetZ: number
the zoom level to scale to. Must be less than or equal to this.overscaledZ
Returns OverscaledTileID
a new OverscaledTileID representing the tile at the target zoom level
- targetZ: number
toString
Returns string
toUnwrapped
Returns UnwrappedTileID
unwrapTo
Parameters
- wrap: number
Returns OverscaledTileID
wrapped
Returns OverscaledTileID
An overscaled tile identifier