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