import { Component, OnInit } from '@angular/core'; import {Router, ActivatedRoute, Params} from '@angular/router'; import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; import { MDBBootstrapModule } from 'angular-bootstrap-md'; import {ContactService} from '../contact.service'; import { MyaccountComponent } from '../myaccount/myaccount.component'; import {MdDialog, MdDialogRef, MD_DIALOG_DATA} from '@angular/material'; declare var google: any; @Component({ selector: 'app-geofencing-view', templateUrl: './geofencing-view.component.html', styleUrls: ['./geofencing-view.component.scss'], providers: [ContactService] }) export class GeofencingViewComponent implements OnInit { fs :any; ls:any; emailid:any; or:any; onn_time:any; min:any; before:any; corect_min:any; hr:any custtype:any; cust:boolean=false; run(){ } mydealer(){ window.localStorage['token'] = window.localStorage['Dealer_token']; localStorage.removeItem('devices'); window.localStorage['DataUpdate'] = 'True'; if(window.localStorage['DataLoaded'] = 'True'){ window.localStorage['Custumer'] = 'OFF' this.router.navigateByUrl("add") // this.router.navigateByUrl("const?_status="+"OK"); } } myaccount(){ let dialogRef = this.dialog.open(MyaccountComponent, { width: '903px', data: {} }); dialogRef.afterClosed().subscribe(result => { if(result == "succ"){ // console.log("Updated") } }); } devicess:any; final:any; getdev(){ let foods = [] this.contactService.getDevice(this.emailid,this.useridd).subscribe( data => { this.devicess = data let swap; for(let g = 0;gthis.devicess.devices[c+1].Device_Name){ swap = this.devicess.devices[c]; this.devicess.devices[c] = this.devicess.devices[c+1]; this.devicess.devices[c+1] = swap; } } } this.final = this.devicess.devices for(let i=0;i' + xy.lat() + ',' + xy.lng(); } */ // Replace the info window's content and position. infoWindow.setContent(contentString); infoWindow.setPosition(event.latLng); infoWindow.open(map); } } useridd:any; cordin = []; ideal(){ this.router.navigateByUrl("device-report/ideal-report"); } mb:any; logoutbut:boolean; dealer:boolean; logo:any; text:any; superAdmin:Boolean = false; ngOnInit() { this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin; this.logo=window.localStorage['logo']; this.text=window.localStorage['text']; let datacoming =window.location.search; console.log('datacomingdatacomingdatacomingdatacomingdatacoming=>',datacoming); let tblid = JSON.stringify(datacoming).split("=")[1].split('"')[0]; this.contactService.getperGeoFence(tblid).subscribe( data => { this.devicess = data // console.log(this.devicess); let a = this.devicess[0].geofence.coordinates[0]; for(let k=0;k