locations track
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LocTrcService } from './loc-trc.service';
|
||||
|
||||
describe('LocTrcService', () => {
|
||||
let service: LocTrcService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(LocTrcService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Geolocation } from '@capacitor/geolocation';
|
||||
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LocTrcService {
|
||||
|
||||
constructor(public sessionDataProviderService: SessionDataProviderService) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
async startTracking(){
|
||||
const coordinates = await Geolocation.getCurrentPosition();
|
||||
//debugger;
|
||||
console.log('Current position 0000:', coordinates);
|
||||
const printCurrentPosition = async () => {
|
||||
const coordinates = await Geolocation.getCurrentPosition();
|
||||
|
||||
console.log('Current position:', coordinates);
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user