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