1 | import Target from './events/Target';
|
2 | import Projection from './proj/Projection';
|
3 | import { TileCoord } from './tilecoord';
|
4 | import TileState from './TileState';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export type LoadFunction = (p0: Tile, p1: string) => void;
|
34 | export interface Options {
|
35 | transition?: number | undefined;
|
36 | }
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | export type UrlFunction = (p0: TileCoord, p1: number, p2: Projection) => string | undefined;
|
47 | export default abstract class Tile extends Target {
|
48 | constructor(tileCoord: TileCoord, state: TileState, opt_options?: Options);
|
49 | protected state: TileState;
|
50 | protected changed(): void;
|
51 | /**
|
52 | * Mark a transition as complete.
|
53 | */
|
54 | endTransition(id: string): void;
|
55 | /**
|
56 | * Get the alpha value for rendering.
|
57 | */
|
58 | getAlpha(id: string, time: number): number;
|
59 | /**
|
60 | * Get the interim tile most suitable for rendering using the chain of interim
|
61 | * tiles. This corresponds to the most recent tile that has been loaded, if no
|
62 | * such tile exists, the original tile is returned.
|
63 | */
|
64 | getInterimTile(): Tile;
|
65 | getKey(): string;
|
66 | getState(): TileState;
|
67 | /**
|
68 | * Get the tile coordinate for this tile.
|
69 | */
|
70 | getTileCoord(): TileCoord;
|
71 | /**
|
72 | * Determine if a tile is in an alpha transition. A tile is considered in
|
73 | * transition if tile.getAlpha() has not yet been called or has been called
|
74 | * and returned 1.
|
75 | */
|
76 | inTransition(id: string): boolean;
|
77 | /**
|
78 | * Load the image or retry if loading previously failed.
|
79 | * Loading is taken care of by the tile queue, and calling this method is
|
80 | * only needed for preloading or for reloading in case of an error.
|
81 | */
|
82 | abstract load(): void;
|
83 | /**
|
84 | * Goes through the chain of interim tiles and discards sections of the chain
|
85 | * that are no longer relevant.
|
86 | */
|
87 | refreshInterimChain(): void;
|
88 | /**
|
89 | * Called by the tile cache when the tile is removed from the cache due to expiry
|
90 | */
|
91 | release(): void;
|
92 | /**
|
93 | * Sets the state of this tile. If you write your own {@link module:ol/Tile~LoadFunction tileLoadFunction} ,
|
94 | * it is important to set the state correctly to {@link module:ol/TileState~ERROR}
|
95 | * when the tile cannot be loaded. Otherwise the tile cannot be removed from
|
96 | * the tile queue and will block other requests.
|
97 | */
|
98 | setState(state: TileState): void;
|
99 | }
|