TileProviderByIndex

Inherits TileProvider

This TileProvider provides the ability to override the contents for tiles at specific indices. A default tile provider has to be specified that is used by default for the entire globe. If a tile provider is specified for a specific tile, then the default tile provide is used for all other indices and the specialized tile provider P is used for the specified index. Any number of specialized tile providers can be provided to overwrite specific locations on the globe.

This tile provider can be used to, for example, show an inset image that is merged with a larger globe-spanning image.

Members

Name

Documentation

Type

Description

Optional

DefaultTileProvider

Table

Layer

No

TileProviders

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

Table

Table parameters

No

Table parameters for TileProviders

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

  • Optional: No

Name

Documentation

Type

Description

Optional

*

An IndexProvider is a tile provider that is only valid for a specific combination of x, y, and level. Whenever a globe tries to render a tile and this tile provider has an IndexProvider of that index, it will use the specialized tile provider instead.

Table

Table parameters

Yes

Table parameters for *

An IndexProvider is a tile provider that is only valid for a specific combination of x, y, and level. Whenever a globe tries to render a tile and this tile provider has an IndexProvider of that index, it will use the specialized tile provider instead.

  • Optional: Yes

Name

Documentation

Type

Description

Optional

Index

The index for which the provided tile provider is used.

Table

Table parameters

No

TileProvider

The dictionary that describes the TileProvider to be used by the provided index.

Table

Layer

No

Table parameters for Index

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. Not that in general the level would start at 2.

Integer

In range: ( 0,23 )

No

X

The x coordinate for this index. This specifies the horizontal direction (longitude) component. Acceptable values for this coordinate have to be smaller than $2 * 2^{level}$.

Integer

Greater or equal to: 0

No

Y

The y coordinate for this index. This specifies the vertical direction (latitude) component. Acceptable values for this coordinate have to be smaller than $2^{level}$.

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 = "TileProviderByIndex - Basic",
44    Path = "/Examples"
45  }
46}
47
48asset.onInitialize(function()
49  openspace.addSceneGraphNode(Node)
50end)
51
52asset.onDeinitialize(function()
53  openspace.removeSceneGraphNode(Node)
54end)