Lightship Map Prefab
The Lightship Maps prefab is a Unity prefab, a prepackaged GameObject with components, property values, and child assets. The prefab supports feature builders, a map layer, features, and themes.
You can change each of these prefab properties in the Inspector window for the prefab:
-
Label Language - An optional ISO 639-1 language code specifying which localized strings will be used for labels, if a translation in that language is available. If no translation matching this language exists, then it will fall back to a language used by people geographically local to that area (which is guaranteed to always exist). If this field is empty, all labels will use the 'local' version of their text strings by default.
-
Lightship Map Manager - A reference to the Lightship Map Manager.
-
Center Map at Origin - If set, the map will always be positioned with its center at the scene's origin.
-
Maximum Map Offset - The maximum distance the map is allowed to move away from the origin (in meters). If the map's center moves further than this limit, all maptiles and objects placed on the map will be moved back to the scene's origin.
-
Tile Batch Count - This field can be used to specify the maximum number of maptiles that will be scheduled together in a batch. In most cases, this value should be kept at its default. Setting this to a value below the default may help mitigate the impact on performance that could occur when a large number of maptiles are returned at the same time, if profiling showed large spikes in frame time when this happens.
-
Map Theme - The theme to use when rendering this map view. See Map Themes.
-
Viewable Radius - The map's viewable radius, in scene units. This field is optional if the viewable area's radius is passed in along with its center location at runtime.
-
Start at Default Location - If set, the map view will be initialized at the Default Location.
-
Default Location - The default starting location.
-
Map Layers - A list of prefabs or GameObjects containing MapLayer components that are used while constructing the map view. These are typically used to place objects or to render geometry that may cross maptile boundaries to cover larger sections of the map. See Map Layers.
Lightship Map Manager
The LightshipMapManager class is responsible for initializing the Lightship Maps Core library, which is the Maps SDK component that streams and decodes raw maptile data. This class is meant to be a singleton, so there should be a maximum of one active LightshipMapManager at any time in a given scene. Typically, the LightshipMapManager will be a component on the same GameObject as the LightshipMapView in a LightshipMap prefab. However, in scenes where multiple map views are active at once, for example, the LightshipMapManager may be attached to another GameObject in the scene.
Lightship Map View
The LightshipMapView class represents a single viewable area of the map, and is the primary API that games will use to interact with the Maps SDK. Most scenes will have a single LightshipMapView instance, although the Maps SDK supports any number of active map views in a given scene at a time.