@aggdirect/coolmap-services 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, Component, NgModule } from '@angular/core';
3
1
  import { __awaiter } from 'tslib';
2
+ import * as i0 from '@angular/core';
3
+ import { Injectable } from '@angular/core';
4
4
  import * as mapboxgl from 'mapbox-gl';
5
5
  import * as turf from '@turf/turf';
6
6
  import { BehaviorSubject } from 'rxjs';
@@ -10,471 +10,421 @@ import * as i1 from '@angular/common/http';
10
10
  import * as i2 from '@angular/material/snack-bar';
11
11
  import * as i2$1 from '@angular/platform-browser';
12
12
 
13
- class CoolmapServicesService {
14
- constructor() { }
15
- }
16
- CoolmapServicesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapServicesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
17
- CoolmapServicesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapServicesService, providedIn: 'root' });
18
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapServicesService, decorators: [{
19
- type: Injectable,
20
- args: [{
21
- providedIn: 'root'
22
- }]
23
- }], ctorParameters: function () { return []; } });
24
-
25
- class CoolmapServicesComponent {
26
- constructor() { }
27
- ngOnInit() {
28
- }
29
- }
30
- CoolmapServicesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapServicesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
31
- CoolmapServicesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CoolmapServicesComponent, selector: "lib-coolmap-services", ngImport: i0, template: `
32
- <p>
33
- coolmap-services works!
34
- </p>
35
- `, isInline: true });
36
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapServicesComponent, decorators: [{
37
- type: Component,
38
- args: [{ selector: 'lib-coolmap-services', template: `
39
- <p>
40
- coolmap-services works!
41
- </p>
42
- ` }]
43
- }], ctorParameters: function () { return []; } });
44
-
45
- class CoolmapServicesModule {
46
- }
47
- CoolmapServicesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapServicesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
48
- CoolmapServicesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: CoolmapServicesModule, declarations: [CoolmapServicesComponent], exports: [CoolmapServicesComponent] });
49
- CoolmapServicesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapServicesModule });
50
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapServicesModule, decorators: [{
51
- type: NgModule,
52
- args: [{
53
- declarations: [
54
- CoolmapServicesComponent
55
- ],
56
- imports: [],
57
- exports: [
58
- CoolmapServicesComponent
59
- ]
60
- }]
61
- }] });
62
-
63
- class UtilsService {
64
- constructor(http, snackBar) {
65
- this.http = http;
66
- this.snackBar = snackBar;
67
- this.analyticsRESTURL = '';
68
- this.RESTURLPrefix = '';
69
- this.pickupOptions = [];
70
- this.destOptions = [];
71
- this.ownerOptions = [];
72
- this.customerOptions = [];
73
- this.unitOptions = [];
74
- this.materialOptions = [];
75
- this.jcodeOptions = [];
76
- this.driverOption = [];
77
- this.truckingCompanayOption = [];
78
- this.routeNameOptions = [];
79
- this.preventnavChange = new BehaviorSubject(false);
80
- this.navChangeObserve = this.preventnavChange.asObservable();
81
- this.clearViewRouteforJobCode = new BehaviorSubject(false);
82
- this.clearViewRouteforJobCodeObserve = this.clearViewRouteforJobCode.asObservable();
83
- this.preVentJobdetailclose = new BehaviorSubject(false);
84
- this.getpreVentJobdetailclose = this.preVentJobdetailclose.asObservable();
85
- this.routeDetailsUtility = new BehaviorSubject({});
86
- this.getrouteDetailsUtility = this.routeDetailsUtility.asObservable();
87
- this.removeMapEntity = new BehaviorSubject({});
88
- this.removeMapEntityUtility = this.removeMapEntity.asObservable();
89
- this.dict = new Map();
90
- this.analyticsRESTURL = 'https://test-analytics.aggdirect.com/REST/';
91
- this.RESTURLPrefix = 'https://test-server.aggdirect.com/REST/';
92
- }
93
- getDateFormat(strVal, seprater) {
94
- seprater = seprater ? seprater : '-';
95
- const mydate = strVal;
96
- return (mydate === null || mydate === void 0 ? void 0 : mydate.getFullYear()) + seprater + ((mydate ? mydate.getMonth() : 0) + 1) + seprater + (mydate === null || mydate === void 0 ? void 0 : mydate.getDate());
97
- }
98
- getData(path) { return this.http.get(`${this.analyticsRESTURL}${path}`); }
99
- postdata(path, data) { return this.http.post(`${this.analyticsRESTURL}${path}`, data); }
100
- postDataWithRestUrl(path, data) { return this.http.post(`${this.RESTURLPrefix}${path}`, data); }
101
- fetchAutoCompleteLocations(keyword) {
102
- return this.http.get(`https://api.mapbox.com/geocoding/v5/mapbox.places/${keyword}.json?access_token=pk.eyJ1Ijoic2FudGFudS1vZ21hIiwiYSI6ImNsOGQ0cDVrNjAweTMzb3RmdG9ieTU5ZDkifQ.I6ZS7mViZYSvBo4zz-mGQQ&country=US`);
103
- }
104
- openSnackBar(message, className) {
105
- this.snackBar.open(message, '', {
106
- duration: 5000, verticalPosition: 'top', horizontalPosition: 'center', panelClass: [className ? className : 'default']
107
- });
108
- }
109
- makeOptions(item) {
110
- var _a;
111
- if (item.order_number) {
112
- (this.jcodeOptions.findIndex((elem) => elem.job_id === item.job_id) === -1) ? this.jcodeOptions.push({ job_code: item.order_number, job_id: item.job_id }) : null;
113
- if (item.driver_list && ((_a = item.driver_list) === null || _a === void 0 ? void 0 : _a.length) > 0) {
114
- item.driver_list.forEach((driver) => {
115
- this.driverOption.findIndex(elem => elem === driver['driver_name']) === -1 ? this.driverOption.push(driver['driver_name']) : null;
116
- this.truckingCompanayOption.findIndex(elem => elem === driver['trucking_company']) === -1 ? this.truckingCompanayOption.push(driver['trucking_company']) : null;
117
- });
118
- }
119
- }
120
- ((this.pickupOptions.findIndex((elem) => elem === item.pickup_location)) === -1) ? this.pickupOptions.push(item.pickup_location) : null;
121
- ((this.destOptions.findIndex((elem) => elem === item.delivery_location)) === -1) ? this.destOptions.push(item.delivery_location) : null;
122
- (this.customerOptions.findIndex((customer) => customer === item.customer_name) === -1) ? this.customerOptions.push(item.customer_name) : null;
123
- (this.unitOptions.findIndex((elem) => elem === item.unit) === -1) ? this.unitOptions.push(item.unit) : null;
124
- (this.materialOptions.findIndex((elem) => elem === item.material) === -1) ? this.materialOptions.push(item.material) : null;
125
- if (item.route_name)
126
- this.routeNameOptions.findIndex(elem => elem === item.route_name) === -1 ? this.routeNameOptions.push(item.route_name) : null;
127
- }
128
- filter(value, filters) {
129
- if (typeof value !== 'string') {
130
- return [];
131
- }
132
- const filterValue = value.toLowerCase();
133
- if (filterValue === '') {
134
- return [];
135
- }
136
- const searchResults = [];
137
- this.unitOptions.map(unit => {
138
- if (unit.toLowerCase().includes(filterValue)) {
139
- searchResults.push({ "type": "unit", "label": unit, "value": unit });
140
- }
141
- });
142
- this.customerOptions.map(unit => {
143
- if (unit.toLowerCase().includes(filterValue)) {
144
- searchResults.push({ "type": "customer", "label": unit, "value": unit });
145
- }
146
- });
147
- this.materialOptions.map(unit => {
148
- if (unit.toLowerCase().includes(filterValue)) {
149
- searchResults.push({ "type": "material", "label": unit, "value": unit });
150
- }
151
- });
152
- this.pickupOptions.map(unit => {
153
- if (unit.toLowerCase().includes(filterValue)) {
154
- searchResults.push({ "type": "pickup location", "label": unit, "value": unit });
155
- }
156
- });
157
- this.destOptions.map(unit => {
158
- if (unit.toLowerCase().includes(filterValue)) {
159
- searchResults.push({ "type": "destination location", "label": unit, "value": unit });
160
- }
161
- });
162
- this.jcodeOptions.map(unit => {
163
- if (unit.job_code.toLowerCase().includes(filterValue)) {
164
- searchResults.push({ "type": "job", "label": unit['job_code'], "value": unit });
165
- }
166
- });
167
- this.driverOption.map(unit => {
168
- if (unit.toLowerCase().includes(filterValue)) {
169
- searchResults.push({ "type": "Driver", "label": unit, "value": unit });
170
- }
171
- });
172
- this.truckingCompanayOption.map(unit => {
173
- if (unit.toLowerCase().includes(filterValue)) {
174
- searchResults.push({ "type": "Trucking Company", "label": unit, "value": unit });
175
- }
176
- });
177
- this.routeNameOptions.map(unit => {
178
- if (unit.toLowerCase().includes(filterValue)) {
179
- searchResults.push({ "type": "Route name", "label": unit, "value": unit });
180
- }
181
- });
182
- const searchDict = {};
183
- filters.map((filter) => {
184
- searchDict[filter['name'] + filter['type']] = filter;
185
- });
186
- const furtherFilter = [];
187
- searchResults.map(search => {
188
- if ((search['label'] + search['type']) in searchDict) { }
189
- else {
190
- furtherFilter.push(search);
191
- }
192
- });
193
- return furtherFilter;
194
- }
195
- getSearchResults(list, filterval) {
196
- return list.filter(element => {
197
- var _a, _b;
198
- const result_list_boolean = [];
199
- if (filterval.length > 0) {
200
- if (filterval[0]['type'] === 'unit') {
201
- result_list_boolean.push(filterval[0]['name'] === element[filterval[0]['type']]);
202
- }
203
- if (filterval[0]['type'] === 'customer') {
204
- result_list_boolean.push(filterval[0]['name'] === element['customer_name']);
205
- }
206
- if (filterval[0]['type'] === 'material') {
207
- result_list_boolean.push(filterval[0]['name'] === element[filterval[0]['type']]);
208
- }
209
- if (filterval[0]['type'] === 'pickup location') {
210
- result_list_boolean.push(filterval[0]['name'] === element['pickup_location']);
211
- }
212
- if (filterval[0]['type'] === 'destination location') {
213
- result_list_boolean.push(filterval[0]['name'] === element['delivery_location']);
214
- }
215
- if (filterval[0]['type'] === 'job') {
216
- result_list_boolean.push(filterval[0]['name'] === element['order_number']);
217
- }
218
- if (filterval[0]['type'] === 'Route name') {
219
- result_list_boolean.push(filterval[0]['name'] === element['route_name']);
220
- }
221
- if (filterval[0]['type'] === 'Driver') {
222
- const index = (_a = element.driver_list) === null || _a === void 0 ? void 0 : _a.findIndex(ele => { return filterval[0]['name'] === ele['driver_name']; });
223
- if (index !== -1)
224
- result_list_boolean.push(true);
225
- }
226
- if (filterval[0]['type'] === 'Trucking Company') {
227
- const index = (_b = element.driver_list) === null || _b === void 0 ? void 0 : _b.findIndex(ele => { return filterval[0]['name'] === ele['trucking_company']; });
228
- if (index !== -1)
229
- result_list_boolean.push(true);
230
- }
231
- }
232
- if (result_list_boolean.length > 0) {
233
- return result_list_boolean.reduce((prev, curr) => prev && curr);
234
- }
235
- return false;
236
- });
237
- }
238
- clearOptions() {
239
- this.pickupOptions = [];
240
- this.destOptions = [];
241
- this.ownerOptions = [];
242
- this.customerOptions = [];
243
- this.unitOptions = [];
244
- this.materialOptions = [];
245
- this.jcodeOptions = [];
246
- this.routeNameOptions = [];
247
- }
248
- setdictValue(key, value) {
249
- this.dict.set(key, value);
250
- }
251
- getdictValue(key) {
252
- return JSON.parse(this.dict.get(key));
253
- }
254
- removedictValue(key) {
255
- this.dict.delete(key);
256
- }
257
- conveySearchIcon(value) {
258
- if (value && typeof (value) !== 'object')
259
- return true;
260
- return false;
261
- }
262
- }
263
- UtilsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: UtilsService, deps: [{ token: i1.HttpClient }, { token: i2.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
264
- UtilsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: UtilsService, providedIn: 'root' });
265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: UtilsService, decorators: [{
266
- type: Injectable,
267
- args: [{ providedIn: 'root' }]
13
+ class UtilsService {
14
+ constructor(http, snackBar) {
15
+ this.http = http;
16
+ this.snackBar = snackBar;
17
+ this.analyticsRESTURL = '';
18
+ this.RESTURLPrefix = '';
19
+ this.pickupOptions = [];
20
+ this.destOptions = [];
21
+ this.ownerOptions = [];
22
+ this.customerOptions = [];
23
+ this.unitOptions = [];
24
+ this.materialOptions = [];
25
+ this.jcodeOptions = [];
26
+ this.driverOption = [];
27
+ this.truckingCompanayOption = [];
28
+ this.routeNameOptions = [];
29
+ this.preventnavChange = new BehaviorSubject(false);
30
+ this.navChangeObserve = this.preventnavChange.asObservable();
31
+ this.clearViewRouteforJobCode = new BehaviorSubject(false);
32
+ this.clearViewRouteforJobCodeObserve = this.clearViewRouteforJobCode.asObservable();
33
+ this.preVentJobdetailclose = new BehaviorSubject(false);
34
+ this.getpreVentJobdetailclose = this.preVentJobdetailclose.asObservable();
35
+ this.routeDetailsUtility = new BehaviorSubject({});
36
+ this.getrouteDetailsUtility = this.routeDetailsUtility.asObservable();
37
+ this.removeMapEntity = new BehaviorSubject({});
38
+ this.removeMapEntityUtility = this.removeMapEntity.asObservable();
39
+ this.dict = new Map();
40
+ this.analyticsRESTURL = 'https://test-analytics.aggdirect.com/REST/';
41
+ this.RESTURLPrefix = 'https://test-server.aggdirect.com/REST/';
42
+ }
43
+ getDateFormat(strVal, seprater) {
44
+ seprater = seprater ? seprater : '-';
45
+ const mydate = strVal;
46
+ return (mydate === null || mydate === void 0 ? void 0 : mydate.getFullYear()) + seprater + ((mydate ? mydate.getMonth() : 0) + 1) + seprater + (mydate === null || mydate === void 0 ? void 0 : mydate.getDate());
47
+ }
48
+ getData(path) { return this.http.get(`${this.analyticsRESTURL}${path}`); }
49
+ postdata(path, data) { return this.http.post(`${this.analyticsRESTURL}${path}`, data); }
50
+ postDataWithRestUrl(path, data) { return this.http.post(`${this.RESTURLPrefix}${path}`, data); }
51
+ fetchAutoCompleteLocations(keyword) {
52
+ return this.http.get(`https://api.mapbox.com/geocoding/v5/mapbox.places/${keyword}.json?access_token=pk.eyJ1Ijoic2FudGFudS1vZ21hIiwiYSI6ImNsOGQ0cDVrNjAweTMzb3RmdG9ieTU5ZDkifQ.I6ZS7mViZYSvBo4zz-mGQQ&country=US`);
53
+ }
54
+ openSnackBar(message, className) {
55
+ this.snackBar.open(message, '', {
56
+ duration: 5000, verticalPosition: 'top', horizontalPosition: 'center', panelClass: [className ? className : 'default']
57
+ });
58
+ }
59
+ makeOptions(item) {
60
+ var _a;
61
+ if (item.order_number) {
62
+ (this.jcodeOptions.findIndex((elem) => elem.job_id === item.job_id) === -1) ? this.jcodeOptions.push({ job_code: item.order_number, job_id: item.job_id }) : null;
63
+ if (item.driver_list && ((_a = item.driver_list) === null || _a === void 0 ? void 0 : _a.length) > 0) {
64
+ item.driver_list.forEach((driver) => {
65
+ this.driverOption.findIndex(elem => elem === driver['driver_name']) === -1 ? this.driverOption.push(driver['driver_name']) : null;
66
+ this.truckingCompanayOption.findIndex(elem => elem === driver['trucking_company']) === -1 ? this.truckingCompanayOption.push(driver['trucking_company']) : null;
67
+ });
68
+ }
69
+ }
70
+ ((this.pickupOptions.findIndex((elem) => elem === item.pickup_location)) === -1) ? this.pickupOptions.push(item.pickup_location) : null;
71
+ ((this.destOptions.findIndex((elem) => elem === item.delivery_location)) === -1) ? this.destOptions.push(item.delivery_location) : null;
72
+ (this.customerOptions.findIndex((customer) => customer === item.customer_name) === -1) ? this.customerOptions.push(item.customer_name) : null;
73
+ (this.unitOptions.findIndex((elem) => elem === item.unit) === -1) ? this.unitOptions.push(item.unit) : null;
74
+ (this.materialOptions.findIndex((elem) => elem === item.material) === -1) ? this.materialOptions.push(item.material) : null;
75
+ if (item.route_name)
76
+ this.routeNameOptions.findIndex(elem => elem === item.route_name) === -1 ? this.routeNameOptions.push(item.route_name) : null;
77
+ }
78
+ filter(value, filters) {
79
+ if (typeof value !== 'string') {
80
+ return [];
81
+ }
82
+ const filterValue = value.toLowerCase();
83
+ if (filterValue === '') {
84
+ return [];
85
+ }
86
+ const searchResults = [];
87
+ this.unitOptions.map(unit => {
88
+ if (unit.toLowerCase().includes(filterValue)) {
89
+ searchResults.push({ "type": "unit", "label": unit, "value": unit });
90
+ }
91
+ });
92
+ this.customerOptions.map(unit => {
93
+ if (unit.toLowerCase().includes(filterValue)) {
94
+ searchResults.push({ "type": "customer", "label": unit, "value": unit });
95
+ }
96
+ });
97
+ this.materialOptions.map(unit => {
98
+ if (unit.toLowerCase().includes(filterValue)) {
99
+ searchResults.push({ "type": "material", "label": unit, "value": unit });
100
+ }
101
+ });
102
+ this.pickupOptions.map(unit => {
103
+ if (unit.toLowerCase().includes(filterValue)) {
104
+ searchResults.push({ "type": "pickup location", "label": unit, "value": unit });
105
+ }
106
+ });
107
+ this.destOptions.map(unit => {
108
+ if (unit.toLowerCase().includes(filterValue)) {
109
+ searchResults.push({ "type": "destination location", "label": unit, "value": unit });
110
+ }
111
+ });
112
+ this.jcodeOptions.map(unit => {
113
+ if (unit.job_code.toLowerCase().includes(filterValue)) {
114
+ searchResults.push({ "type": "job", "label": unit['job_code'], "value": unit });
115
+ }
116
+ });
117
+ this.driverOption.map(unit => {
118
+ if (unit.toLowerCase().includes(filterValue)) {
119
+ searchResults.push({ "type": "Driver", "label": unit, "value": unit });
120
+ }
121
+ });
122
+ this.truckingCompanayOption.map(unit => {
123
+ if (unit.toLowerCase().includes(filterValue)) {
124
+ searchResults.push({ "type": "Trucking Company", "label": unit, "value": unit });
125
+ }
126
+ });
127
+ this.routeNameOptions.map(unit => {
128
+ if (unit.toLowerCase().includes(filterValue)) {
129
+ searchResults.push({ "type": "Route name", "label": unit, "value": unit });
130
+ }
131
+ });
132
+ const searchDict = {};
133
+ filters.map((filter) => {
134
+ searchDict[filter['name'] + filter['type']] = filter;
135
+ });
136
+ const furtherFilter = [];
137
+ searchResults.map(search => {
138
+ if ((search['label'] + search['type']) in searchDict) { }
139
+ else {
140
+ furtherFilter.push(search);
141
+ }
142
+ });
143
+ return furtherFilter;
144
+ }
145
+ getSearchResults(list, filterval) {
146
+ return list.filter(element => {
147
+ var _a, _b;
148
+ const result_list_boolean = [];
149
+ if (filterval.length > 0) {
150
+ if (filterval[0]['type'] === 'unit') {
151
+ result_list_boolean.push(filterval[0]['name'] === element[filterval[0]['type']]);
152
+ }
153
+ if (filterval[0]['type'] === 'customer') {
154
+ result_list_boolean.push(filterval[0]['name'] === element['customer_name']);
155
+ }
156
+ if (filterval[0]['type'] === 'material') {
157
+ result_list_boolean.push(filterval[0]['name'] === element[filterval[0]['type']]);
158
+ }
159
+ if (filterval[0]['type'] === 'pickup location') {
160
+ result_list_boolean.push(filterval[0]['name'] === element['pickup_location']);
161
+ }
162
+ if (filterval[0]['type'] === 'destination location') {
163
+ result_list_boolean.push(filterval[0]['name'] === element['delivery_location']);
164
+ }
165
+ if (filterval[0]['type'] === 'job') {
166
+ result_list_boolean.push(filterval[0]['name'] === element['order_number']);
167
+ }
168
+ if (filterval[0]['type'] === 'Route name') {
169
+ result_list_boolean.push(filterval[0]['name'] === element['route_name']);
170
+ }
171
+ if (filterval[0]['type'] === 'Driver') {
172
+ const index = (_a = element.driver_list) === null || _a === void 0 ? void 0 : _a.findIndex(ele => { return filterval[0]['name'] === ele['driver_name']; });
173
+ if (index !== -1)
174
+ result_list_boolean.push(true);
175
+ }
176
+ if (filterval[0]['type'] === 'Trucking Company') {
177
+ const index = (_b = element.driver_list) === null || _b === void 0 ? void 0 : _b.findIndex(ele => { return filterval[0]['name'] === ele['trucking_company']; });
178
+ if (index !== -1)
179
+ result_list_boolean.push(true);
180
+ }
181
+ }
182
+ if (result_list_boolean.length > 0) {
183
+ return result_list_boolean.reduce((prev, curr) => prev && curr);
184
+ }
185
+ return false;
186
+ });
187
+ }
188
+ clearOptions() {
189
+ this.pickupOptions = [];
190
+ this.destOptions = [];
191
+ this.ownerOptions = [];
192
+ this.customerOptions = [];
193
+ this.unitOptions = [];
194
+ this.materialOptions = [];
195
+ this.jcodeOptions = [];
196
+ this.routeNameOptions = [];
197
+ }
198
+ setdictValue(key, value) {
199
+ this.dict.set(key, value);
200
+ }
201
+ getdictValue(key) {
202
+ return JSON.parse(this.dict.get(key));
203
+ }
204
+ removedictValue(key) {
205
+ this.dict.delete(key);
206
+ }
207
+ conveySearchIcon(value) {
208
+ if (value && typeof (value) !== 'object')
209
+ return true;
210
+ return false;
211
+ }
212
+ }
213
+ UtilsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: UtilsService, deps: [{ token: i1.HttpClient }, { token: i2.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
214
+ UtilsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: UtilsService, providedIn: 'root' });
215
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: UtilsService, decorators: [{
216
+ type: Injectable,
217
+ args: [{ providedIn: 'root' }]
268
218
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.MatSnackBar }]; } });
269
219
 
