diff --git a/src/app/dashboard/dashboard.module.ts b/src/app/dashboard/dashboard.module.ts
index 2d4f415..e312843 100644
--- a/src/app/dashboard/dashboard.module.ts
+++ b/src/app/dashboard/dashboard.module.ts
@@ -21,7 +21,6 @@ import { PayrollLogComponent } from './payroll-log.component';
import { LeaderboardComponent } from './leaderboard.component';
import { MapComponent } from './map.component';
import { TrailMapComponent } from './trail-map.component';
-import { TrailMapComponent2 } from './trail-map-2.component';
import { GraphWidget } from '../widgets/graph-widget.component';
import { OrgBarSnippetComponent } from '../snippets/org-snippet-bar.component';
@@ -69,7 +68,6 @@ import { environment } from '../../environments/environment';
LeaderboardResultComponent,
MapComponent,
TrailMapComponent,
- TrailMapComponent2,
FeedbackComponent,
GraphWidget,
OrgBarSnippetComponent,
diff --git a/src/app/dashboard/dashboard.routing.ts b/src/app/dashboard/dashboard.routing.ts
index 6e481e7..46b9df3 100644
--- a/src/app/dashboard/dashboard.routing.ts
+++ b/src/app/dashboard/dashboard.routing.ts
@@ -16,7 +16,6 @@ import { PayrollLogComponent } from './payroll-log.component';
import { LeaderboardComponent } from './leaderboard.component';
import { MapComponent } from './map.component';
import { TrailMapComponent } from './trail-map.component';
-import { TrailMapComponent2 } from './trail-map-2.component';
// Using child path to allow for FullLayout theming
const routes: Routes = [
@@ -69,11 +68,6 @@ const routes: Routes = [
component: TrailMapComponent,
data: { title: 'Story Trail' },
},
- {
- path: 'story-trail-2',
- component: TrailMapComponent2,
- data: { title: 'Story Trail 2' },
- },
{
path: 'payroll-log',
component: PayrollLogComponent,
diff --git a/src/app/dashboard/map.component.ts b/src/app/dashboard/map.component.ts
index 41ba36e..5af9c41 100644
--- a/src/app/dashboard/map.component.ts
+++ b/src/app/dashboard/map.component.ts
@@ -52,7 +52,7 @@ export class MapComponent implements OnInit {
this.markers = result.suppliers;
},
error => {
- // this.dataReceived = 'no';
+ this.dataReceived = 'no';
console.log('Retrieval Error');
console.log( error._body );
}
diff --git a/src/app/dashboard/trail-map-2.component.html b/src/app/dashboard/trail-map-2.component.html
deleted file mode 100644
index f5835e7..0000000
--- a/src/app/dashboard/trail-map-2.component.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
- No map data received, check your connection.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This is a modal.
-
-
-
-
-
-
-
-
diff --git a/src/app/dashboard/trail-map-2.component.ts b/src/app/dashboard/trail-map-2.component.ts
deleted file mode 100644
index 0019f16..0000000
--- a/src/app/dashboard/trail-map-2.component.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-import { Component, OnInit, Input, Output, EventEmitter, TemplateRef } from '@angular/core';
-import { ApiService } from '../providers/api-service';
-import { AgmCoreModule } from '@agm/core';
-import { BsModalService } from 'ngx-bootstrap/modal';
-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
-import 'rxjs/add/operator/map';
-
-@Component({
- templateUrl: 'trail-map-2.component.html',
-})
-export class TrailMapComponent2 implements OnInit {
-
- lat: number = 54.0466;
- lng: number = -2.8007;
- zoom: number = 12;
- public modalRef: BsModalRef;
- clickedMarker: any;
-
- dataReceived: string = 'yes';
-
- markers: Array<{latitude: number, longitude: number, name: string}>;
-
- map: any;
-
- constructor(
- private api: ApiService,
- private modalService: BsModalService,
- ) {}
-
- ngOnInit(): void { }
-
- public onMapReady(map: any) {
- this.map = map;
- }
-
- openModal(template: TemplateRef) {
- this.modalRef = this.modalService.show(template);
- }
-
- public onMarkerClick(clickedMarker, template: TemplateRef) {
- console.log(clickedMarker);
- this.clickedMarker = clickedMarker;
- this.openModal(template);
- }
-
- public viewBoundsChanged() {
- console.log("finding bounds");
- const resp = this.map.getBounds();
- console.log("found bounds");
- console.log(resp.getNorthEast().lat());
- console.log(resp.getNorthEast().lng());
- console.log(resp.getSouthWest().lat());
- console.log(resp.getSouthWest().lng());
- const mapData = {
- north_east: {
- latitude: resp.getNorthEast().lat(),
- longitude: resp.getNorthEast().lng()
- },
- south_west: {
- latitude: resp.getSouthWest().lat(),
- longitude: resp.getSouthWest().lng()
- },
- }
- this.api.getMapData(mapData).subscribe(
- result => {
- this.dataReceived = 'yes';
- this.markers = result.suppliers;
- },
- error => {
- // this.dataReceived = 'no';
- console.log('Retrieval Error');
- console.log( error._body );
- }
- );
- }
-
-
-
-}
diff --git a/src/app/dashboard/trail-map.component.html b/src/app/dashboard/trail-map.component.html
index 590a6ef..d457e99 100644
--- a/src/app/dashboard/trail-map.component.html
+++ b/src/app/dashboard/trail-map.component.html
@@ -27,18 +27,26 @@
*ngFor="let m of markers"
[iconUrl]="'/assets/img/map-pin-lis.png'"
[latitude]="m.latitude"
- [longitude]="m.longitude">
-
-
- {{m.name}}
-
-
-
+ [longitude]="m.longitude"
+ [openInfoWindow]="false"
+ (markerClick)="onMarkerClick(m, template)">
+
+
+
+
Located at:
+ {{clickedMarker.street_name}}
+ {{clickedMarker.town}}
+ {{clickedMarker.postcode}}
+
+
diff --git a/src/app/dashboard/trail-map.component.ts b/src/app/dashboard/trail-map.component.ts
index 7aed178..b6d2c8b 100644
--- a/src/app/dashboard/trail-map.component.ts
+++ b/src/app/dashboard/trail-map.component.ts
@@ -1,6 +1,8 @@
-import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
+import { Component, OnInit, Input, Output, EventEmitter, TemplateRef } from '@angular/core';
import { ApiService } from '../providers/api-service';
import { AgmCoreModule } from '@agm/core';
+import { BsModalService } from 'ngx-bootstrap/modal';
+import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
import 'rxjs/add/operator/map';
@Component({
@@ -11,6 +13,8 @@ export class TrailMapComponent implements OnInit {
lat: number = 54.0466;
lng: number = -2.8007;
zoom: number = 12;
+ public modalRef: BsModalRef;
+ clickedMarker: any;
dataReceived: string = 'yes';
@@ -20,7 +24,8 @@ export class TrailMapComponent implements OnInit {
constructor(
private api: ApiService,
- ) { }
+ private modalService: BsModalService,
+ ) {}
ngOnInit(): void { }
@@ -28,6 +33,16 @@ export class TrailMapComponent implements OnInit {
this.map = map;
}
+ openModal(template: TemplateRef) {
+ this.modalRef = this.modalService.show(template);
+ }
+
+ public onMarkerClick(clickedMarker, template: TemplateRef) {
+ console.log(clickedMarker);
+ this.clickedMarker = clickedMarker;
+ this.openModal(template);
+ }
+
public viewBoundsChanged() {
console.log("finding bounds");
const resp = this.map.getBounds();
@@ -46,13 +61,13 @@ export class TrailMapComponent implements OnInit {
longitude: resp.getSouthWest().lng()
},
}
- this.api.getMapData(mapData).subscribe(
+ this.api.getLisData(mapData).subscribe(
result => {
this.dataReceived = 'yes';
- this.markers = result.suppliers;
+ this.markers = result.locations;
},
error => {
- // this.dataReceived = 'no';
+ this.dataReceived = 'no';
console.log('Retrieval Error');
console.log( error._body );
}
diff --git a/src/app/layouts/full-layout.component.html b/src/app/layouts/full-layout.component.html
index 101a079..069a864 100644
--- a/src/app/layouts/full-layout.component.html
+++ b/src/app/layouts/full-layout.component.html
@@ -50,11 +50,6 @@
Story Trail
-
-
- Story Trail 2
-
-
Leaderboard
diff --git a/src/app/providers/api-service.ts b/src/app/providers/api-service.ts
index d6ffe18..f4903e9 100644
--- a/src/app/providers/api-service.ts
+++ b/src/app/providers/api-service.ts
@@ -276,6 +276,15 @@ export class ApiService {
);
}
+ // Load LIS Data
+ public getLisData(data) {
+ data.session_key = this.sessionKey;
+ return this.http.post(
+ this.apiUrl + '/v1/supplier/location/lis',
+ data
+ );
+ }
+
// Basic Customer User stats API
public basicStats() {
const key = this.sessionKey;
diff --git a/src/assets/img/lis_logo.png b/src/assets/img/lis_logo.png
new file mode 100644
index 0000000..84b6bbc
Binary files /dev/null and b/src/assets/img/lis_logo.png differ
diff --git a/src/scss/_custom.scss b/src/scss/_custom.scss
index f3e9c04..269a40a 100644
--- a/src/scss/_custom.scss
+++ b/src/scss/_custom.scss
@@ -20,6 +20,10 @@ agm-map {
height: 75vh;
}
+.w-15 {
+ width: 15%;
+}
+
// white title font variant on type-2 as defined in _widgets.css
.horizontal-bars {
padding: 0;