Topic: Request/Load/Create Buildings
Hi,
I'd like to limit the number of OSM buildings according to the distance between the building and a player on the ground.
The buildings should dynamically be loaded and disposed when the player moves.
I did a first naive implementation by altering a line in the OnlineMapsBuildings script:
building = OnlineMapsBuildingBuiltIn.Create(this, data.way, data.nodes);
if (building != null && Vector3.Distance(Player.transform.position, building.transform.position) < 200)
{
building.LoadMeta(data.way);
if (OnBuildingCreated != null) OnBuildingCreated(building);
unusedBuildings.Add(data.way.id, building);
}
But I'd like to ask how I can make such a functionality work the "proper" way. Maybe there's something in your API that I missed.
Changing the zoom level and therefore limit the number of buildings as a whole is not an option for several reasons.
Thanks in advance.