changed code for trail map
This commit is contained in:
parent
4428cd6fcd
commit
0cc3a473cf
5 changed files with 16 additions and 7 deletions
|
@ -5,6 +5,10 @@
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<strong>Lancaster Independent Story</strong>
|
<strong>Lancaster Independent Story</strong>
|
||||||
<small>Required Data marked in <strong>bold</strong>.</small>
|
<small>Required Data marked in <strong>bold</strong>.</small>
|
||||||
|
<select type="text" [(ngModel)]="assocMap" (ngModelChange)="viewBoundsChanged()">
|
||||||
|
<option value="lis" selected>Lancaster Independent Story</option>
|
||||||
|
<option value="esta">Esta</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal fade" bsModal #statusModal="bs-modal" [config]="{backdrop: false, animated: false}"
|
<div class="modal fade" bsModal #statusModal="bs-modal" [config]="{backdrop: false, animated: false}"
|
||||||
tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||||
|
@ -45,7 +49,7 @@
|
||||||
<agm-marker-cluster maxZoom="13" imagePath="https://raw.githubusercontent.com/googlemaps/v3-utility-library/master/markerclustererplus/images/m">
|
<agm-marker-cluster maxZoom="13" imagePath="https://raw.githubusercontent.com/googlemaps/v3-utility-library/master/markerclustererplus/images/m">
|
||||||
<agm-marker
|
<agm-marker
|
||||||
*ngFor="let m of markers"
|
*ngFor="let m of markers"
|
||||||
[iconUrl]="'/assets/img/map-pin-lis.png'"
|
[iconUrl]="'/assets/img/association/' + assocMap + '-map-pin.png'"
|
||||||
[latitude]="m.latitude"
|
[latitude]="m.latitude"
|
||||||
[longitude]="m.longitude"
|
[longitude]="m.longitude"
|
||||||
[openInfoWindow]="false"
|
[openInfoWindow]="false"
|
||||||
|
@ -55,7 +59,7 @@
|
||||||
</agm-map>
|
</agm-map>
|
||||||
<ng-template #template>
|
<ng-template #template>
|
||||||
<div class="modal-header d-flex justify-content-between">
|
<div class="modal-header d-flex justify-content-between">
|
||||||
<img src="assets/img/lis_logo.png" class="w-15" alt="lis logo"><h4 class="modal-title">{{clickedMarker.name}}</h4>
|
<img src="{{assocLogo}}" class="w-15" alt="lis logo"><h4 class="modal-title">{{clickedMarker.name}}</h4>
|
||||||
<button type="button" class="close pull-right" aria-label="Close" (click)="modalRef.hide()">
|
<button type="button" class="close pull-right" aria-label="Close" (click)="modalRef.hide()">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -15,6 +15,8 @@ export class TrailMapComponent implements OnInit, AfterViewInit {
|
||||||
zoom: number = 12;
|
zoom: number = 12;
|
||||||
public modalRef: BsModalRef;
|
public modalRef: BsModalRef;
|
||||||
clickedMarker: any;
|
clickedMarker: any;
|
||||||
|
assocMap = 'lis';
|
||||||
|
assocLogo: string;
|
||||||
|
|
||||||
dataReceived: string = 'loading';
|
dataReceived: string = 'loading';
|
||||||
|
|
||||||
|
@ -25,7 +27,9 @@ export class TrailMapComponent implements OnInit, AfterViewInit {
|
||||||
constructor(
|
constructor(
|
||||||
private api: ApiService,
|
private api: ApiService,
|
||||||
private modalService: BsModalService,
|
private modalService: BsModalService,
|
||||||
) {}
|
) {
|
||||||
|
this.assocLogo = 'assets/img/association/' + this.assocMap + '_logo.png';
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit(): void { }
|
ngOnInit(): void { }
|
||||||
|
|
||||||
|
@ -64,8 +68,9 @@ export class TrailMapComponent implements OnInit, AfterViewInit {
|
||||||
latitude: resp.getSouthWest().lat(),
|
latitude: resp.getSouthWest().lat(),
|
||||||
longitude: resp.getSouthWest().lng()
|
longitude: resp.getSouthWest().lng()
|
||||||
},
|
},
|
||||||
|
association: this.assocMap,
|
||||||
}
|
}
|
||||||
this.api.getLisData(mapData).subscribe(
|
this.api.getAssocData(mapData).subscribe(
|
||||||
result => {
|
result => {
|
||||||
this.myStatusModal.hide();
|
this.myStatusModal.hide();
|
||||||
this.markers = result.locations;
|
this.markers = result.locations;
|
||||||
|
|
|
@ -276,11 +276,11 @@ export class ApiService {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load LIS Data
|
// Load Association Data
|
||||||
public getLisData(data) {
|
public getAssocData(data) {
|
||||||
data.session_key = this.sessionKey;
|
data.session_key = this.sessionKey;
|
||||||
return this.http.post<any>(
|
return this.http.post<any>(
|
||||||
this.apiUrl + '/v1/supplier/location/lis',
|
this.apiUrl + '/v1/supplier/location/trail',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 260 KiB After Width: | Height: | Size: 260 KiB |
Reference in a new issue