Skip to content

Class: TileID

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new TileID(overscaledZ, wrap?, z, x, y, options?): TileID

Parameters

NameTypeDefault valueDescription
overscaledZnumberundefined扩大的 z 值
wrapnumber0所处世界
znumberundefined层级
xnumberundefined
ynumberundefined
optionsTileIDOptionsundefined瓦片其他配置

Returns

TileID

Defined in

gl-core/src/tile/TileID.ts:76

Properties

x

x: number

瓦片列

Defined in

gl-core/src/tile/TileID.ts:13


wrapedX

wrapedX: number

跨世界后的瓦片列

Defined in

gl-core/src/tile/TileID.ts:18


y

y: number

瓦片行

Defined in

gl-core/src/tile/TileID.ts:22


wrapedY

wrapedY: number

跨世界后的瓦片行(目前仅 maptalks 支持)

Defined in

gl-core/src/tile/TileID.ts:27


z

z: number

瓦片层级

Defined in

gl-core/src/tile/TileID.ts:32


wrap

wrap: number

所在世界(如果是多世界的话)

Defined in

gl-core/src/tile/TileID.ts:36


overscaledZ

overscaledZ: number

放大后的 zoom 值

Defined in

gl-core/src/tile/TileID.ts:41


tileKey

tileKey: string

瓦片唯一标识

Defined in

gl-core/src/tile/TileID.ts:45


unWrappedTileKey

unWrappedTileKey: string

不包含跨世界的瓦片标识(因为多个世界的瓦片如果仅仅是 wrap 不同,他们对应的数据资源是完全相同的)

Defined in

gl-core/src/tile/TileID.ts:49


tileBounds

tileBounds: Bounds

瓦片范围(每次获取时计算)

Defined in

gl-core/src/tile/TileID.ts:54


projTileBounds

projTileBounds: ProjTileBounds

投影后的瓦片范围

Defined in

gl-core/src/tile/TileID.ts:59


options

options: TileIDOptions

Defined in

gl-core/src/tile/TileID.ts:61


dep

dep: any

挂载的其他数据

Defined in

gl-core/src/tile/TileID.ts:66

Methods

getTileBounds

getTileBounds(tileID?): Bounds

获取瓦片范围

Parameters

NameType
tileIDTileID

Returns

Bounds

Defined in

gl-core/src/tile/TileID.ts:104


getTileProjBounds

getTileProjBounds(tileID?, force?): ProjTileBounds

获取瓦片投影后的范围

Parameters

NameType
tileIDTileID
force?boolean

Returns

ProjTileBounds

Defined in

gl-core/src/tile/TileID.ts:116


overscaleFactor

overscaleFactor(): number

Returns

number

Defined in

gl-core/src/tile/TileID.ts:124


scaledTo

scaledTo(targetZ): TileID

缩放到目标层级

Parameters

NameType
targetZnumber

Returns

TileID

Defined in

gl-core/src/tile/TileID.ts:132


parent

parent(): TileID

获取父级瓦片

Returns

TileID

Defined in

gl-core/src/tile/TileID.ts:144


children

children(sourceMaxZoom): TileID[]

查找当前瓦片的子瓦片

Parameters

NameType
sourceMaxZoomnumber

Returns

TileID[]

Defined in

gl-core/src/tile/TileID.ts:153


siblings

siblings(): TileID[]

查找兄弟瓦片

Returns

TileID[]

Defined in

gl-core/src/tile/TileID.ts:173


neighbor

neighbor(hor, ver?): TileID

查找相临瓦片

Parameters

NameTypeDefault valueDescription
hornumberundefined横向偏移
vernumber0纵向偏移

Returns

TileID

Defined in

gl-core/src/tile/TileID.ts:186


isEqual

isEqual(tile): boolean

判断瓦片是否相同 一般我们认为只要 xyz 和所处世界 wrap 相同就确认相同(即 tileKey 相同)

Parameters

NameType
tileTileID

Returns

boolean

Defined in

gl-core/src/tile/TileID.ts:211


isRoot

isRoot(): boolean

判断是否是根节点

Returns

boolean

Defined in

gl-core/src/tile/TileID.ts:219

Released under the MIT License.