private void OnTransportNetworkCellAdded(TransportNetworkType networkType, TransportCellKey cellKey) { if (networkType != NetworkType) { return; } var nodeIds = m_transportApi.GetNodeIdsForNetworkInCell(networkType, cellKey); var directedEdgeIds = m_transportApi.GetDirectedEdgeIdsForNetworkInCell(networkType, cellKey); var wayIds = m_transportApi.GetWayIdsForNetworkInCell(networkType, cellKey); AddForCell(cellKey, nodeIds, directedEdgeIds, wayIds); }
/// <summary> /// Get all TransportWay objects currently streamed in for the given transport network and cell. /// </summary> /// <param name="transportApi">TransportApi instance.</param> /// <param name="transportNetwork">The returned results are filtered to contain only objects belonging to this transport network.</param> /// <param name="cellKey">The returned results are filtered to contain only objects belonging to this cell.</param> /// <returns>The list of TransportWay objects for the given network and cell.</returns> static public IList <TransportWay> GetWaysForNetworkAndCell(this TransportApi transportApi, TransportNetworkType transportNetwork, TransportCellKey cellKey) { var wayIds = transportApi.GetWayIdsForNetworkInCell(transportNetwork, cellKey); var ways = new List <TransportWay>(); foreach (var wayId in wayIds) { TransportWay way; if (!transportApi.TryGetWay(wayId, out way)) { throw new System.ArgumentOutOfRangeException("unable to fetch TransportWay"); } ways.Add(way); } return(ways); }