270
- class CoolmapService {
271
- constructor(utils, eventManager) {
272
- this.utils = utils;
273
- this.eventManager = eventManager;
274
- this.markerOriginList = [];
275
- this.markerDestinationList = [];
276
- this.initiatecoolmap = new BehaviorSubject(true);
277
- this.reintiatecoolmap = this.initiatecoolmap.asObservable();
278
- this.bounds = new mapboxgl.LngLatBounds();
279
- this.originDestinationCordinates = [];
280
- this.eventManager.addGlobalEventListener('window', 'resize', this.onResize.bind(this));
281
- this.windowActualHeightWidth = { availHeight: 0 };
282
- }
283
- initiateMapForAddRoute(el) {
284
- return new Promise((resolve, reject) => {
285
- this.map = new mapboxgl.Map({
286
- accessToken: 'pk.eyJ1Ijoic2FudGFudS1vZ21hIiwiYSI6ImNsOGQ0cDVrNjAweTMzb3RmdG9ieTU5ZDkifQ.I6ZS7mViZYSvBo4zz-mGQQ',
287
- container: el,
288
- style: 'mapbox://styles/santanu-ogma/cl8ep33uz003414n1twlosz9d',
289
- center: [-77.036873, 38.907192],
290
- zoom: 10, bearing: 0, pitch: 65, interactive: true,
291
- });
292
- this.map.once('load', (res) => {
293
- resolve(res);
294
- });
295
- });
296
- }
297
- // Below method Load route with animation
298
- loadMapProperty(pinRouteGeojson, index, unit, route, bottom) {
299
- return new Promise((resolve, reject) => {
300
- let origin = pinRouteGeojson.features[0].geometry.coordinates[0];
301
- const linecolor = (unit === 'Ton') ? '#ff7272' : (unit === 'Load') ? '#a3c52e' : '#ae23d1';
302
- let destination = pinRouteGeojson.features[0].geometry.coordinates[pinRouteGeojson.features[0].geometry.coordinates.length - 1];
303
- this.extendBound(pinRouteGeojson.features[0].geometry.coordinates, true).then((res) => {
304
- const point = {
305
- 'type': 'FeatureCollection',
306
- 'features': [
307
- { 'type': 'Feature', 'properties': {}, 'geometry': { 'type': 'Point', 'coordinates': origin } }
308
- ]
309
- };
310
- const lineDistance = turf.length(pinRouteGeojson.features[0]);
311
- const arc = [];
312
- const steps = 10 * pinRouteGeojson.features[0].geometry.coordinates.length;
313
- for (let i = 0; i < lineDistance; i += lineDistance / steps) {
314
- const segment = turf.along(pinRouteGeojson.features[0], i);
315
- arc.push(segment.geometry.coordinates);
316
- }
317
- pinRouteGeojson.features[0].geometry.coordinates = arc;
318
- const pinRoute = pinRouteGeojson.features[0].geometry.coordinates;
319
- const marker = new mapboxgl.Marker(document.createElement('div'))
320
- .setLngLat(pinRoute[0]).addTo(this.map).togglePopup();
321
- if (this.map.getSource(`line${index}`)) {
322
- this.removeRouteAndMarker(index).then(() => { });
323
- }
324
- this.map.addSource(`line${index}`, { type: 'geojson', lineMetrics: true, data: pinRouteGeojson });
325
- this.map.addLayer({
326
- type: 'line',
327
- source: `line${index}`,
328
- id: `line${index}`,
329
- paint: {
330
- 'line-width': 2,
331
- 'line-gradient': [
332
- 'interpolate',
333
- ['linear'],
334
- ['line-progress'],
335
- 0, unit === 'Ton' ? '#d7f7e4' : unit === 'Load' ? '#c9d8f5' : '#f5dcc1',
336
- 1, unit === 'Ton' ? '#ff7272' : unit === 'Load' ? '#a3c52e' : '#ae23d1',
337
- ]
338
- },
339
- layout: { 'line-cap': 'round', 'line-join': 'round' }
340
- });
341
- const dataSetForMap = {
342
- counter: 0, pinRouteGeojson, steps,
343
- point, pointId: `point${index}`,
344
- marker, pinRoute, lineId: `line${index}`, index,
345
- origin, destination, lineDistance,
346
- linecolor, route, isViewRoute: true
347
- };
348
- this.createMarker(dataSetForMap);
349
- this.map.on('mouseenter', `line${index}`, (e) => {
350
- this.map.setPaintProperty(`line${index}`, 'line-width', 5);
351
- this.map.setPaintProperty(`line${index}`, 'line-opacity', 1);
352
- const datasetForPopup = {
353
- coordinate: [e.lngLat.lng, e.lngLat.lat],
354
- pickup: route.pickup_location ? route.pickup_location : '',
355
- drop: route.delivery_location ? route.delivery_location : '',
356
- routeType: route.project ? 'Project' : 'Route',
357
- title: route.project ? route.project : route.route_name ? route.route_name : '',
358
- material: route.material ? route.material : '',
359
- type: route.unit ? route.unit : ''
360
- };
361
- this.createPopup(datasetForPopup);
362
- });
363
- this.map.on('mouseleave', `line${index}`, (e) => {
364
- this.map.setPaintProperty(`line${index}`, 'line-width', 2);
365
- if (this.popup) {
366
- this.popup.remove();
367
- }
368
- });
369
- });
370
- this.map.once('idle', (res) => {
371
- resolve(true);
372
- });
373
- });
374
- }
375
- // Below method Load route without animation
376
- drawLine(cordinates, index, route, enablefitbound, routeType) {
377
- let linecolor;
378
- let origin = cordinates[0];
379
- let destination = cordinates[cordinates.length - 1];
380
- if (origin[0] && origin[1] && destination && destination[0] && destination[1]) {
381
- linecolor = this.provideLineColor(route['unit'], routeType);
382
- if (enablefitbound) {
383
- const padding = {
384
- top: this.padding.top, bottom: this.padding.bottom + (this.windowActualHeightWidth.availHeight - (window.innerHeight - 65)),
385
- left: this.padding.left, right: this.padding.right
386
- };
387
- this.map.fitBounds([origin, destination], { padding }, { fitboundCompleteJob: true });
388
- }
389
- if (this.map.getSource(`route-source-for-job-code${index}`)) {
390
- this.removeRouteAndMarker(index).then(() => { });
391
- }
392
- this.map.addSource(`route-source-for-job-code${index}`, {
393
- 'type': 'geojson',
394
- 'data': { 'type': 'Feature', 'properties': {}, 'geometry': { 'type': 'LineString', 'coordinates': cordinates } }
395
- });
396
- this.map.addLayer({
397
- 'id': `route-for-job-code${index}`, 'type': 'line', 'source': `route-source-for-job-code${index}`,
398
- paint: { 'line-color': linecolor, 'line-width': 2 },
399
- layout: { 'line-cap': 'round', 'line-join': 'round' }
400
- });
401
- const dataSetForMap = {
402
- origin, destination, index, linecolor, route
403
- };
404
- this.createMarker(dataSetForMap);
405
- this.map.on('mouseenter', `route-for-job-code${index}`, (e) => {
406
- if (this.popup) {
407
- this.popup.remove();
408
- }
409
- this.map.setPaintProperty(`route-for-job-code${index}`, 'line-width', 5);
410
- this.map.setPaintProperty(`route-for-job-code${index}`, 'line-opacity', 1);
411
- const datasetForPopup = {
412
- coordinate: [e.lngLat.lng, e.lngLat.lat],
413
- pickup: route.pickup_location ? route.pickup_location : '',
414
- drop: route.delivery_location ? route.delivery_location : '',
415
- jobCode: route.project ? route.order_number : null,
416
- customer: route.project ? route.customer_name : null,
417
- routeType: route.project ? 'Project' : 'Route',
418
- title: route.project ? route.project : route.route_name ? route.route_name : '',
419
- material: route.material ? route.material : '',
420
- type: route.unit ? route.unit : ''
421
- };
422
- this.createPopup(datasetForPopup);
423
- });
424
- this.map.on('mouseleave', `route-for-job-code${index}`, (e) => {
425
- this.map.setPaintProperty(`route-for-job-code${index}`, 'line-width', 2);
426
- if (this.popup) {
427
- this.popup.remove();
428
- }
429
- });
430
- }
431
- }
432
- provideLineColor(unitType, type) {
433
- let checkType = (type && !['jobrouteList', 'addroute'].includes(type)) ? true : false;
434
- let color;
435
- switch (unitType) {
436
- case "Ton":
437
- color = checkType ? '#39c471' : '#ff7272';
438
- break;
439
- case "Load":
440
- color = checkType ? '#326ad3' : '#a3c52e';
441
- break;
442
- case "Hourly":
443
- color = checkType ? '#ffad56' : '#ae23d1';
444
- break;
445
- }
446
- return color;
447
- }
448
- showRoutePopup(arcDetails, event, isViewRoute) {
449
- if (this.popup) {
450
- this.popup.remove();
451
- this.map.setPaintProperty(`${isViewRoute ? 'line' : 'route-for-job-code'}${arcDetails.layer.props.data.index}`, 'line-width', 2);
452
- }
453
- if (arcDetails.color && this.map.getLayoutProperty(arcDetails.layer.id, 'visibility') !== 'none') {
454
- this.map.setPaintProperty(`${isViewRoute ? 'line' : 'route-for-job-code'}${arcDetails.layer.props.data.index}`, 'line-width', 5);
455
- this.map.setPaintProperty(`${isViewRoute ? 'line' : 'route-for-job-code'}${arcDetails.layer.props.data.index}`, 'line-opacity', 1);
456
- const datasetForPopup = {
457
- coordinate: arcDetails.coordinate,
458
- pickup: arcDetails.layer.props.data.route.pickup_location ? arcDetails.layer.props.data.route.pickup_location : '',
459
- drop: arcDetails.layer.props.data.route.delivery_location ? arcDetails.layer.props.data.route.delivery_location : '',
460
- jobCode: arcDetails.layer.props.data.route.project ? arcDetails.layer.props.data.route.order_number : '',
461
- customer: arcDetails.layer.props.data.route.project ? arcDetails.layer.props.data.route.customer_name : '',
462
- routeType: arcDetails.layer.props.data.route.project ? 'Project' : 'Route',
463
- title: arcDetails.layer.props.data.route.project ? arcDetails.layer.props.data.route.project : arcDetails.layer.props.data.route.route_name ? arcDetails.layer.props.data.route.route_name : '',
464
- material: arcDetails.layer.props.data.route.material ? arcDetails.layer.props.data.route.material : '',
465
- type: arcDetails.layer.props.data.route.unit ? arcDetails.layer.props.data.route.unit : ''
466
- };
467
- this.createPopup(datasetForPopup);
468
- }
469
- }
470
- createPopup(datasetForPopup) {
471
- this.popup = new mapboxgl.Popup({
472
- closeButton: false,
473
- closeOnClick: false,
474
- closeOnMove: true,
475
- anchor: 'bottom-left'
476
- });
477
- this.popup.setLngLat(datasetForPopup.coordinate)
220
+ class CoolmapService {
221
+ constructor(utils, eventManager) {
222
+ this.utils = utils;
223
+ this.eventManager = eventManager;
224
+ this.markerOriginList = [];
225
+ this.markerDestinationList = [];
226
+ this.initiatecoolmap = new BehaviorSubject(true);
227
+ this.reintiatecoolmap = this.initiatecoolmap.asObservable();
228
+ this.bounds = new mapboxgl.LngLatBounds();
229
+ this.originDestinationCordinates = [];
230
+ this.eventManager.addGlobalEventListener('window', 'resize', this.onResize.bind(this));
231
+ this.windowActualHeightWidth = { availHeight: 0 };
232
+ }
233
+ initiateMapForAddRoute(el) {
234
+ return new Promise((resolve, reject) => {
235
+ this.map = new mapboxgl.Map({
236
+ accessToken: 'pk.eyJ1Ijoic2FudGFudS1vZ21hIiwiYSI6ImNsOGQ0cDVrNjAweTMzb3RmdG9ieTU5ZDkifQ.I6ZS7mViZYSvBo4zz-mGQQ',
237
+ container: el,
238
+ style: 'mapbox://styles/santanu-ogma/cl8ep33uz003414n1twlosz9d',
239
+ center: [-77.036873, 38.907192],
240
+ zoom: 10, bearing: 0, pitch: 65, interactive: true,
241
+ });
242
+ this.map.once('load', (res) => {
243
+ resolve(res);
244
+ });
245
+ });
246
+ }
247
+ // Below method Load route with animation
248
+ loadMapProperty(pinRouteGeojson, index, unit, route, bottom) {
249
+ return new Promise((resolve, reject) => {
250
+ let origin = pinRouteGeojson.features[0].geometry.coordinates[0];
251
+ const linecolor = (unit === 'Ton') ? '#ff7272' : (unit === 'Load') ? '#a3c52e' : '#ae23d1';
252
+ let destination = pinRouteGeojson.features[0].geometry.coordinates[pinRouteGeojson.features[0].geometry.coordinates.length - 1];
253
+ this.extendBound(pinRouteGeojson.features[0].geometry.coordinates, true).then((res) => {
254
+ const point = {
255
+ 'type': 'FeatureCollection',
256
+ 'features': [
257
+ { 'type': 'Feature', 'properties': {}, 'geometry': { 'type': 'Point', 'coordinates': origin } }
258
+ ]
259
+ };
260
+ const lineDistance = turf.length(pinRouteGeojson.features[0]);
261
+ const arc = [];
262
+ const steps = 10 * pinRouteGeojson.features[0].geometry.coordinates.length;
263
+ for (let i = 0; i < lineDistance; i += lineDistance / steps) {
264
+ const segment = turf.along(pinRouteGeojson.features[0], i);
265
+ arc.push(segment.geometry.coordinates);
266
+ }
267
+ pinRouteGeojson.features[0].geometry.coordinates = arc;
268
+ const pinRoute = pinRouteGeojson.features[0].geometry.coordinates;
269
+ const marker = new mapboxgl.Marker(document.createElement('div'))
270
+ .setLngLat(pinRoute[0]).addTo(this.map).togglePopup();
271
+ if (this.map.getSource(`line${index}`)) {
272
+ this.removeRouteAndMarker(index).then(() => { });
273
+ }
274
+ this.map.addSource(`line${index}`, { type: 'geojson', lineMetrics: true, data: pinRouteGeojson });
275
+ this.map.addLayer({
276
+ type: 'line',
277
+ source: `line${index}`,
278
+ id: `line${index}`,
279
+ paint: {
280
+ 'line-width': 2,
281
+ 'line-gradient': [
282
+ 'interpolate',
283
+ ['linear'],
284
+ ['line-progress'],
285
+ 0, unit === 'Ton' ? '#d7f7e4' : unit === 'Load' ? '#c9d8f5' : '#f5dcc1',
286
+ 1, unit === 'Ton' ? '#ff7272' : unit === 'Load' ? '#a3c52e' : '#ae23d1',
287
+ ]
288
+ },
289
+ layout: { 'line-cap': 'round', 'line-join': 'round' }
290
+ });
291
+ const dataSetForMap = {
292
+ counter: 0, pinRouteGeojson, steps,
293
+ point, pointId: `point${index}`,
294
+ marker, pinRoute, lineId: `line${index}`, index,
295
+ origin, destination, lineDistance,
296
+ linecolor, route, isViewRoute: true
297
+ };
298
+ this.createMarker(dataSetForMap);
299
+ this.map.on('mouseenter', `line${index}`, (e) => {
300
+ this.map.setPaintProperty(`line${index}`, 'line-width', 5);
301
+ this.map.setPaintProperty(`line${index}`, 'line-opacity', 1);
302
+ const datasetForPopup = {
303
+ coordinate: [e.lngLat.lng, e.lngLat.lat],
304
+ pickup: route.pickup_location ? route.pickup_location : '',
305
+ drop: route.delivery_location ? route.delivery_location : '',
306
+ routeType: route.project ? 'Project' : 'Route',
307
+ title: route.project ? route.project : route.route_name ? route.route_name : '',
308
+ material: route.material ? route.material : '',
309
+ type: route.unit ? route.unit : ''
310
+ };
311
+ this.createPopup(datasetForPopup);
312
+ });
313
+ this.map.on('mouseleave', `line${index}`, (e) => {
314
+ this.map.setPaintProperty(`line${index}`, 'line-width', 2);
315
+ if (this.popup) {
316
+ this.popup.remove();
317
+ }
318
+ });
319
+ });
320
+ this.map.once('idle', (res) => {
321
+ resolve(true);
322
+ });
323
+ });
324
+ }
325
+ // Below method Load route without animation
326
+ drawLine(cordinates, index, route, enablefitbound, routeType) {
327
+ let linecolor;
328
+ let origin = cordinates[0];
329
+ let destination = cordinates[cordinates.length - 1];
330
+ if (origin[0] && origin[1] && destination && destination[0] && destination[1]) {
331
+ linecolor = this.provideLineColor(route['unit'], routeType);
332
+ if (enablefitbound) {
333
+ const padding = {
334
+ top: this.padding.top, bottom: this.padding.bottom + (this.windowActualHeightWidth.availHeight - (window.innerHeight - 65)),
335
+ left: this.padding.left, right: this.padding.right
336
+ };
337
+ this.map.fitBounds([origin, destination], { padding }, { fitboundCompleteJob: true });
338
+ }
339
+ if (this.map.getSource(`route-source-for-job-code${index}`)) {
340
+ this.removeRouteAndMarker(index).then(() => { });
341
+ }
342
+ this.map.addSource(`route-source-for-job-code${index}`, {
343
+ 'type': 'geojson',
344
+ 'data': { 'type': 'Feature', 'properties': {}, 'geometry': { 'type': 'LineString', 'coordinates': cordinates } }
345
+ });
346
+ this.map.addLayer({
347
+ 'id': `route-for-job-code${index}`, 'type': 'line', 'source': `route-source-for-job-code${index}`,
348
+ paint: { 'line-color': linecolor, 'line-width': 2 },
349
+ layout: { 'line-cap': 'round', 'line-join': 'round' }
350
+ });
351
+ const dataSetForMap = {
352
+ origin, destination, index, linecolor, route
353
+ };
354
+ this.createMarker(dataSetForMap);
355
+ this.map.on('mouseenter', `route-for-job-code${index}`, (e) => {
356
+ if (this.popup) {
357
+ this.popup.remove();
358
+ }
359
+ this.map.setPaintProperty(`route-for-job-code${index}`, 'line-width', 5);
360
+ this.map.setPaintProperty(`route-for-job-code${index}`, 'line-opacity', 1);
361
+ const datasetForPopup = {
362
+ coordinate: [e.lngLat.lng, e.lngLat.lat],
363
+ pickup: route.pickup_location ? route.pickup_location : '',
364
+ drop: route.delivery_location ? route.delivery_location : '',
365
+ jobCode: route.project ? route.order_number : null,
366
+ customer: route.project ? route.customer_name : null,
367
+ routeType: route.project ? 'Project' : 'Route',
368
+ title: route.project ? route.project : route.route_name ? route.route_name : '',
369
+ material: route.material ? route.material : '',
370
+ type: route.unit ? route.unit : ''
371
+ };
372
+ this.createPopup(datasetForPopup);
373
+ });
374
+ this.map.on('mouseleave', `route-for-job-code${index}`, (e) => {
375
+ this.map.setPaintProperty(`route-for-job-code${index}`, 'line-width', 2);
376
+ if (this.popup) {
377
+ this.popup.remove();
378
+ }
379
+ });
380
+ }
381
+ }
382
+ provideLineColor(unitType, type) {
383
+ let checkType = (type && !['jobrouteList', 'addroute'].includes(type)) ? true : false;
384
+ let color;
385
+ switch (unitType) {
386
+ case "Ton":
387
+ color = checkType ? '#39c471' : '#ff7272';
388
+ break;
389
+ case "Load":
390
+ color = checkType ? '#326ad3' : '#a3c52e';
391
+ break;
392
+ case "Hourly":
393
+ color = checkType ? '#ffad56' : '#ae23d1';
394
+ break;
395
+ }
396
+ return color;
397
+ }
398
+ showRoutePopup(arcDetails, event, isViewRoute) {
399
+ if (this.popup) {
400
+ this.popup.remove();
401
+ this.map.setPaintProperty(`${isViewRoute ? 'line' : 'route-for-job-code'}${arcDetails.layer.props.data.index}`, 'line-width', 2);
402
+ }
403
+ if (arcDetails.color && this.map.getLayoutProperty(arcDetails.layer.id, 'visibility') !== 'none') {
404
+ this.map.setPaintProperty(`${isViewRoute ? 'line' : 'route-for-job-code'}${arcDetails.layer.props.data.index}`, 'line-width', 5);
405
+ this.map.setPaintProperty(`${isViewRoute ? 'line' : 'route-for-job-code'}${arcDetails.layer.props.data.index}`, 'line-opacity', 1);
406
+ const datasetForPopup = {
407
+ coordinate: arcDetails.coordinate,
408
+ pickup: arcDetails.layer.props.data.route.pickup_location ? arcDetails.layer.props.data.route.pickup_location : '',
409
+ drop: arcDetails.layer.props.data.route.delivery_location ? arcDetails.layer.props.data.route.delivery_location : '',
410
+ jobCode: arcDetails.layer.props.data.route.project ? arcDetails.layer.props.data.route.order_number : '',
411
+ customer: arcDetails.layer.props.data.route.project ? arcDetails.layer.props.data.route.customer_name : '',
412
+ routeType: arcDetails.layer.props.data.route.project ? 'Project' : 'Route',
413
+ title: arcDetails.layer.props.data.route.project ? arcDetails.layer.props.data.route.project : arcDetails.layer.props.data.route.route_name ? arcDetails.layer.props.data.route.route_name : '',
414
+ material: arcDetails.layer.props.data.route.material ? arcDetails.layer.props.data.route.material : '',
415
+ type: arcDetails.layer.props.data.route.unit ? arcDetails.layer.props.data.route.unit : ''
416
+ };
417
+ this.createPopup(datasetForPopup);
418
+ }
419
+ }
420
+ createPopup(datasetForPopup) {
421
+ this.popup = new mapboxgl.Popup({
422
+ closeButton: false,
423
+ closeOnClick: false,
424
+ closeOnMove: true,
425
+ anchor: 'bottom-left'
426
+ });
427
+ this.popup.setLngLat(datasetForPopup.coordinate)
478
428
  .setHTML(`
479
429
  <div class="destination">
480
430
  <div class="duration">
@@ -487,272 +437,272 @@ class CoolmapService {
487
437
  <span><b>Material:</b> ${datasetForPopup.material}</span>
488
438
  <span><b>Type:</b> ${datasetForPopup.type}</span>
489
439
  </div>
490
- `)
491
- .addTo(this.map);
492
- }
493
- hexToRGB(hex) {
494
- return hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) => '#' + r + r + g + g + b + b)
495
- .substring(1).match(/.{2}/g)
496
- .map(x => parseInt(x, 16));
497
- }
498
- createMarker(routeDetails) {
499
- var _a, _b;
500
- if (routeDetails.origin[0] && routeDetails.origin[1] && routeDetails.destination[0] && routeDetails.destination[1]) {
501
- const popup = new mapboxgl.Popup({ closeButton: false }).setHTML('<b>Pickup: </b>' + ((_a = routeDetails.route) === null || _a === void 0 ? void 0 : _a.pickup_location));
502
- const popupForDestination = new mapboxgl.Popup({ closeButton: false })
503
- .setHTML('<b>Delivery: </b>' + ((_b = routeDetails.route) === null || _b === void 0 ? void 0 : _b.delivery_location));
504
- const el = document.createElement('div');
505
- el.className = 'marker';
506
- el.innerHTML = `<span class='markerPointer' style='background:${routeDetails.linecolor}'><b>P</b><span class='markerSpan' style='border-top: 10px solid ${routeDetails.linecolor}'></span></span>`;
507
- const originMarker = new mapboxgl.Marker(el)
508
- .setPopup(popup).setLngLat(routeDetails.origin).addTo(this.map);
509
- originMarker.getElement().addEventListener('mouseenter', () => originMarker.togglePopup());
510
- originMarker.getElement().addEventListener('mouseleave', () => originMarker.togglePopup());
511
- const elementForDestination = document.createElement('div');
512
- elementForDestination.className = 'marker';
513
- elementForDestination.innerHTML = `<span class='markerPointer' style='background:${routeDetails.linecolor}'><b>D</b><span class='markerSpan' style='border-top: 10px solid ${routeDetails.linecolor}'></span></span>`;
514
- const destinationMarker = new mapboxgl.Marker(elementForDestination).setPopup(popupForDestination).setLngLat(routeDetails.destination).addTo(this.map);
515
- destinationMarker.getElement().addEventListener('mouseenter', () => destinationMarker.togglePopup());
516
- destinationMarker.getElement().addEventListener('mouseleave', () => destinationMarker.togglePopup());
517
- this.markerOriginList[routeDetails.index] = originMarker;
518
- this.markerDestinationList[routeDetails.index] = destinationMarker;
519
- const colorArray = this.hexToRGB(routeDetails.linecolor);
520
- const arcLayer = new MapboxLayer({
521
- id: 'arc-layer' + routeDetails.index,
522
- type: ArcLayer,
523
- pickable: true,
524
- data: { route: routeDetails.route, index: routeDetails.index },
525
- getWidth: 1,
526
- getSourcePosition: routeDetails.origin,
527
- getTargetPosition: routeDetails.destination,
528
- getTargetColor: [255, 255, 255],
529
- getSourceColor: [colorArray[0], colorArray[1], colorArray[2]],
530
- onHover: (info, event) => this.showRoutePopup(info, event, routeDetails.isViewRoute),
531
- });
532
- this.map.addLayer(arcLayer);
533
- }
534
- }
535
- removeRouteAndMarker(index) {
536
- return __awaiter(this, void 0, void 0, function* () {
537
- if (this.map) {
538
- this.map.getLayer(`arc-layer${index}`) ? this.map.removeLayer(`arc-layer${index}`) : '';
539
- this.map.getLayer(`line${index}`) ? this.map.removeLayer(`line${index}`) : '';
540
- this.map.getLayer(`custom_layer${index}`) ? this.map.removeLayer(`custom_layer${index}`) : '';
541
- this.map.getSource(`line${index}`) ? this.map.removeSource(`line${index}`) : '';
542
- this.map.getLayer(`route-for-job-code${index}`) ? this.map.removeLayer(`route-for-job-code${index}`) : '';
543
- this.map.getSource(`route-source-for-job-code${index}`) ? this.map.removeSource(`route-source-for-job-code${index}`) : '';
544
- this.findMarkerBound(index);
545
- this.markerOriginList[index] ? this.markerOriginList[index].remove() : '';
546
- this.markerDestinationList[index] ? this.markerDestinationList[index].remove() : '';
547
- yield true;
548
- }
549
- });
550
- }
551
- findMarkerBound(index) {
552
- const indexOfCordinates = this.originDestinationCordinates.findIndex((x) => { var _a, _b, _c, _d; return (x[0][0].toFixed(6) == ((_b = (_a = this.markerOriginList[index]) === null || _a === void 0 ? void 0 : _a.getLngLat()) === null || _b === void 0 ? void 0 : _b.lng.toFixed(6))) && (x[0][1].toFixed(6) == ((_d = (_c = this.markerOriginList[index]) === null || _c === void 0 ? void 0 : _c.getLngLat()) === null || _d === void 0 ? void 0 : _d.lat.toFixed(6))); });
553
- if (indexOfCordinates >= 0) {
554
- this.originDestinationCordinates.splice(indexOfCordinates, 1);
555
- }
556
- }
557
- filterRoute(ID, visibility, showAllFitbound) {
558
- return __awaiter(this, void 0, void 0, function* () {
559
- if (ID) {
560
- if (this.map.getLayer(`route-for-job-code${ID}`)) {
561
- this.map.setLayoutProperty(`route-for-job-code${ID}`, 'visibility', visibility);
562
- const originM = this.markerOriginList[ID].getElement();
563
- originM.style.display = ((visibility === 'visible') ? 'block' : visibility);
564
- const destinationM = this.markerDestinationList[ID].getElement();
565
- destinationM.style.display = ((visibility === 'visible') ? 'block' : visibility);
566
- if (visibility === 'none' && showAllFitbound) {
567
- this.findMarkerBound(ID);
568
- this.extendReBound();
569
- }
570
- }
571
- if (this.map.getLayer(`arc-layer${ID}`)) {
572
- this.map.setLayoutProperty(`arc-layer${ID}`, 'visibility', visibility);
573
- }
574
- }
575
- yield true;
576
- });
577
- }
578
- extendBound(route, showAllFitbound) {
579
- return new Promise((resolve, reject) => {
580
- if (route) {
581
- if (typeof route === 'string') {
582
- let path = route.split(';');
583
- path = path.map((ele) => { return ele = this.formateLatLong(ele); });
584
- path.forEach((ele, index) => {
585
- if (ele.length === 1)
586
- path.splice(index, 1);
587
- });
588
- route = path;
589
- }
590
- if (route[0][0] && route[0][1] && route[route.length - 1][0] && route[route.length - 1][1]) {
591
- this.originDestinationCordinates.push(route);
592
- route.map((item) => {
593
- this.bounds.extend(item);
594
- });
595
- }
596
- }
597
- if (showAllFitbound) {
598
- const padding = { top: this.padding.top, bottom: (this.padding.bottom + (this.windowActualHeightWidth.availHeight - (window.innerHeight - 65))), left: this.padding.left, right: this.padding.right };
599
- setTimeout(() => {
600
- if (showAllFitbound && (Object.keys(this.bounds).length > 0))
601
- this.map.fitBounds(this.bounds, { padding }, { fitboundComplete: true });
602
- }, 100);
603
- this.map.once('moveend', (event) => {
604
- if (event.fitboundComplete) {
605
- resolve(true);
606
- }
607
- });
608
- }
609
- });
610
- }
611
- extendReBound(bottom) {
612
- return new Promise((resolve, reject) => {
613
- this.bounds = new mapboxgl.LngLatBounds();
614
- if (this.originDestinationCordinates.length >= 0) {
615
- this.originDestinationCordinates.map((item, index) => {
616
- item.map((route) => {
617
- this.bounds.extend(route);
618
- });
619
- if (index === (this.originDestinationCordinates.length - 1)) {
620
- const padding = { top: this.padding.top, bottom: (this.padding.bottom + (this.windowActualHeightWidth.availHeight - (window.innerHeight - 65))), left: this.padding.left, right: this.padding.right };
621
- setTimeout(() => {
622
- if (this.originDestinationCordinates.length > 0)
623
- this.map.fitBounds(this.bounds, { padding });
624
- }, 500);
625
- resolve(true);
626
- }
627
- });
628
- }
629
- else {
630
- resolve(true);
631
- }
632
- });
633
- }
634
- plotRoute(route, i, type, enablefitbound, showAllFitbound) {
635
- return new Promise((resolve, reject) => {
636
- let param = {};
637
- if (['jobcode'].includes(type)) {
638
- param['job'] = route['job_id'];
639
- this.utils.postDataWithRestUrl('schedule/job/path', param).subscribe((res) => {
640
- if (res['data']['route']) {
641
- let path = res['data']['route'].split(';');
642
- path = path.map((ele) => { return ele = this.formateLatLong(ele); });
643
- path.forEach((ele, index) => {
644
- if (ele.length === 1)
645
- path.splice(index, 1);
646
- });
647
- route['path'] = path;
648
- this.extendBound(route['path'], showAllFitbound);
649
- if (route['path'] && route['path'].length > 0)
650
- this.drawLine(route['path'], i, route, enablefitbound, type);
651
- route['index'] = i;
652
- }
653
- else {
654
- this.extendBound(null, showAllFitbound);
655
- }
656
- resolve(true);
657
- }, (err) => {
658
- if (err) {
659
- reject(false);
660
- }
661
- });
662
- }
663
- else if (['jobrouteList', 'addroute'].includes(type)) {
664
- if (route['path'] && route['path'].length > 0) {
665
- let path = route['path'].split(';');
666
- path = path.map((ele) => { return ele = this.formateLatLong(ele); });
667
- path.forEach((ele, index) => {
668
- if (ele.length === 1)
669
- path.splice(index, 1);
670
- });
671
- this.extendBound(path, showAllFitbound);
672
- this.drawLine(path, i, route, enablefitbound, type);
673
- }
674
- ;
675
- }
676
- });
677
- }
678
- clearBound() { this.bounds = new mapboxgl.LngLatBounds(); this.originDestinationCordinates = []; this.clearPadding(); }
679
- formateLatLong(latlong) { return latlong ? latlong.split(',').map(x => +x).reverse() : null; }
680
- clearBoundWithCordinates() {
681
- this.bounds = new mapboxgl.LngLatBounds();
682
- this.originDestinationCordinates = [];
683
- }
684
- onResize(event) {
685
- if (!this.bounds.isEmpty()) {
686
- this.windowActualHeightWidth.availHeight = (window.innerHeight > window.screen.availHeight) ? window.innerHeight : window.screen.availHeight;
687
- setTimeout(() => {
688
- this.map.fitBounds(this.bounds, { padding: { top: this.padding.top, bottom: this.padding.bottom + (this.windowActualHeightWidth.availHeight - (event.target.innerHeight - 65)), left: this.padding.left, right: this.padding.right } });
689
- }, 500);
690
- }
691
- }
692
- setWindowHeight(screen) {
693
- this.windowActualHeightWidth.availHeight = screen;
694
- }
695
- setPadding(padding) { this.padding = padding; }
696
- clearPadding() { this.padding = null; }
697
- removeJobFromMap(data) {
698
- data.map((ele, index) => {
699
- const id = (ele['job_id'] ? ele['job_id'] : ele['route_id']);
700
- this.removeRouteAndMarker(id);
701
- if (index === (data.length - 1)) {
702
- this.extendReBound();
703
- }
704
- });
705
- }
706
- }
707
- CoolmapService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapService, deps: [{ token: UtilsService }, { token: i2$1.EventManager }], target: i0.ɵɵFactoryTarget.Injectable });
708
- CoolmapService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapService, providedIn: 'root' });
709
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapService, decorators: [{
710
- type: Injectable,
711
- args: [{ providedIn: 'root' }]
440
+ `)
441
+ .addTo(this.map);
442
+ }
443
+ hexToRGB(hex) {
444
+ return hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) => '#' + r + r + g + g + b + b)
445
+ .substring(1).match(/.{2}/g)
446
+ .map(x => parseInt(x, 16));
447
+ }
448
+ createMarker(routeDetails) {
449
+ var _a, _b;
450
+ if (routeDetails.origin[0] && routeDetails.origin[1] && routeDetails.destination[0] && routeDetails.destination[1]) {
451
+ const popup = new mapboxgl.Popup({ closeButton: false }).setHTML('<b>Pickup: </b>' + ((_a = routeDetails.route) === null || _a === void 0 ? void 0 : _a.pickup_location));
452
+ const popupForDestination = new mapboxgl.Popup({ closeButton: false })
453
+ .setHTML('<b>Delivery: </b>' + ((_b = routeDetails.route) === null || _b === void 0 ? void 0 : _b.delivery_location));
454
+ const el = document.createElement('div');
455
+ el.className = 'marker';
456
+ el.innerHTML = `<span class='markerPointer' style='background:${routeDetails.linecolor}'><b>P</b><span class='markerSpan' style='border-top: 10px solid ${routeDetails.linecolor}'></span></span>`;
457
+ const originMarker = new mapboxgl.Marker(el)
458
+ .setPopup(popup).setLngLat(routeDetails.origin).addTo(this.map);
459
+ originMarker.getElement().addEventListener('mouseenter', () => originMarker.togglePopup());
460
+ originMarker.getElement().addEventListener('mouseleave', () => originMarker.togglePopup());
461
+ const elementForDestination = document.createElement('div');
462
+ elementForDestination.className = 'marker';
463
+ elementForDestination.innerHTML = `<span class='markerPointer' style='background:${routeDetails.linecolor}'><b>D</b><span class='markerSpan' style='border-top: 10px solid ${routeDetails.linecolor}'></span></span>`;
464
+ const destinationMarker = new mapboxgl.Marker(elementForDestination).setPopup(popupForDestination).setLngLat(routeDetails.destination).addTo(this.map);
465
+ destinationMarker.getElement().addEventListener('mouseenter', () => destinationMarker.togglePopup());
466
+ destinationMarker.getElement().addEventListener('mouseleave', () => destinationMarker.togglePopup());
467
+ this.markerOriginList[routeDetails.index] = originMarker;
468
+ this.markerDestinationList[routeDetails.index] = destinationMarker;
469
+ const colorArray = this.hexToRGB(routeDetails.linecolor);
470
+ const arcLayer = new MapboxLayer({
471
+ id: 'arc-layer' + routeDetails.index,
472
+ type: ArcLayer,
473
+ pickable: true,
474
+ data: { route: routeDetails.route, index: routeDetails.index },
475
+ getWidth: 1,
476
+ getSourcePosition: routeDetails.origin,
477
+ getTargetPosition: routeDetails.destination,
478
+ getTargetColor: [255, 255, 255],
479
+ getSourceColor: [colorArray[0], colorArray[1], colorArray[2]],
480
+ onHover: (info, event) => this.showRoutePopup(info, event, routeDetails.isViewRoute),
481
+ });
482
+ this.map.addLayer(arcLayer);
483
+ }
484
+ }
485
+ removeRouteAndMarker(index) {
486
+ return __awaiter(this, void 0, void 0, function* () {
487
+ if (this.map) {
488
+ this.map.getLayer(`arc-layer${index}`) ? this.map.removeLayer(`arc-layer${index}`) : '';
489
+ this.map.getLayer(`line${index}`) ? this.map.removeLayer(`line${index}`) : '';
490
+ this.map.getLayer(`custom_layer${index}`) ? this.map.removeLayer(`custom_layer${index}`) : '';
491
+ this.map.getSource(`line${index}`) ? this.map.removeSource(`line${index}`) : '';
492
+ this.map.getLayer(`route-for-job-code${index}`) ? this.map.removeLayer(`route-for-job-code${index}`) : '';
493
+ this.map.getSource(`route-source-for-job-code${index}`) ? this.map.removeSource(`route-source-for-job-code${index}`) : '';
494
+ this.findMarkerBound(index);
495
+ this.markerOriginList[index] ? this.markerOriginList[index].remove() : '';
496
+ this.markerDestinationList[index] ? this.markerDestinationList[index].remove() : '';
497
+ yield true;
498
+ }
499
+ });
500
+ }
501
+ findMarkerBound(index) {
502
+ const indexOfCordinates = this.originDestinationCordinates.findIndex((x) => { var _a, _b, _c, _d; return (x[0][0].toFixed(6) == ((_b = (_a = this.markerOriginList[index]) === null || _a === void 0 ? void 0 : _a.getLngLat()) === null || _b === void 0 ? void 0 : _b.lng.toFixed(6))) && (x[0][1].toFixed(6) == ((_d = (_c = this.markerOriginList[index]) === null || _c === void 0 ? void 0 : _c.getLngLat()) === null || _d === void 0 ? void 0 : _d.lat.toFixed(6))); });
503
+ if (indexOfCordinates >= 0) {
504
+ this.originDestinationCordinates.splice(indexOfCordinates, 1);
505
+ }
506
+ }
507
+ filterRoute(ID, visibility, showAllFitbound) {
508
+ return __awaiter(this, void 0, void 0, function* () {
509
+ if (ID) {
510
+ if (this.map.getLayer(`route-for-job-code${ID}`)) {
511
+ this.map.setLayoutProperty(`route-for-job-code${ID}`, 'visibility', visibility);
512
+ const originM = this.markerOriginList[ID].getElement();
513
+ originM.style.display = ((visibility === 'visible') ? 'block' : visibility);
514
+ const destinationM = this.markerDestinationList[ID].getElement();
515
+ destinationM.style.display = ((visibility === 'visible') ? 'block' : visibility);
516
+ if (visibility === 'none' && showAllFitbound) {
517
+ this.findMarkerBound(ID);
518
+ this.extendReBound();
519
+ }
520
+ }
521
+ if (this.map.getLayer(`arc-layer${ID}`)) {
522
+ this.map.setLayoutProperty(`arc-layer${ID}`, 'visibility', visibility);
523
+ }
524
+ }
525
+ yield true;
526
+ });
527
+ }
528
+ extendBound(route, showAllFitbound) {
529
+ return new Promise((resolve, reject) => {
530
+ if (route) {
531
+ if (typeof route === 'string') {
532
+ let path = route.split(';');
533
+ path = path.map((ele) => { return ele = this.formateLatLong(ele); });
534
+ path.forEach((ele, index) => {
535
+ if (ele.length === 1)
536
+ path.splice(index, 1);
537
+ });
538
+ route = path;
539
+ }
540
+ if (route[0][0] && route[0][1] && route[route.length - 1][0] && route[route.length - 1][1]) {
541
+ this.originDestinationCordinates.push(route);
542
+ route.map((item) => {
543
+ this.bounds.extend(item);
544
+ });
545
+ }
546
+ }
547
+ if (showAllFitbound) {
548
+ const padding = { top: this.padding.top, bottom: (this.padding.bottom + (this.windowActualHeightWidth.availHeight - (window.innerHeight - 65))), left: this.padding.left, right: this.padding.right };
549
+ setTimeout(() => {
550
+ if (showAllFitbound && (Object.keys(this.bounds).length > 0))
551
+ this.map.fitBounds(this.bounds, { padding }, { fitboundComplete: true });
552
+ }, 100);
553
+ this.map.once('moveend', (event) => {
554
+ if (event.fitboundComplete) {
555
+ resolve(true);
556
+ }
557
+ });
558
+ }
559
+ });
560
+ }
561
+ extendReBound(bottom) {
562
+ return new Promise((resolve, reject) => {
563
+ this.bounds = new mapboxgl.LngLatBounds();
564
+ if (this.originDestinationCordinates.length >= 0) {
565
+ this.originDestinationCordinates.map((item, index) => {
566
+ item.map((route) => {
567
+ this.bounds.extend(route);
568
+ });
569
+ if (index === (this.originDestinationCordinates.length - 1)) {
570
+ const padding = { top: this.padding.top, bottom: (this.padding.bottom + (this.windowActualHeightWidth.availHeight - (window.innerHeight - 65))), left: this.padding.left, right: this.padding.right };
571
+ setTimeout(() => {
572
+ if (this.originDestinationCordinates.length > 0)
573
+ this.map.fitBounds(this.bounds, { padding });
574
+ }, 500);
575
+ resolve(true);
576
+ }
577
+ });
578
+ }
579
+ else {
580
+ resolve(true);
581
+ }
582
+ });
583
+ }
584
+ plotRoute(route, i, type, enablefitbound, showAllFitbound) {
585
+ return new Promise((resolve, reject) => {
586
+ let param = {};
587
+ if (['jobcode'].includes(type)) {
588
+ param['job'] = route['job_id'];
589
+ this.utils.postDataWithRestUrl('schedule/job/path', param).subscribe((res) => {
590
+ if (res['data']['route']) {
591
+ let path = res['data']['route'].split(';');
592
+ path = path.map((ele) => { return ele = this.formateLatLong(ele); });
593
+ path.forEach((ele, index) => {
594
+ if (ele.length === 1)
595
+ path.splice(index, 1);
596
+ });
597
+ route['path'] = path;
598
+ this.extendBound(route['path'], showAllFitbound);
599
+ if (route['path'] && route['path'].length > 0)
600
+ this.drawLine(route['path'], i, route, enablefitbound, type);
601
+ route['index'] = i;
602
+ }
603
+ else {
604
+ this.extendBound(null, showAllFitbound);
605
+ }
606
+ resolve(true);
607
+ }, (err) => {
608
+ if (err) {
609
+ reject(false);
610
+ }
611
+ });
612
+ }
613
+ else if (['jobrouteList', 'addroute'].includes(type)) {
614
+ if (route['path'] && route['path'].length > 0) {
615
+ let path = route['path'].split(';');
616
+ path = path.map((ele) => { return ele = this.formateLatLong(ele); });
617
+ path.forEach((ele, index) => {
618
+ if (ele.length === 1)
619
+ path.splice(index, 1);
620
+ });
621
+ this.extendBound(path, showAllFitbound);
622
+ this.drawLine(path, i, route, enablefitbound, type);
623
+ }
624
+ ;
625
+ }
626
+ });
627
+ }
628
+ clearBound() { this.bounds = new mapboxgl.LngLatBounds(); this.originDestinationCordinates = []; this.clearPadding(); }
629
+ formateLatLong(latlong) { return latlong ? latlong.split(',').map(x => +x).reverse() : null; }
630
+ clearBoundWithCordinates() {
631
+ this.bounds = new mapboxgl.LngLatBounds();
632
+ this.originDestinationCordinates = [];
633
+ }
634
+ onResize(event) {
635
+ if (!this.bounds.isEmpty()) {
636
+ this.windowActualHeightWidth.availHeight = (window.innerHeight > window.screen.availHeight) ? window.innerHeight : window.screen.availHeight;
637
+ setTimeout(() => {
638
+ this.map.fitBounds(this.bounds, { padding: { top: this.padding.top, bottom: this.padding.bottom + (this.windowActualHeightWidth.availHeight - (event.target.innerHeight - 65)), left: this.padding.left, right: this.padding.right } });
639
+ }, 500);
640
+ }
641
+ }
642
+ setWindowHeight(screen) {
643
+ this.windowActualHeightWidth.availHeight = screen;
644
+ }
645
+ setPadding(padding) { this.padding = padding; }
646
+ clearPadding() { this.padding = null; }
647
+ removeJobFromMap(data) {
648
+ data.map((ele, index) => {
649
+ const id = (ele['job_id'] ? ele['job_id'] : ele['route_id']);
650
+ this.removeRouteAndMarker(id);
651
+ if (index === (data.length - 1)) {
652
+ this.extendReBound();
653
+ }
654
+ });
655
+ }
656
+ }
657
+ CoolmapService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapService, deps: [{ token: UtilsService }, { token: i2$1.EventManager }], target: i0.ɵɵFactoryTarget.Injectable });
658
+ CoolmapService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapService, providedIn: 'root' });
659
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CoolmapService, decorators: [{
660
+ type: Injectable,
661
+ args: [{ providedIn: 'root' }]
712
662
  }], ctorParameters: function () { return [{ type: UtilsService }, { type: i2$1.EventManager }]; } });
713
663
 
714
- class Route {
715
- constructor() {
716
- this.index = 0;
717
- }
718
- }
719
- const EstinationData = ['estimated_distance', 'estimated_time'];
720
- var EstinationEnum;
721
- (function (EstinationEnum) {
722
- EstinationEnum["estimated_distance"] = "miles";
723
- EstinationEnum["estimated_time"] = "time";
724
- })(EstinationEnum || (EstinationEnum = {}));
725
- const JobCodeOverviewData = ['customer_contact', 'delivery_contact', 'pickup_location', 'delivery_location', 'project', 'unit'];
726
- var JobCodeOverviewEnum;
727
- (function (JobCodeOverviewEnum) {
728
- JobCodeOverviewEnum["customer_contact"] = "Customer Contact";
729
- JobCodeOverviewEnum["delivery_contact"] = "Delivery Contact";
730
- JobCodeOverviewEnum["pickup_location"] = "Pickup";
731
- JobCodeOverviewEnum["delivery_location"] = "Delivery";
732
- JobCodeOverviewEnum["project"] = "Project Name";
733
- JobCodeOverviewEnum["unit"] = "Job Type";
734
- })(JobCodeOverviewEnum || (JobCodeOverviewEnum = {}));
735
- const DriversmsCardKey = ['order_number', 'date', 'values', 'material', 'unit', 'pickup_location', 'delivery_location'];
736
- var DriverSmsCardEnum;
737
- (function (DriverSmsCardEnum) {
738
- DriverSmsCardEnum["order_number"] = "Jobcode";
739
- DriverSmsCardEnum["date"] = "Date";
740
- DriverSmsCardEnum["values"] = "Total tasks";
741
- DriverSmsCardEnum["material"] = "Material";
742
- DriverSmsCardEnum["unit"] = "Unit";
743
- DriverSmsCardEnum["pickup_location"] = "Pickup Address";
744
- DriverSmsCardEnum["delivery_location"] = "Delivery Address";
745
- })(DriverSmsCardEnum || (DriverSmsCardEnum = {}));
746
- class PopupData {
664
+ class Route {
665
+ constructor() {
666
+ this.index = 0;
667
+ }
668
+ }
669
+ const EstinationData = ['estimated_distance', 'estimated_time'];
670
+ var EstinationEnum;
671
+ (function (EstinationEnum) {
672
+ EstinationEnum["estimated_distance"] = "miles";
673
+ EstinationEnum["estimated_time"] = "time";
674
+ })(EstinationEnum || (EstinationEnum = {}));
675
+ const JobCodeOverviewData = ['customer_contact', 'delivery_contact', 'pickup_location', 'delivery_location', 'project', 'unit'];
676
+ var JobCodeOverviewEnum;
677
+ (function (JobCodeOverviewEnum) {
678
+ JobCodeOverviewEnum["customer_contact"] = "Customer Contact";
679
+ JobCodeOverviewEnum["delivery_contact"] = "Delivery Contact";
680
+ JobCodeOverviewEnum["pickup_location"] = "Pickup";
681
+ JobCodeOverviewEnum["delivery_location"] = "Delivery";
682
+ JobCodeOverviewEnum["project"] = "Project Name";
683
+ JobCodeOverviewEnum["unit"] = "Job Type";
684
+ })(JobCodeOverviewEnum || (JobCodeOverviewEnum = {}));
685
+ const DriversmsCardKey = ['order_number', 'date', 'values', 'material', 'unit', 'pickup_location', 'delivery_location'];
686
+ var DriverSmsCardEnum;
687
+ (function (DriverSmsCardEnum) {
688
+ DriverSmsCardEnum["order_number"] = "Jobcode";
689
+ DriverSmsCardEnum["date"] = "Date";
690
+ DriverSmsCardEnum["values"] = "Total tasks";
691
+ DriverSmsCardEnum["material"] = "Material";
692
+ DriverSmsCardEnum["unit"] = "Unit";
693
+ DriverSmsCardEnum["pickup_location"] = "Pickup Address";
694
+ DriverSmsCardEnum["delivery_location"] = "Delivery Address";
695
+ })(DriverSmsCardEnum || (DriverSmsCardEnum = {}));
696
+ class PopupData {
747
697
  }
748
698
 
749
- /*
750
- * Public API Surface of coolmap-services
699
+ /*
700
+ * Public API Surface of coolmap-services
751
701
  */
752
702
 
753
- /**
754
- * Generated bundle index. Do not edit.
703
+ /**
704
+ * Generated bundle index. Do not edit.
755
705
  */
756
706
 
757
- export { CoolmapService, CoolmapServicesComponent, CoolmapServicesModule, CoolmapServicesService, DriverSmsCardEnum, DriversmsCardKey, EstinationData, EstinationEnum, JobCodeOverviewData, JobCodeOverviewEnum, PopupData, Route, UtilsService };
707
+ export { CoolmapService, DriverSmsCardEnum, DriversmsCardKey, EstinationData, EstinationEnum, JobCodeOverviewData, JobCodeOverviewEnum, PopupData, Route, UtilsService };
758
708
  //# sourceMappingURL=aggdirect-coolmap-services.mjs.map