Class AbstractMapVisualizer
Map Visualizer
Represents a map.Doesn’t contain much logic and at the moment, it creates requested tiles and relays them to the factories
under itself.It has a caching mechanism to reuse tiles and does the tile positioning in unity world.
Later we’ll most likely keep track of map features here as well to allow devs to query for features easier
(i.e.query all buildings x meters around any restaurant etc).
Inheritance
ScriptableObject
AbstractMapVisualizer
Namespace:Mapbox.Unity.Map
Assembly:cs.temp.dll.dll
Syntax
public abstract class AbstractMapVisualizer : ScriptableObject
Fields
_activeTiles
Declaration
protected Dictionary<UnwrappedTileId, UnityTile> _activeTiles
Field Value
| Type |
Description |
| System.Collections.Generic.Dictionary<UnwrappedTileId, UnityTile> |
|
_inactiveTiles
Declaration
protected Queue<UnityTile> _inactiveTiles
Field Value
| Type |
Description |
| System.Collections.Generic.Queue<UnityTile> |
|
_map
Declaration
protected IMapReadable _map
Field Value
| Type |
Description |
| IMapReadable |
|
_tileProgress
Declaration
public Dictionary<UnwrappedTileId, int> _tileProgress
Field Value
| Type |
Description |
| System.Collections.Generic.Dictionary<UnwrappedTileId, System.Int32> |
|
Factories
Declaration
[NodeEditorElement("Factories")]
public List<AbstractTileFactory> Factories
Field Value
Properties
ActiveTiles
Declaration
public Dictionary<UnwrappedTileId, UnityTile> ActiveTiles { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.Dictionary<UnwrappedTileId, UnityTile> |
|
Map
Declaration
public IMapReadable Map { get; }
Property Value
| Type |
Description |
| IMapReadable |
|
State
Declaration
public ModuleState State { get; }
Property Value
Methods
ClearMap()
Declaration
Destroy()
Declaration
public virtual void Destroy()
DisposeTile(UnwrappedTileId)
Declaration
public virtual void DisposeTile(UnwrappedTileId tileId)
Parameters
| Type |
Name |
Description |
| UnwrappedTileId |
tileId |
|
GetUnityTileFromUnwrappedTileId(UnwrappedTileId)
Gets the unity tile from unwrapped tile identifier.
Declaration
public UnityTile GetUnityTileFromUnwrappedTileId(UnwrappedTileId tileId)
Parameters
| Type |
Name |
Description |
| UnwrappedTileId |
tileId |
Tile identifier.
|
Returns
| Type |
Description |
| UnityTile |
The unity tile from unwrapped tile identifier.
|
Initialize(IMapReadable, IFileSource)
Initializes the factories by passing the file source down, which is necessary for data (web/file) calls
Declaration
public virtual void Initialize(IMapReadable map, IFileSource fileSource)
Parameters
| Type |
Name |
Description |
| IMapReadable |
map |
|
| IFileSource |
fileSource |
|
LoadTile(UnwrappedTileId)
Registers requested tiles to the factories
Declaration
public virtual UnityTile LoadTile(UnwrappedTileId tileId)
Parameters
| Type |
Name |
Description |
| UnwrappedTileId |
tileId |
|
Returns
PlaceTile(UnwrappedTileId, UnityTile, IMapReadable)
Declaration
protected abstract void PlaceTile(UnwrappedTileId tileId, UnityTile tile, IMapReadable map)
Parameters
| Type |
Name |
Description |
| UnwrappedTileId |
tileId |
|
| UnityTile |
tile |
|
| IMapReadable |
map |
|
RemoveTilesFromLayer(VectorTileFactory, LayerVisualizerBase)
Declaration
public void RemoveTilesFromLayer(VectorTileFactory factory, LayerVisualizerBase layerVisualizer)
Parameters
RepositionTile(UnwrappedTileId)
Repositions active tiles instead of recreating them. Useful for panning the map
Declaration
public virtual void RepositionTile(UnwrappedTileId tileId)
Parameters
| Type |
Name |
Description |
| UnwrappedTileId |
tileId |
|
ReregisterAllTiles()
Declaration
public void ReregisterAllTiles()
ReregisterTilesTo(VectorTileFactory)
Declaration
public void ReregisterTilesTo(VectorTileFactory factory)
Parameters
TileStateChanged(UnityTile)
Declaration
public virtual void TileStateChanged(UnityTile tile)
Parameters
UnregisterAllTiles()
Declaration
public void UnregisterAllTiles()
UnregisterAndRedrawTilesFromLayer(VectorTileFactory, LayerVisualizerBase)
Declaration
public void UnregisterAndRedrawTilesFromLayer(VectorTileFactory factory, LayerVisualizerBase layerVisualizer)
Parameters
UnregisterTilesFrom(AbstractTileFactory)
Declaration
public void UnregisterTilesFrom(AbstractTileFactory factory)
Parameters
UpdateTileForProperty(AbstractTileFactory, LayerUpdateArgs)
Declaration
public void UpdateTileForProperty(AbstractTileFactory factory, LayerUpdateArgs updateArgs)
Parameters
Events
OnMapVisualizerStateChanged
Declaration
public event Action<ModuleState> OnMapVisualizerStateChanged
Event Type
OnTileError
The OnTileError event triggers when there's a Tile error.
Returns a Mapbox.Map.TileErrorEventArgs instance as a parameter, for the tile on which error occurred.
Declaration
public event EventHandler<TileErrorEventArgs> OnTileError
Event Type
| Type |
Description |
| System.EventHandler<TileErrorEventArgs> |
|
OnTileFinished
Declaration
public event Action<UnityTile> OnTileFinished
Event Type
OnTileHeightProcessingFinished
Event delegate, gets called when terrain factory finishes processing a tile.
Declaration
public event Action<UnityTile> OnTileHeightProcessingFinished
Event Type
OnTileImageProcessingFinished
Event delegate, gets called when image factory finishes processing a tile.
Declaration
public event Action<UnityTile> OnTileImageProcessingFinished
Event Type
OnTileVectorProcessingFinished
Event delegate, gets called when vector factory finishes processing a tile.
Declaration
public event Action<UnityTile> OnTileVectorProcessingFinished
Event Type