TileProviderByLevel
Inherits TileProvider
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
|
No |
Table parameters for LevelTileProviders
Optional: No
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
|
Yes |
Table parameters for *
Optional: Yes
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
|
Greater or equal to: 0 |
No |
|
|
|
No |
Asset Examples
Basic
This example file adds two layers to a globe. The first layer being used is showing a cloud layer and at higher levels a Blue Marble image is used instead. Recommended reading for this example is the documentation on the DefaultTileProvider.
1-- Download some example images that we can use
2local images = asset.resource({
3 Name = "Earth Textures",
4 Type = "HttpSynchronization",
5 Identifier = "earth_textures",
6 Version = 3
7})
8
9-- Define the TileProvider
10local TileProvider = {
11 Identifier = "Example",
12 Type = "TileProviderByLevel",
13 Enabled = true,
14 LevelTileProviders = {
15 {
16 -- Show only a cloud layer for the first 3 layers (2, 3, 4)
17 MaxLevel = 4,
18 TileProvider = {
19 Identifier = "Blue_Marble_Clouds",
20 FilePath = images .. "earth_clouds.jpg"
21 }
22 },
23 {
24 -- Then transition fade into the Blue Marble image representation
25 MaxLevel = 22,
26 TileProvider = {
27 Identifier = "Blue_Marble",
28 FilePath = images .. "earth_bluemarble.jpg"
29 }
30 }
31 }
32}
33
34-- Define the scene graph node
35local Node = {
36 Identifier = "TileProviderByLevel_Example",
37 Renderable = {
38 Type = "RenderableGlobe",
39 Layers = {
40 -- The globe has exactly one layer, which is the one we defined above
41 ColorLayers = { TileProvider }
42 }
43 },
44 GUI = {
45 Name = "TileProviderByLevel - Basic",
46 Path = "/Examples"
47 }
48}
49
50asset.onInitialize(function()
51 openspace.addSceneGraphNode(Node)
52end)
53
54asset.onDeinitialize(function()
55 openspace.removeSceneGraphNode(Node)
56end)