Click here to Skip to main content
15,886,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Currently i'm working on pagination and showing agm-maps in a project. And the problem is that the ngx-pagination is not working if i click the icon with a click event attached to it. don't know where i'm going wron can somebody help me with this.

What I have tried:

Here is the Html part:


HTML
<pre lang="HTML">





<mat-icon>cancel







.


<mat-card style="width: 100%; height: auto;">




Stop No: Stop Address Stop Time Stop Duration Map
{{i+1}} #314, JP Nagar, Whitefield. {{row?.end_time }}
<ng-template #row0=""> {{date1}}
{{row?.stoppage_time}} Mins




<pagination-controls (pagechange)="p=$event">












<mat-card id="MyDiv" style="width: 100%;">


<agm-map style="width: 100%; height: 100vh;" [latitude]="12.2602" [zoom]="5" [longitude]="77.1461">
<agm-marker-cluster>
<agm-marker *ngfor="let marker of latAndLong1" [latitude]="marker.start_latitude" [longitude]="marker.start_longitude">














        


        


        


        


        


        








<mat-dialog-actions>


Close






here is the typescript part:

TypeScript

myFunc() {
    this.x = document.getElementById('hideDiv');
    this.y = document.getElementById('myDiv');


    if (this.y.style.display == 'none') {
      // this.x.style.display='none';
      this.y.style.display = 'block';

    } else {
      this.x.style.display = 'block';
      this.y.style.display = 'none';
    }
  }


  mapPopup(Event: any): void {
 //  if(!this.userDetails){
  this.data = {
    company_id : 166,
    vehicle_id : 1242
  };
 /* }else{
  this.data02 = {
     "company_id": this.userDetails.company_id,
     "vehicle_id" : this.userDetails.vehicle_id

      }
  }*/

 // console.log(this.data, '>>>>>', this.userDetails);
  this.dashboardService.getTotalFleetPopup(this.data).subscribe(item => {
console.log('item is populated>>>>', item);
this.responseData = item;
// this.date1= new(this.responseData.stoppage_details.end_time);
// tslint:disable-next-line:max-line-length
// console.log(this.responseData.stoppage_details[0].start_longitude, '<<<<how is the lat and long', this.responseData.stoppage_details[0].start_latitude);
this.responseData.stoppage_details.forEach((latAndLong: any) => {
  this.lat = latAndLong.start_latitude;
  this.long = latAndLong.start_longitude;
  this.zoom = 4;
  this.latAndLong1 = Array(latAndLong);
  console.log('lat', latAndLong);
  // console.log('long', this.long);
  // tslint:disable-next-line:no-unused-expression
  return this.lat, this.long, this.zoom;
});
console.log(this.long, 'long', this.lat);

// console.log('resp>>>>>', this.responseData.stoppage_details);



});

  }
Posted
Updated 21-Apr-22 9:03am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900