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.

19 lines
516 B

import { toLngLats } from "../../../utils";
import { Props, Emit } from ".";
export function useInit(props: Props, emit: Emit, map: T.Map) {
const { interval, speed, dynamicLine, Datas, carstyle, polylinestyle } = props;
const instance = new T.CarTrack(map, {
interval,
speed,
dynamicLine,
Datas: toLngLats(Datas),
carstyle,
polylinestyle,
passOneNode: (lnglat, index, length) => {
emit("passOneNode", [lnglat.lng, lnglat.lat], index, length);
}
});
return instance;
}