Online Maps  v3
OnlineMapsBuildings Class Reference

Component that controls the buildings. More...

Inheritance diagram for OnlineMapsBuildings:
IOnlineMapsSavableComponent

Classes

class  Tile
 Building tile More...
 

Public Member Functions

void CreateBuilding (OnlineMapsBuildingsNodeData data)
 Creates a building. More...
 
OnlineMapsSavableItem[] GetSavableItems ()
 Returns an array of items to save More...
 
void LoadBuildingsFromOSM (string osmData)
 Parses the OSM data and adds buildings to the queue for creation. More...
 
void MoveRelationsToWays (List< OnlineMapsOSMRelation > relations, Dictionary< string, OnlineMapsOSMWay > ways, Dictionary< string, OnlineMapsOSMNode > nodes)
 Moves buildings from relations to ways. More...
 

Public Attributes

Action OnAllBuildingsCreated
 The event, which occurs when all buildings has been created. More...
 
Action< OnlineMapsBuildingBaseOnBuildingCreated
 The event, which occurs when creating of the building. More...
 
Action< OnlineMapsBuildingBaseOnBuildingDispose
 The event, which occurs when disposing of the building. More...
 
Func< List< Vector3 >, Vector3 > OnCalculateBuildingCenter
 This event allows you to intercept the calculation of the center point of the building, and return your own center point. More...
 
Predicate< OnlineMapsBuildingsNodeDataOnCreateBuilding
 This event is triggered before create a building.
Return TRUE - if you want to create this building, FALSE - avoid creating this building. More...
 
Func< OnlineMapsOSMWay, float > OnGenerateBuildingHeight
 This event is fired when the height of the building is unknown.
It allows you to control the height of buildings.
Return - the height of buildings. More...
 
Action OnNewBuildingsReceived
 The event, which occurs when the new building was received. More...
 
Action< OnlineMapsOSMWay, List< OnlineMapsOSMNode > > OnPrepareBuildingCreation
 This event is triggered when preparing to create a building, and allows you to make the necessary changes and additions to the way and used nodes. More...
 
Func< string, Vector2, Vector2, string > OnPrepareRequest
 This event is called when creating a request to OSM Overpass API. More...
 
Action OnRequestComplete
 The event, which occurs after the response has been received. More...
 
Action OnRequestFailed
 The event, which occurs when the request is failed. More...
 
Action OnRequestSent
 The event, which occurs when the request for a building sent. More...
 
Predicate< OnlineMapsBuildingBaseOnShowBuilding
 This event is triggered before show a building.
Return TRUE - if you want to show this building, FALSE - do not show this building. More...
 
Dictionary< string, OnlineMapsBuildingBasebuildings
 Dictionary of buildings. More...
 
GameObject container
 Container for buildings. More...
 
OnlineMapsControlBaseDynamicMesh control
 Reference to the control. More...
 
OnlineMapsRange levelsRange = new OnlineMapsRange(3, 7, 1, 100)
 Range levels of buildings, if the description of the building is not specified. More...
 
float levelHeight = 4.5f
 Height of the building level. More...
 
bool generateColliders = true
 Need to generate a collider? More...
 
float heightScale = 1
 Scale height of the building. More...
 
OnlineMaps map
 Reference to the map. More...
 
OnlineMapsBuildingMaterial[] materials
 Materials of buildings. More...
 
int maxActiveBuildings = 0
 The maximum number of active buildings (0 - unlimited). More...
 
int maxBuilding = 0
 The maximum number of buildings (0 - unlimited). More...
 
float minHeight = 4.5f
 Minimal height of the building. More...
 
OnlineMapsOSMAPIQuery osmRequest
 Instance of the request More...
 
bool useColorTag = true
 Use the Color tag for buildings? More...
 
bool useHeightTag = true
 Use the Height tag for buildings? More...
 
OnlineMapsRange zoomRange = new OnlineMapsRange(19, OnlineMaps.MAXZOOM_EXT)
 Range of zoom, in which the building will be created. More...
 

Static Public Attributes

static float requestRate = 0.1f
 Rate of requests to OSM Overpass API. More...
 

Properties

static GameObject buildingContainer [get]
 GameObject, which will create the building. More...
 
static OnlineMapsBuildings instance [get]
 Instance of OnlineMapsBuildings. More...
 
IEnumerable< OnlineMapsBuildingBaseactiveBuildings [get]
 Returns the active (visible) building. More...
 

Detailed Description

Component that controls the buildings.

Member Function Documentation

◆ CreateBuilding()

void OnlineMapsBuildings.CreateBuilding ( OnlineMapsBuildingsNodeData  data)

Creates a building.

Parameters
dataBuilding data

◆ GetSavableItems()

OnlineMapsSavableItem [] OnlineMapsBuildings.GetSavableItems ( )

Returns an array of items to save

Returns
Array of items to save

Implements IOnlineMapsSavableComponent.

◆ LoadBuildingsFromOSM()

void OnlineMapsBuildings.LoadBuildingsFromOSM ( string  osmData)

Parses the OSM data and adds buildings to the queue for creation.

Parameters
osmDataOSM data

◆ MoveRelationsToWays()

