Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
appendCoord(coord: AnyLngLat): void {
coord = LngLat.fromAny(coord);
this._coords.push(new AnyMemberAnimator(LngLat, this, coord as LngLat));
this._points.push(PointR2.origin());
this.requireUpdate(View.NeedsAnimate | MapView.NeedsProject);
}
get anchor(): PointR2 {
const view = this._view;
return view ? view.anchor : PointR2.origin();
}
setCoords(coords: AnyLngLat[], tween?: Tween): void {
let i = 0;
for (const n = Math.min(this._coords.length, coords.length); i < n; i += 1) {
const coord = LngLat.fromAny(coords[i]);
this._coords[i].setState(coord, tween);
}
for (const n = coords.length; i < n; i += 1) {
const coord = LngLat.fromAny(coords[i]);
this._coords.push(new AnyMemberAnimator(LngLat, this, coord as LngLat));
this._points.push(PointR2.origin());
this.requireUpdate(View.NeedsAnimate | MapView.NeedsProject);
}
this._coords.length = coords.length;
}
insertCoord(index: number, coord: AnyLngLat): void {
coord = LngLat.fromAny(coord);
this._coords.splice(index, 0, new AnyMemberAnimator(LngLat, this, coord as LngLat));
this._points.splice(index, 0, PointR2.origin());
this.requireUpdate(View.NeedsAnimate | MapView.NeedsProject);
}
get anchor(): PointR2 {
const view = this._view;
return view ? view.anchor : PointR2.origin();
}