Skip to content

Class: TileSource

Hierarchy

  • EventEmitter

    TileSource

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new TileSource(id, options): TileSource

Parameters

NameType
idany
optionsTileSourceOptions

Returns

TileSource

Overrides

EventEmitter.constructor

Defined in

gl-core/src/source/tile.ts:92

Properties

id

id: string

数据源 id

Defined in

gl-core/src/source/tile.ts:34


type

type: tile

数据源类型

Defined in

gl-core/src/source/tile.ts:39


minZoom

minZoom: number

支持的最小层级

Defined in

gl-core/src/source/tile.ts:44


maxZoom

maxZoom: number

支持的最大层级

Defined in

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


roundZoom

roundZoom: boolean = false

生成瓦片时的配置

Defined in

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


scheme

scheme: "xyz" | "tms"

瓦片规范

Defined in

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


url

url: string | string[]

Defined in

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


tileSize

tileSize: number

瓦片大小

Defined in

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


tileBounds

tileBounds: undefined | Bounds

Defined in

gl-core/src/source/tile.ts:68


options

options: TileSourceOptions

配置项

Defined in

gl-core/src/source/tile.ts:73


renderer

renderer: Renderer

Defined in

gl-core/src/source/tile.ts:75


dispatcher

dispatcher: any

Defined in

gl-core/src/source/tile.ts:77


layer

layer: WithNull<BaseLayer>

Defined in

gl-core/src/source/tile.ts:79


wrapX

wrapX: boolean

是否跨世界渲染

Defined in

gl-core/src/source/tile.ts:84


parseOptions

parseOptions: ParseOptionsType

Defined in

gl-core/src/source/tile.ts:86

Accessors

sourceCache

get sourceCache(): default

Returns

default

Defined in

gl-core/src/source/tile.ts:118

Methods

onAdd

onAdd(layer, cb?): void

Parameters

NameType
layerany
cb?any

Returns

void

Defined in

gl-core/src/source/tile.ts:122


update

update(data, clear?): this

Parameters

NameTypeDefault value
dataTileSourceIntervalundefined
clearbooleantrue

Returns

this

Defined in

gl-core/src/source/tile.ts:127


prepare

prepare(renderer, dispatcher, parseOptions): void

Parameters

NameType
rendererRenderer
dispatcherany
parseOptionsany

Returns

void

Defined in

gl-core/src/source/tile.ts:134


load

load(cb?): void

兼容 TileJSON 加载,需要具体实现

Parameters

NameType
cb?any

Returns

void

Defined in

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


loaded

loaded(): boolean

Returns

boolean

Defined in

gl-core/src/source/tile.ts:152


reload

reload(clear): void

Parameters

NameType
clearboolean

Returns

void

Defined in

gl-core/src/source/tile.ts:156


hasTile

hasTile(coord): boolean

Parameters

NameType
coordTileID

Returns

boolean

Defined in

gl-core/src/source/tile.ts:168


getFadeTime

getFadeTime(): number

Returns

number

Defined in

gl-core/src/source/tile.ts:172


getUrl

getUrl(x, y, z): string | string[]

Parameters

NameType
xnumber
ynumber
znumber

Returns

string | string[]

Defined in

gl-core/src/source/tile.ts:176


asyncActor

asyncActor(tile, url): Promise<unknown>

Parameters

NameType
tileTile
urlstring

Returns

Promise<unknown>

Defined in

gl-core/src/source/tile.ts:207


getTileUrl

getTileUrl(tileID): string[]

Parameters

NameType
tileIDTileID

Returns

string[]

Defined in

gl-core/src/source/tile.ts:229


loadTile

loadTile(tile, callback): any

Parameters

NameType
tileTile
callbackany

Returns

any

Defined in

gl-core/src/source/tile.ts:244


abortTile

abortTile(tile, callback): void

Parameters

NameType
tileTile
callbackany

Returns

void

Defined in

gl-core/src/source/tile.ts:290


unloadTile

unloadTile(tile, callback): void

Parameters

NameType
tileTile
callbackany

Returns

void

Defined in

gl-core/src/source/tile.ts:319


destroy

destroy(): void

Returns

void

Defined in

gl-core/src/source/tile.ts:325

Released under the MIT License.