You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
673 B
22 lines
673 B
import { useMapRoot } from "../../../use";
|
|
import { RouteState } from "../types";
|
|
import { useMethods } from ".";
|
|
|
|
export async function useInit(state: RouteState) {
|
|
const { onSearchComplete, onDrivingComplete, onTransitComplete } = useMethods(state);
|
|
|
|
state.tdtMap = await useMapRoot();
|
|
state.localSearch = new T.LocalSearch(state.tdtMap, {
|
|
pageCapacity: 10,
|
|
onSearchComplete
|
|
});
|
|
state.drivingRoute = new T.DrivingRoute(state.tdtMap, {
|
|
policy: state.drivingPolicy,
|
|
onSearchComplete: onDrivingComplete
|
|
});
|
|
state.transitRoute = new T.TransitRoute(state.tdtMap, {
|
|
policy: state.transitPolicy,
|
|
onSearchComplete: onTransitComplete
|
|
});
|
|
}
|