Skip to content

Commit 37b4bde

Browse files
committed
Reorder functions
1 parent 1c94d2c commit 37b4bde

2 files changed

Lines changed: 19 additions & 16 deletions

File tree

src/interaction/TrackInteractionModify.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ export default class Modify extends PointerInteraction {
6666
private overlay_: VectorLayer<VectorSource<Feature>>;
6767
private lastPixel_ = [0, 0];
6868
private trackData_: Options['trackData'];
69-
/**
70-
* @type {Feature<Point>}
71-
*/
7269
private pointAtCursorFeature_ = new Feature({
7370
geometry: new Point([0, 0]),
7471
type: 'sketch',

src/interaction/TrackManager.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,8 @@ export interface Options {
5656
export default class TrackManager<POIMeta> {
5757

5858
private map_: Map;
59-
get map(): Map {
60-
return this.map;
61-
}
6259
private source_: VectorSource;
6360
private trackLayer_: VectorLayer<VectorSource>;
64-
get trackLayer(): VectorLayer<VectorSource> {
65-
return this.trackLayer_;
66-
}
6761
private shadowTrackLayer_: VectorLayer<VectorSource>;
6862
private hitTolerance_: number;
6963
public snapping = true;
@@ -75,13 +69,7 @@ export default class TrackManager<POIMeta> {
7569
private trackHoverEventListeners_: Function[] = [];
7670
private trackData_ = new TrackData();
7771
private router_: Router;
78-
get router(): Router {
79-
return this.router_;
80-
}
8172
private profiler_: Profiler;
82-
get profiler(): Profiler {
83-
return this.profiler_;
84-
}
8573
private updater_: TrackUpdater;
8674
private interaction_: TrackInteraction;
8775
private historyManager_ = new HistoryManager<Feature<Point|LineString>[]>();
@@ -122,7 +110,7 @@ export default class TrackManager<POIMeta> {
122110
// }));
123111

124112

125-
113+
// Add a control point at the end of the track
126114
// @ts-ignore too complicate to declare proper events
127115
this.interaction_.on('drawend',
128116
async (event: DrawEvent) => {
@@ -168,6 +156,7 @@ export default class TrackManager<POIMeta> {
168156
}
169157
});
170158

159+
// Move an existing poi, control point or segment
171160
this.interaction_.on(
172161
// @ts-ignore too complicate to declare proper events
173162
'modifyend',
@@ -209,6 +198,7 @@ export default class TrackManager<POIMeta> {
209198
}
210199
});
211200

201+
// Delete a control point or a POI
212202
this.interaction_.on(
213203
// @ts-ignore too complicate to declare proper events
214204
'select',
@@ -262,6 +252,22 @@ export default class TrackManager<POIMeta> {
262252
});
263253
}
264254

255+
get map(): Map {
256+
return this.map;
257+
}
258+
259+
get trackLayer(): VectorLayer<VectorSource> {
260+
return this.trackLayer_;
261+
}
262+
263+
get router(): Router {
264+
return this.router_;
265+
}
266+
267+
get profiler(): Profiler {
268+
return this.profiler_;
269+
}
270+
265271
private pushNewStateToHistoryManager_() {
266272
const segments = this.getSegments();
267273
const controlPoints = this.getControlPoints();

0 commit comments

Comments
 (0)