|
@@ -53,7 +53,7 @@ export class DashboardComponent implements OnInit {
|
|
|
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
|
{ maxZoom: 18,
|
|
{ maxZoom: 18,
|
|
|
attribution: '© OpenStreetMap contributors'
|
|
attribution: '© OpenStreetMap contributors'
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
// Values to bind to Leaflet Directive
|
|
// Values to bind to Leaflet Directive
|
|
@@ -62,11 +62,11 @@ export class DashboardComponent implements OnInit {
|
|
|
zoom: 10,
|
|
zoom: 10,
|
|
|
center: latLng([13.661714, -89.251530])
|
|
center: latLng([13.661714, -89.251530])
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
constructor(
|
|
constructor(
|
|
|
- private plantsService: PlantsService,
|
|
|
|
|
- private route: ActivatedRoute,
|
|
|
|
|
- private orgService: OrganizationsService,
|
|
|
|
|
|
|
+ private plantsService: PlantsService,
|
|
|
|
|
+ private route: ActivatedRoute,
|
|
|
|
|
+ private orgService: OrganizationsService,
|
|
|
private router: Router,
|
|
private router: Router,
|
|
|
private zone: NgZone) {
|
|
private zone: NgZone) {
|
|
|
|
|
|
|
@@ -97,12 +97,12 @@ export class DashboardComponent implements OnInit {
|
|
|
else {
|
|
else {
|
|
|
this.totalMetersInstalled = localStorage.getItem("installedCapacityTotal_kW");
|
|
this.totalMetersInstalled = localStorage.getItem("installedCapacityTotal_kW");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
ngOnInit(): void {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
var responsiveOptions: any[] = [
|
|
var responsiveOptions: any[] = [
|
|
|
['screen and (max-width: 640px)', {
|
|
['screen and (max-width: 640px)', {
|
|
|
seriesBarDistance: 5,
|
|
seriesBarDistance: 5,
|
|
@@ -113,13 +113,13 @@ export class DashboardComponent implements OnInit {
|
|
|
}
|
|
}
|
|
|
}]
|
|
}]
|
|
|
];
|
|
];
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
|
|
|
|
|
|
if (this.listData != undefined){
|
|
if (this.listData != undefined){
|
|
|
this.addMarkers();
|
|
this.addMarkers();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Swal.close();
|
|
Swal.close();
|
|
|
}, 2500);
|
|
}, 2500);
|
|
|
|
|
|
|
@@ -129,7 +129,7 @@ export class DashboardComponent implements OnInit {
|
|
|
return observableOf(this.listData.find(e => e.id === id));
|
|
return observableOf(this.listData.find(e => e.id === id));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
addMarkers() {
|
|
addMarkers() {
|
|
|
let lat, long, address, name2;
|
|
let lat, long, address, name2;
|
|
|
|
|
|
|
@@ -146,7 +146,7 @@ export class DashboardComponent implements OnInit {
|
|
|
address = plant.address;
|
|
address = plant.address;
|
|
|
name2 = plant.name;
|
|
name2 = plant.name;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const newMarker = marker(
|
|
const newMarker = marker(
|
|
|
[lat, long],
|
|
[lat, long],
|
|
|
{icon: this.icon})
|
|
{icon: this.icon})
|
|
@@ -183,15 +183,15 @@ export class DashboardComponent implements OnInit {
|
|
|
}, 0);
|
|
}, 0);
|
|
|
|
|
|
|
|
const bounds = latLngBounds(this.points);
|
|
const bounds = latLngBounds(this.points);
|
|
|
- map.fitBounds(bounds, {
|
|
|
|
|
- padding: point(24, 24),
|
|
|
|
|
- maxZoom: 9.5,
|
|
|
|
|
- animate: true
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ //map.fitBounds(bounds, {
|
|
|
|
|
+ // padding: point(24, 24),
|
|
|
|
|
+ // maxZoom: 9.5,
|
|
|
|
|
+ // animate: true
|
|
|
|
|
+ //});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
goToAsset(id: string){
|
|
goToAsset(id: string){
|
|
|
- this.router.navigate(['/assets'], { queryParams: { id: id } });
|
|
|
|
|
|
|
+ this.router.navigate(['/assets'], { queryParams: { id: id } });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|