Online Maps v3
Loading...
Searching...
No Matches
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.
 
OnlineMapsSavableItem[] GetSavableItems ()
 Returns an array of items to save.
 
void LoadBuildingsFromOSM (string osmData)
 Parses the OSM data and adds buildings to the queue for creation.
 
void MoveRelationsToWays (List< OnlineMapsOSMRelation > relations, Dictionary< string, OnlineMapsOSMWay > ways, Dictionary< string, OnlineMapsOSMNode > nodes)
 Moves buildings from relations to ways.
 

Public Attributes

Action OnAllBuildingsCreated
 The event, which occurs when all buildings has been created.
 
Action< OnlineMapsBuildingBaseOnBuildingCreated
 The event, which occurs when creating of the building.
 
Action< OnlineMapsBuildingBaseOnBuildingDispose
 The event, which occurs when disposing of the building.
 
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.
 
Predicate< OnlineMapsBuildingsNodeDataOnCreateBuilding
 This event is triggered before create a building.
Return TRUE - if you want to create this building, FALSE - avoid creating this building.
 
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.
 
Action OnNewBuildingsReceived
 The event, which occurs when the new building was received.
 
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.
 
Func< string, Vector2, Vector2, string > OnPrepareRequest
 This event is called when creating a request to OSM Overpass API.
 
Action OnRequestComplete
 The event, which occurs after the response has been received.
 
Action OnRequestFailed
 The event, which occurs when the request is failed.
 
Action OnRequestSent
 The event, which occurs when the request for a building sent.
 
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.
 
Dictionary< string, OnlineMapsBuildingBasebuildings
 Dictionary of buildings.
 
GameObject container
 Container for buildings.
 
OnlineMapsControlBaseDynamicMesh control
 Reference to the control.
 
OnlineMapsRange levelsRange = new OnlineMapsRange(3, 7, 1, 100)
 Range levels of buildings, if the description of the building is not specified.
 
float levelHeight = 4.5f
 Height of the building level.
 
bool generateColliders = true
 Need to generate a collider?
 
float heightScale = 1
 Scale height of the building.
 
OnlineMaps map
 Reference to the map.
 
OnlineMapsBuildingMaterial[] materials
 Materials of buildings.
 
int maxActiveBuildings = 0
 The maximum number of active buildings (0 - unlimited).
 
int maxBuilding = 0
 The maximum number of buildings (0 - unlimited).
 
float minHeight = 4.5f
 Minimal height of the building.
 
OnlineMapsOSMAPIQuery osmRequest
 Instance of the request.
 
bool useColorTag = true
 Use the Color tag for buildings?
 
bool useHeightTag = true
 Use the Height tag for buildings?
 
OnlineMapsRange zoomRange = new OnlineMapsRange(19, OnlineMaps.MAXZOOM_EXT)
 Range of zoom, in which the building will be created.
 

Static Public Attributes

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

Properties

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

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