Aw4751 eslint fixes
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -15,16 +15,16 @@ export class GpsLocation implements OnInit,OnChanges{
|
||||
public instance: Overlay;
|
||||
@Input() position: GeolocationPosition;
|
||||
@Input() location: number[]=[0,0];
|
||||
@Input() locationTolerance: number = 0;
|
||||
@Input() showHeading: boolean = false;
|
||||
@Input() showTolerance: boolean = false;
|
||||
@Input() heading: number = 0;
|
||||
@Input() headingTolerance: number = 0;
|
||||
public locTolerancePixels: number = 0;
|
||||
public path: string = "";
|
||||
public rotate: string = "";
|
||||
private resolution: number = 0;
|
||||
initialized:boolean = false;
|
||||
@Input() locationTolerance = 0;
|
||||
@Input() showHeading = false;
|
||||
@Input() showTolerance = false;
|
||||
@Input() heading = 0;
|
||||
@Input() headingTolerance = 0;
|
||||
public locTolerancePixels = 0;
|
||||
public path = "";
|
||||
public rotate = "";
|
||||
private resolution = 0;
|
||||
initialized = false;
|
||||
@ViewChild('location', { static: true }) locationElement: ElementRef;
|
||||
|
||||
constructor(private map: MapComponent) {
|
||||
@@ -42,12 +42,12 @@ export class GpsLocation implements OnInit,OnChanges{
|
||||
position: fromLonLat( this.location),
|
||||
element: this.locationElement.nativeElement
|
||||
});
|
||||
var x = Math.tan(this.headingTolerance * Math.PI / 180)*40;
|
||||
var y = Math.cos(this.headingTolerance * Math.PI / 180) * 40;
|
||||
var y1 = Math.round(500 - y);
|
||||
var x1 = Math.round(500 - x);
|
||||
var y2 = Math.round(y1);
|
||||
var x2 = Math.round(500 + x);
|
||||
const x = Math.tan(this.headingTolerance * Math.PI / 180)*40;
|
||||
const y = Math.cos(this.headingTolerance * Math.PI / 180) * 40;
|
||||
const y1 = Math.round(500 - y);
|
||||
const x1 = Math.round(500 - x);
|
||||
const y2 = Math.round(y1);
|
||||
const x2 = Math.round(500 + x);
|
||||
this.path = "M " + x2 + " " + y2 + " A 45 45,0,0,0, " + x1 + " " + y1 + " L 493 500 L 507 500 Z";
|
||||
this.rotate = "rotate(" + Math.round(this.heading) + " 500 500)";
|
||||
this.locTolerancePixels = this.locationTolerance;
|
||||
@@ -61,7 +61,7 @@ export class GpsLocation implements OnInit,OnChanges{
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (changes.position && this.instance) {
|
||||
var p = changes.position.currentValue as GeolocationPosition;
|
||||
const p = changes.position.currentValue as GeolocationPosition;
|
||||
if(p && this.initialized) {
|
||||
this.instance.setPosition(fromLonLat([p.coords.longitude, p.coords.latitude]));
|
||||
this.locationTolerance = p.coords.accuracy;
|
||||
|
Reference in New Issue
Block a user