Fix null ref
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:
parent
4a0474546c
commit
506b15cd4f
@ -59,10 +59,12 @@ export class GpsLocation implements OnInit,OnChanges{
|
|||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
if (changes.position && this.instance) {
|
if (changes.position && this.instance) {
|
||||||
var p = changes.position.currentValue as Position;
|
var p = changes.position.currentValue as Position;
|
||||||
|
if(p) {
|
||||||
this.instance.setPosition(fromLonLat([p.coords.longitude, p.coords.latitude]));
|
this.instance.setPosition(fromLonLat([p.coords.longitude, p.coords.latitude]));
|
||||||
this.locationTolerance = p.coords.accuracy;
|
this.locationTolerance = p.coords.accuracy;
|
||||||
this.recalcLocationTolerance();
|
this.recalcLocationTolerance();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(changes.heading && this.instance) {
|
if(changes.heading && this.instance) {
|
||||||
this.rotate = "rotate(" + Math.round(changes.heading.currentValue) + " 500 500)";
|
this.rotate = "rotate(" + Math.round(changes.heading.currentValue) + " 500 500)";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user