完善样式系统与调试链路底座
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
} from '../../utils/orienteeringCourse'
|
||||
|
||||
export interface ProjectedCourseLeg {
|
||||
index: number
|
||||
fromKind: OrienteeringCourseLeg['fromKind']
|
||||
toKind: OrienteeringCourseLeg['toKind']
|
||||
from: ScreenPoint
|
||||
@@ -18,6 +19,7 @@ export interface ProjectedCourseLeg {
|
||||
}
|
||||
|
||||
export interface ProjectedCourseStart {
|
||||
index: number
|
||||
label: string
|
||||
point: ScreenPoint
|
||||
headingDeg: number | null
|
||||
@@ -30,6 +32,7 @@ export interface ProjectedCourseControl {
|
||||
}
|
||||
|
||||
export interface ProjectedCourseFinish {
|
||||
index: number
|
||||
label: string
|
||||
point: ScreenPoint
|
||||
}
|
||||
@@ -59,7 +62,8 @@ export class CourseLayer implements MapLayer {
|
||||
}
|
||||
|
||||
projectStarts(starts: OrienteeringCourseStart[], scene: MapScene, camera: CameraState): ProjectedCourseStart[] {
|
||||
return starts.map((start) => ({
|
||||
return starts.map((start, index) => ({
|
||||
index,
|
||||
label: start.label,
|
||||
point: this.projectPoint(start, scene, camera),
|
||||
headingDeg: start.headingDeg,
|
||||
@@ -75,14 +79,16 @@ export class CourseLayer implements MapLayer {
|
||||
}
|
||||
|
||||
projectFinishes(finishes: OrienteeringCourseFinish[], scene: MapScene, camera: CameraState): ProjectedCourseFinish[] {
|
||||
return finishes.map((finish) => ({
|
||||
return finishes.map((finish, index) => ({
|
||||
index,
|
||||
label: finish.label,
|
||||
point: this.projectPoint(finish, scene, camera),
|
||||
}))
|
||||
}
|
||||
|
||||
projectLegs(legs: OrienteeringCourseLeg[], scene: MapScene, camera: CameraState): ProjectedCourseLeg[] {
|
||||
return legs.map((leg) => ({
|
||||
return legs.map((leg, index) => ({
|
||||
index,
|
||||
fromKind: leg.fromKind,
|
||||
toKind: leg.toKind,
|
||||
from: worldToScreen(camera, lonLatToWorldTile(leg.fromPoint, scene.zoom), false),
|
||||
|
||||
Reference in New Issue
Block a user