Constructor
new Layer(source, geometry, view, textureStore, opts)
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
source |
Source | |||||||
geometry |
Geometry | |||||||
view |
View | |||||||
textureStore |
TextureStore | |||||||
opts |
Object |
Properties
|
Methods
destroy()
Destructor.
effects() → {Effects}
Returns the currently set effects.
Returns:
- Type
- Effects
fixedLevel() → {number|null}
Returns the fixed level index.
Returns:
- Type
- number | null
geometry() → {Geometry}
Returns the underlying geometry.
Returns:
- Type
- Geometry
mergeEffects(effects)
Merges effects into the currently set ones. The merge is non-recursive; for
instance, if current effects are { rect: { relativeWidth: 0.5 } }
,
calling this method with { rect: { relativeX: 0.5 }}
will reset
rect.relativeWidth
.
Parameters:
Name | Type | Description |
---|---|---|
effects |
Effects |
pinFirstLevel()
Pin the first level. Equivalent to pinLevel(0)
.
pinLevel(levelIndex)
Pin a whole level into the texture store.
Parameters:
Name | Type | Description |
---|---|---|
levelIndex |
Number |
setEffects(effects)
Sets the effects.
Parameters:
Name | Type | Description |
---|---|---|
effects |
Effects |
setFixedLevel(levelIndex)
Sets the fixed level index. When set, the corresponding level will be used regardless of the view parameters. Unset with a null argument.
Parameters:
Name | Type | Description |
---|---|---|
levelIndex |
number | null |
Throws:
An error if the level index is out of range.
source() → {Source}
Returns the underlying source.
Returns:
- Type
- Source
textureStore() → {TextureStore}
Returns the underlying texture store.
Returns:
- Type
- TextureStore
unpinFirstLevel()
Unpin the first level. Equivalent to unpinLevel(0)
.
unpinLevel(levelIndex)
Unpin a whole level from the texture store.
Parameters:
Name | Type | Description |
---|---|---|
levelIndex |
Number |
view() → {View}
Returns the underlying view.
Returns:
- Type
- View
Events
renderComplete
Signals that the layer has been rendered.
Parameters:
Name | Type | Description |
---|---|---|
stable |
boolean | Whether all tiles were successfully rendered without missing textures or resorting to fallbacks. |