TileProviderByIndex

Inherits TileProvider

Members

Name

Documentation

Type

Description

Optional

DefaultProvider

Table

No

IndexTileProviders

The list of all tileprovides and the indices at which they are used

Table

Table parameters

No

Table parameters for IndexTileProviders

The list of all tileprovides and the indices at which they are used

  • Optional: No

Name

Documentation

Type

Description

Optional

*

Table

Table parameters

Yes

Table parameters for *

  • Optional: Yes

Name

Documentation

Type

Description

Optional

TileIndex

The index for which the provided tile provider is used

Table

Table parameters

No

TileProvider

The dictionary that described the tileprovider to be used by the provided index

Table

No

Table parameters for TileIndex

The index for which the provided tile provider is used

  • Optional: No

Name

Documentation

Type

Description

Optional

Level

The z-level which corresponds to the depth of the tile pyramid, which directly impacts the applied resolution of the tileprovider shown here

Integer

In range: ( 0,255 )

No

X

The x coordinate for this index. This specifies the horizontal direction (longitude) component

Integer

Greater or equal to: 0

No

Y

The y coordinate for this index. This specifies the vertical direction (latitude) component

Integer

Greater or equal to: 0

No

Asset Examples

Basic

This example file adds a layer to a globe that has a base layer and then replaces one hemisphere of the planet with a single image. 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 = "TileProviderByIndex",
13  Enabled = true,
14  -- The default tile provider that is used for the whole globe
15  DefaultTileProvider = {
16    Identifier = "Blue_Marble",
17    FilePath = images .. "earth_bluemarble.jpg"
18  },
19  TileProviders = {
20    -- We only define one additional tile provider that overwrites the right
21    -- hemisphere of the globe
22    {
23      Index = { X = 0, Y = 0, Level = 2 },
24      TileProvider = {
25        Identifier = "Blue_Marble_Night",
26        FilePath = images .. "earth_night.png"
27      }
28    }
29  }
30}
31
32-- Define the scene graph node
33local Node = {
34  Identifier = "TileProviderByIndex_Example",
35  Renderable = {
36    Type = "RenderableGlobe",
37    Layers = {
38      -- The globe has exactly one layer, which is the one we defined above
39      ColorLayers = { TileProvider }
40    }
41  },
42  GUI = {
43    Name = "Basic",
44    Path = "/Examples/TileProviderByIndex"
45  }
46}
47
48asset.onInitialize(function()
49  openspace.addSceneGraphNode(Node)
50end)
51
52asset.onDeinitialize(function()
53  openspace.removeSceneGraphNode(Node)
54end)