void OnlineMapsBuildings.MoveRelationsToWays ( List< OnlineMapsOSMRelation relations,
Dictionary< string, OnlineMapsOSMWay ways,
Dictionary< string, OnlineMapsOSMNode nodes 
)

Moves buildings from relations to ways.

Parameters
relationsRelations
waysWays
nodesNodes

Member Data Documentation

◆ buildings

Dictionary<string, OnlineMapsBuildingBase> OnlineMapsBuildings.buildings

Dictionary of buildings.

◆ container

GameObject OnlineMapsBuildings.container

Container for buildings.

◆ control

OnlineMapsControlBaseDynamicMesh OnlineMapsBuildings.control

Reference to the control.

◆ generateColliders

bool OnlineMapsBuildings.generateColliders = true

Need to generate a collider?

◆ heightScale

float OnlineMapsBuildings.heightScale = 1

Scale height of the building.

◆ levelHeight

float OnlineMapsBuildings.levelHeight = 4.5f

Height of the building level.

◆ levelsRange

OnlineMapsRange OnlineMapsBuildings.levelsRange = new OnlineMapsRange(3, 7, 1, 100)

Range levels of buildings, if the description of the building is not specified.

◆ map

OnlineMaps OnlineMapsBuildings.map

Reference to the map.

◆ materials

OnlineMapsBuildingMaterial [] OnlineMapsBuildings.materials

Materials of buildings.

◆ maxActiveBuildings

int OnlineMapsBuildings.maxActiveBuildings = 0

The maximum number of active buildings (0 - unlimited).

◆ maxBuilding

int OnlineMapsBuildings.maxBuilding = 0

The maximum number of buildings (0 - unlimited).

◆ minHeight

float OnlineMapsBuildings.minHeight = 4.5f

Minimal height of the building.

◆ OnAllBuildingsCreated

Action OnlineMapsBuildings.OnAllBuildingsCreated

The event, which occurs when all buildings has been created.

◆ OnBuildingCreated

Action<OnlineMapsBuildingBase> OnlineMapsBuildings.OnBuildingCreated

The event, which occurs when creating of the building.

◆ OnBuildingDispose

Action<OnlineMapsBuildingBase> OnlineMapsBuildings.OnBuildingDispose

The event, which occurs when disposing of the building.

◆ OnCalculateBuildingCenter

Func<List<Vector3>, Vector3> OnlineMapsBuildings.OnCalculateBuildingCenter

This event allows you to intercept the calculation of the center point of the building, and return your own center point.

◆ OnCreateBuilding

Predicate<OnlineMapsBuildingsNodeData> OnlineMapsBuildings.OnCreateBuilding

This event is triggered before create a building.
Return TRUE - if you want to create this building, FALSE - avoid creating this building.

◆ OnGenerateBuildingHeight

Func<OnlineMapsOSMWay, float> OnlineMapsBuildings.OnGenerateBuildingHeight

This event is fired when the height of the building is unknown.
It allows you to control the height of buildings.
Return - the height of buildings.

◆ OnNewBuildingsReceived

Action OnlineMapsBuildings.OnNewBuildingsReceived

The event, which occurs when the new building was received.

◆ OnPrepareBuildingCreation

Action<OnlineMapsOSMWay, List<OnlineMapsOSMNode> > OnlineMapsBuildings.OnPrepareBuildingCreation

This event is triggered when preparing to create a building, and allows you to make the necessary changes and additions to the way and used nodes.

◆ OnPrepareRequest

Func<string, Vector2, Vector2, string> OnlineMapsBuildings.OnPrepareRequest

This event is called when creating a request to OSM Overpass API.

◆ OnRequestComplete

Action OnlineMapsBuildings.OnRequestComplete

The event, which occurs after the response has been received.

◆ OnRequestFailed

Action OnlineMapsBuildings.OnRequestFailed

The event, which occurs when the request is failed.

◆ OnRequestSent

Action OnlineMapsBuildings.OnRequestSent

The event, which occurs when the request for a building sent.

◆ OnShowBuilding

Predicate<OnlineMapsBuildingBase> OnlineMapsBuildings.OnShowBuilding

This event is triggered before show a building.
Return TRUE - if you want to show this building, FALSE - do not show this building.

◆ osmRequest

OnlineMapsOSMAPIQuery OnlineMapsBuildings.osmRequest

Instance of the request

◆ requestRate

float OnlineMapsBuildings.requestRate = 0.1f
static

Rate of requests to OSM Overpass API.

◆ useColorTag

bool OnlineMapsBuildings.useColorTag = true

Use the Color tag for buildings?

◆ useHeightTag

bool OnlineMapsBuildings.useHeightTag = true

Use the Height tag for buildings?

◆ zoomRange

OnlineMapsRange OnlineMapsBuildings.zoomRange = new OnlineMapsRange(19, OnlineMaps.MAXZOOM_EXT)

Range of zoom, in which the building will be created.

Property Documentation

◆ activeBuildings

IEnumerable<OnlineMapsBuildingBase> OnlineMapsBuildings.activeBuildings
get

Returns the active (visible) building.

◆ buildingContainer

GameObject OnlineMapsBuildings.buildingContainer
staticget

GameObject, which will create the building.

◆ instance

OnlineMapsBuildings OnlineMapsBuildings.instance
staticget

Instance of OnlineMapsBuildings.