proximiio-js-library 1.7.0 → 1.8.1

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.
package/README.md CHANGED
@@ -125,15 +125,27 @@ const map = new Proximiio.Map({
125
125
  animatedRoute: false // optional, default: false, EXPERIMENTAL, if enabled animated dot will be displayed along the route,
126
126
  useRasterTiles: false, // optional, default: false, this will add raster tile source and layer with defined options from rasterTilesOptions
127
127
  rasterTilesOptions: {
128
- tilesUrl: string[], mandatory
129
- tileSize: number, optional, default: 256,
130
- minZoom: number, optional, default: 15,
131
- maxZoom: number, optional, default: 22,
132
- beforeLayer: string, optional, default: 'proximiio-shop',
133
- attribution: string, optional
128
+ tilesUrl: string[], // mandatory
129
+ tileSize: number, // optional, default: 256,
130
+ minZoom: number, // optional, default: 15,
131
+ maxZoom: number, // optional, default: 22,
132
+ beforeLayer: string, // optional, default: 'proximiio-shop',
133
+ attribution: string, // optional
134
134
  },
135
+ handleUrlParams: false, // optional, default: false, if enabled you can define place, start and destination features for routing in url params and library will handle those, you can change param names via urlParams option listed below
136
+ urlParams: {
137
+ startFeature: string, // optional, default: 'startFeature', library will search for the start feature by it's id or title defined within provided param
138
+ destinationFeature: string, // optional, default: 'destinationFeature', library will search for the destination feature by it's id or title defined within provided param
139
+ defaultPlace: string, // optional, default: 'defaultPlace', library will search for the place by it's id or title defined within provided param
140
+ }
141
+ useGpsLocation: false, // optional, default: false, if enabled your location will be detected with geolocation API and used as a starting point for routing
135
142
  });
136
143
  ```
144
+ #### Initiating with url params
145
+ Library can handle some params from url in case you will enable `handleUrlParams` in map constructor. There's nothing else special required, just provide them in browser url like this as default:
146
+
147
+ `http://your-server/?startFeature=featureIdOrTitle&destinationFeature=featureIdOrTitle&defaultPlace=placeIdOrTitle`
148
+
137
149
  #### Required Data for 3D Polygons
138
150
  As first there must be a MultiPolygon feature created which will be a polygon itself, it's also nice to have a label-line property in properties set. Label-line is just imaginary line alongside which poi title will be drawn. At last, you have to connect poi to polygon via adding its id to poi metadata like polygon_id property.
139
151
 
@@ -466,38 +466,42 @@ export class Wayfinding {
466
466
  }
467
467
 
468
468
  levelChanger.properties.fixedPointMap = new Map();
469
- levelChanger.properties.levels.forEach(level => {
470
- let point = this._copyPoint(levelChanger);
471
- point.properties.level = level;
472
- let fixedPoint = this._getFixPointInArea(point);
473
- fixedPoint.id = levelChanger.id;
474
- fixedPoint.properties.amenity = levelChanger.properties.amenity;
475
- fixedPoint.properties.direction = levelChanger.properties.direction;
476
- fixedPoint.properties.id = levelChanger.properties.id;
477
- fixedPoint.properties.level = level;
478
- fixedPoint.properties.type = levelChanger.properties.type;
479
- if (fixedPoint.properties.neighbours === undefined) fixedPoint.properties.neighbours = [];
480
-
481
- // Do not fix level changers that are further than 5 meters from any path or area
482
- if (this._distance(point, fixedPoint) > 5) {
483
- return;
484
- }
485
-
486
- // Store fixed point into the level changer
487
- levelChanger.properties.fixedPointMap.set(level, fixedPoint);
488
-
489
- // Add neighbourhood for corridor
490
- if (fixedPoint.properties.onCorridor) {
491
- // fixedPoint.properties.neighbours = [...this.corridorLinePointPairs[fixedPoint.properties.corridorIndex], ...segmentIntersectionPointMap.get(fixedPoint.properties.corridorIndex)];
492
- if (fixedPoint.properties.neighboursLeadingTo !== undefined) {
493
- fixedPoint.properties.neighboursLeadingTo.forEach(neighbour => {
494
- if (neighbour.properties.neighbours === undefined) neighbour.properties.neighbours = [];
495
- neighbour.properties.neighbours.push(fixedPoint);
496
- });
497
- this.corridorLineFeatures[fixedPoint.properties.corridorIndex].properties.intersectionPointList.push(fixedPoint);
469
+ if (levelChanger.properties.levels) {
470
+ levelChanger.properties.levels.forEach(level => {
471
+ let point = this._copyPoint(levelChanger);
472
+ point.properties.level = level;
473
+ let fixedPoint = this._getFixPointInArea(point);
474
+ if (fixedPoint) {
475
+ fixedPoint.id = levelChanger.id;
476
+ fixedPoint.properties.amenity = levelChanger.properties.amenity;
477
+ fixedPoint.properties.direction = levelChanger.properties.direction;
478
+ fixedPoint.properties.id = levelChanger.properties.id;
479
+ fixedPoint.properties.level = level;
480
+ fixedPoint.properties.type = levelChanger.properties.type;
481
+ if (fixedPoint.properties.neighbours === undefined) fixedPoint.properties.neighbours = [];
482
+
483
+ // Do not fix level changers that are further than 5 meters from any path or area
484
+ if (this._distance(point, fixedPoint) > 5) {
485
+ return;
486
+ }
487
+
488
+ // Store fixed point into the level changer
489
+ levelChanger.properties.fixedPointMap.set(level, fixedPoint);
490
+
491
+ // Add neighbourhood for corridor
492
+ if (fixedPoint.properties.onCorridor) {
493
+ // fixedPoint.properties.neighbours = [...this.corridorLinePointPairs[fixedPoint.properties.corridorIndex], ...segmentIntersectionPointMap.get(fixedPoint.properties.corridorIndex)];
494
+ if (fixedPoint.properties.neighboursLeadingTo !== undefined) {
495
+ fixedPoint.properties.neighboursLeadingTo.forEach(neighbour => {
496
+ if (neighbour.properties.neighbours === undefined) neighbour.properties.neighbours = [];
497
+ neighbour.properties.neighbours.push(fixedPoint);
498
+ });
499
+ this.corridorLineFeatures[fixedPoint.properties.corridorIndex].properties.intersectionPointList.push(fixedPoint);
500
+ }
501
+ }
498
502
  }
499
- }
500
- });
503
+ });
504
+ }
501
505
  });
502
506
 
503
507
  levelChangerGroupMap.forEach( (lcList, groupId) => {
@@ -1447,100 +1451,101 @@ export class Wayfinding {
1447
1451
 
1448
1452
  _getFixPointInArea(point) {
1449
1453
  let floorData = this.floorData.get(point.properties.level);
1450
-
1451
- // If point is located without accessible area, do nothing
1452
- let areaList = floorData.areas;
1453
- for (let index in areaList) {
1454
- let polygon = areaList[index];
1455
- if (turf.booleanContains(polygon, point)) {
1456
- return point;
1454
+ if (floorData) {
1455
+ // If point is located without accessible area, do nothing
1456
+ let areaList = floorData.areas;
1457
+ for (let index in areaList) {
1458
+ let polygon = areaList[index];
1459
+ if (turf.booleanContains(polygon, point)) {
1460
+ return point;
1461
+ }
1457
1462
  }
1458
- }
1459
1463
 
1460
- // Find nearest wall to stick to
1461
- let bestWall = null;
1462
- let bestWallDistance = Infinity;
1463
- floorData.wallFeatures.forEach(wall => {
1464
- let distance = turf.pointToLineDistance(point.geometry.coordinates, wall, {units: 'meters'});
1465
- if (distance < bestWallDistance) {
1466
- bestWall = wall;
1467
- bestWallDistance = distance;
1468
- }
1469
- });
1464
+ // Find nearest wall to stick to
1465
+ let bestWall = null;
1466
+ let bestWallDistance = Infinity;
1467
+ floorData.wallFeatures.forEach(wall => {
1468
+ let distance = turf.pointToLineDistance(point.geometry.coordinates, wall, {units: 'meters'});
1469
+ if (distance < bestWallDistance) {
1470
+ bestWall = wall;
1471
+ bestWallDistance = distance;
1472
+ }
1473
+ });
1470
1474
 
1471
- let levelCorridorFeatures = this.corridorLineFeatures.filter(corridorLine => corridorLine.properties.level === point.properties.level);
1472
- let bestCorridorIndex = null;
1473
- let bestCorridorDistance = Infinity;
1474
- levelCorridorFeatures.forEach(corridor => {
1475
- let corridorIndex = this.corridorLineFeatures.indexOf(corridor);
1476
- let corridorDistance = turf.pointToLineDistance(point.geometry.coordinates, corridor, {units: 'meters'});
1477
- if (corridorDistance < bestCorridorDistance) {
1478
- bestCorridorIndex = corridorIndex;
1479
- bestCorridorDistance = corridorDistance;
1480
- }
1481
- });
1475
+ let levelCorridorFeatures = this.corridorLineFeatures.filter(corridorLine => corridorLine.properties.level === point.properties.level);
1476
+ let bestCorridorIndex = null;
1477
+ let bestCorridorDistance = Infinity;
1478
+ levelCorridorFeatures.forEach(corridor => {
1479
+ let corridorIndex = this.corridorLineFeatures.indexOf(corridor);
1480
+ let corridorDistance = turf.pointToLineDistance(point.geometry.coordinates, corridor, {units: 'meters'});
1481
+ if (corridorDistance < bestCorridorDistance) {
1482
+ bestCorridorIndex = corridorIndex;
1483
+ bestCorridorDistance = corridorDistance;
1484
+ }
1485
+ });
1482
1486
 
1483
- // Test if area or corridor is closer, create appropriate fixed point
1484
- if (bestWall === null && bestCorridorIndex === null) {
1485
- // could not find neither close area or corridor
1486
- return point;
1487
- } else {
1488
- let fixedPoint;
1487
+ // Test if area or corridor is closer, create appropriate fixed point
1488
+ if (bestWall === null && bestCorridorIndex === null) {
1489
+ // could not find neither close area or corridor
1490
+ return point;
1491
+ } else {
1492
+ let fixedPoint;
1489
1493
 
1490
- // Corridor is closer
1491
- if (bestCorridorIndex !== undefined && bestCorridorDistance < bestWallDistance) {
1494
+ // Corridor is closer
1495
+ if (bestCorridorIndex !== undefined && bestCorridorDistance < bestWallDistance) {
1492
1496
 
1493
- // Create fixed point on line itself
1494
- let line = this.corridorLineFeatures[bestCorridorIndex];
1495
- fixedPoint = turf.nearestPointOnLine(line, point);
1497
+ // Create fixed point on line itself
1498
+ let line = this.corridorLineFeatures[bestCorridorIndex];
1499
+ fixedPoint = turf.nearestPointOnLine(line, point);
1496
1500
 
1497
- // Mark this fixed point is on corridor, preset neighbours
1498
- fixedPoint.properties.onCorridor = true;
1499
- fixedPoint.properties.corridorIndex = bestCorridorIndex;
1500
- if (!fixedPoint.properties.neighbours) {
1501
- fixedPoint.properties.neighbours = [];
1502
- }
1503
- if (this.corridorLineFeatures[bestCorridorIndex].properties.bidirectional != false) {
1504
- fixedPoint.properties.neighbours.push(this.corridorLinePointPairs[bestCorridorIndex][0], this.corridorLinePointPairs[bestCorridorIndex][1]);
1505
- fixedPoint.properties.neighbours.push(...line.properties.intersectionPointList);
1506
- fixedPoint.properties.neighboursLeadingTo = [
1507
- this.corridorLinePointPairs[bestCorridorIndex][0],
1508
- this.corridorLinePointPairs[bestCorridorIndex][1],
1509
- ...line.properties.intersectionPointList
1510
- ];
1511
- } else if (this.corridorLineFeatures[bestCorridorIndex].properties.swapDirection != true) {
1512
- fixedPoint.properties.neighbours.push(this.corridorLinePointPairs[bestCorridorIndex][0]);
1513
- // include only intersection points after this point
1514
- let distance = this._distance(fixedPoint, this.corridorLinePointPairs[bestCorridorIndex][0]);
1515
- let pointsBefore = line.properties.intersectionPointList.filter(point => this._distance(point, this.corridorLinePointPairs[bestCorridorIndex][0]) < distance);
1516
- let pointsAfter = line.properties.intersectionPointList.filter(point => this._distance(point, this.corridorLinePointPairs[bestCorridorIndex][0]) >= distance);
1517
- fixedPoint.properties.neighbours.push(...pointsAfter);
1518
- fixedPoint.properties.neighboursLeadingTo = pointsBefore;
1519
- } else {
1520
- fixedPoint.properties.neighbours.push(this.corridorLinePointPairs[bestCorridorIndex][1]);
1521
- // include only intersection points before this point
1522
- let distance = this._distance(fixedPoint, this.corridorLinePointPairs[bestCorridorIndex][0]);
1523
- let pointsBefore = line.properties.intersectionPointList.filter(point => this._distance(point, this.corridorLinePointPairs[bestCorridorIndex][0]) <= distance);
1524
- let pointsAfter = line.properties.intersectionPointList.filter(point => this._distance(point, this.corridorLinePointPairs[bestCorridorIndex][0]) > distance);
1525
- fixedPoint.properties.neighbours.push(...pointsBefore);
1526
- fixedPoint.properties.neighboursLeadingTo = pointsAfter;
1527
- }
1501
+ // Mark this fixed point is on corridor, preset neighbours
1502
+ fixedPoint.properties.onCorridor = true;
1503
+ fixedPoint.properties.corridorIndex = bestCorridorIndex;
1504
+ if (!fixedPoint.properties.neighbours) {
1505
+ fixedPoint.properties.neighbours = [];
1506
+ }
1507
+ if (this.corridorLineFeatures[bestCorridorIndex].properties.bidirectional != false) {
1508
+ fixedPoint.properties.neighbours.push(this.corridorLinePointPairs[bestCorridorIndex][0], this.corridorLinePointPairs[bestCorridorIndex][1]);
1509
+ fixedPoint.properties.neighbours.push(...line.properties.intersectionPointList);
1510
+ fixedPoint.properties.neighboursLeadingTo = [
1511
+ this.corridorLinePointPairs[bestCorridorIndex][0],
1512
+ this.corridorLinePointPairs[bestCorridorIndex][1],
1513
+ ...line.properties.intersectionPointList
1514
+ ];
1515
+ } else if (this.corridorLineFeatures[bestCorridorIndex].properties.swapDirection != true) {
1516
+ fixedPoint.properties.neighbours.push(this.corridorLinePointPairs[bestCorridorIndex][0]);
1517
+ // include only intersection points after this point
1518
+ let distance = this._distance(fixedPoint, this.corridorLinePointPairs[bestCorridorIndex][0]);
1519
+ let pointsBefore = line.properties.intersectionPointList.filter(point => this._distance(point, this.corridorLinePointPairs[bestCorridorIndex][0]) < distance);
1520
+ let pointsAfter = line.properties.intersectionPointList.filter(point => this._distance(point, this.corridorLinePointPairs[bestCorridorIndex][0]) >= distance);
1521
+ fixedPoint.properties.neighbours.push(...pointsAfter);
1522
+ fixedPoint.properties.neighboursLeadingTo = pointsBefore;
1523
+ } else {
1524
+ fixedPoint.properties.neighbours.push(this.corridorLinePointPairs[bestCorridorIndex][1]);
1525
+ // include only intersection points before this point
1526
+ let distance = this._distance(fixedPoint, this.corridorLinePointPairs[bestCorridorIndex][0]);
1527
+ let pointsBefore = line.properties.intersectionPointList.filter(point => this._distance(point, this.corridorLinePointPairs[bestCorridorIndex][0]) <= distance);
1528
+ let pointsAfter = line.properties.intersectionPointList.filter(point => this._distance(point, this.corridorLinePointPairs[bestCorridorIndex][0]) > distance);
1529
+ fixedPoint.properties.neighbours.push(...pointsBefore);
1530
+ fixedPoint.properties.neighboursLeadingTo = pointsAfter;
1531
+ }
1528
1532
 
1529
- // Wall is closer
1530
- } else if (bestWall !== null) {
1533
+ // Wall is closer
1534
+ } else if (bestWall !== null) {
1531
1535
 
1532
- // Create fixed point inside area
1533
- let nearestPoint = turf.nearestPointOnLine(bestWall, point);
1534
- let bearing = turf.bearing(point, nearestPoint);
1535
- fixedPoint = turf.destination(point.geometry.coordinates, bestWallDistance + 0.05, bearing, {units: 'meters'});
1536
- }
1536
+ // Create fixed point inside area
1537
+ let nearestPoint = turf.nearestPointOnLine(bestWall, point);
1538
+ let bearing = turf.bearing(point, nearestPoint);
1539
+ fixedPoint = turf.destination(point.geometry.coordinates, bestWallDistance + 0.05, bearing, {units: 'meters'});
1540
+ }
1537
1541
 
1538
- // Mark level of fixed point
1539
- fixedPoint.properties.level = point.properties.level;
1542
+ // Mark level of fixed point
1543
+ fixedPoint.properties.level = point.properties.level;
1540
1544
 
1541
- // Return created point
1542
- return fixedPoint;
1545
+ // Return created point
1546
+ return fixedPoint;
1543
1547
 
1548
+ }
1544
1549
  }
1545
1550
  }
1546
1551
 
@@ -0,0 +1,8 @@
1
+ export default class BaseLogger {
2
+ id: string;
3
+ organization_id: string;
4
+ organization_name?: string;
5
+ visitor_id: string;
6
+ createdAt: Date;
7
+ constructor(data: any);
8
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var uuid_1 = require("uuid");
4
+ var BaseLogger = /** @class */ (function () {
5
+ function BaseLogger(data) {
6
+ this.id = data.id ? data.id : uuid_1.v4() + ":" + uuid_1.v4();
7
+ this.organization_id = data.organization_id;
8
+ this.organization_name = data.organization_name;
9
+ this.visitor_id = data.visitor_id ? data.visitor_id : uuid_1.v4();
10
+ this.createdAt = data.createdAt ? data.createdAt : new Date();
11
+ }
12
+ return BaseLogger;
13
+ }());
14
+ exports.default = BaseLogger;
@@ -0,0 +1,8 @@
1
+ export default class BaseLogger {
2
+ id: string;
3
+ organization_id: string;
4
+ organization_name?: string;
5
+ visitor_id: string;
6
+ createdAt: Date;
7
+ constructor(data: any);
8
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var common_1 = require("../../common");
4
+ var BaseLogger = /** @class */ (function () {
5
+ function BaseLogger(data) {
6
+ this.id = data.id ? data.id : common_1.uuidv4 + ":" + common_1.uuidv4;
7
+ this.organization_id = data.organization_id;
8
+ this.organization_name = data.organization_name;
9
+ this.visitor_id = data.visitor_id ? data.visitor_id : "" + common_1.uuidv4;
10
+ this.createdAt = data.createdAt ? data.createdAt : new Date();
11
+ }
12
+ return BaseLogger;
13
+ }());
14
+ exports.default = BaseLogger;
@@ -0,0 +1,25 @@
1
+ import BaseLogger from './base';
2
+ export default class WayfindingLogger extends BaseLogger {
3
+ startLngLat: [number, number];
4
+ startLevel: number;
5
+ startSegmentId?: string;
6
+ startSegmentName?: string;
7
+ startGeofenceId?: string;
8
+ startGeofenceName?: string;
9
+ destinationFeatureId?: string;
10
+ destinationName?: string;
11
+ destinationLngLat: [number, number];
12
+ destinationLevel: number;
13
+ foundPath: boolean;
14
+ optionAvoidBarrier: boolean;
15
+ optionAvoidElevators: boolean;
16
+ optionAvoidEscalators: boolean;
17
+ optionAvoidNarrowPaths: boolean;
18
+ optionAvoidRamps: boolean;
19
+ optionAvoidStaircases: boolean;
20
+ optionAvoidTicketGates: boolean;
21
+ route: [number, number, number][];
22
+ rerouted?: boolean;
23
+ constructor(data: any);
24
+ save(): Promise<void>;
25
+ }
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (_) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ var common_1 = require("../../common");
55
+ var base_1 = require("./base");
56
+ var WayfindingLogger = /** @class */ (function (_super) {
57
+ __extends(WayfindingLogger, _super);
58
+ function WayfindingLogger(data) {
59
+ var _this = _super.call(this, data) || this;
60
+ _this.startLngLat = data.startLngLat;
61
+ _this.startLevel = data.startLevel;
62
+ _this.startSegmentId = data.startSegmentId;
63
+ _this.startSegmentName = data.startSegmentName;
64
+ _this.startGeofenceId = data.startGeofenceId;
65
+ _this.startGeofenceName = data.startGeofenceName;
66
+ _this.destinationFeatureId = data.destinationFeatureId;
67
+ _this.destinationName = data.destinationName;
68
+ _this.destinationLngLat = data.destinationLngLat;
69
+ _this.destinationLevel = data.destinationLevel;
70
+ _this.foundPath = data.foundPath;
71
+ _this.optionAvoidBarrier = data.optionAvoidBarrier;
72
+ _this.optionAvoidElevators = data.optionAvoidElevators;
73
+ _this.optionAvoidEscalators = data.optionAvoidEscalators;
74
+ _this.optionAvoidNarrowPaths = data.optionAvoidNarrowPaths;
75
+ _this.optionAvoidRamps = data.optionAvoidRamps;
76
+ _this.optionAvoidStaircases = data.optionAvoidStaircases;
77
+ _this.optionAvoidTicketGates = data.optionAvoidTicketGates;
78
+ _this.route = data.route;
79
+ _this.rerouted = data.rerouted;
80
+ return _this;
81
+ }
82
+ WayfindingLogger.prototype.save = function () {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var e_1;
85
+ return __generator(this, function (_a) {
86
+ switch (_a.label) {
87
+ case 0:
88
+ _a.trys.push([0, 2, , 3]);
89
+ return [4 /*yield*/, common_1.axios.post("v6/geo/wayfinding_logs", [this])];
90
+ case 1:
91
+ _a.sent();
92
+ return [3 /*break*/, 3];
93
+ case 2:
94
+ e_1 = _a.sent();
95
+ console.log("Log saving failed, " + e_1.message);
96
+ return [3 /*break*/, 3];
97
+ case 3: return [2 /*return*/];
98
+ }
99
+ });
100
+ });
101
+ };
102
+ return WayfindingLogger;
103
+ }(base_1.default));
104
+ exports.default = WayfindingLogger;
@@ -25,6 +25,7 @@ interface State {
25
25
  readonly noPlaces: boolean;
26
26
  readonly textNavigation: any;
27
27
  readonly persons: PersonModel[];
28
+ readonly user: any;
28
29
  }
29
30
  interface Options {
30
31
  selector?: string;
@@ -56,6 +57,13 @@ interface Options {
56
57
  beforeLayer?: string;
57
58
  attribution?: string;
58
59
  };
60
+ handleUrlParams?: boolean;
61
+ urlParams?: {
62
+ startFeauture?: string;
63
+ destinationFeature?: string;
64
+ defaultPlace?: string;
65
+ };
66
+ useGpsLocation?: boolean;
59
67
  }
60
68
  interface PaddingOptions {
61
69
  bottom: number;
@@ -104,6 +112,7 @@ export declare class Map {
104
112
  private onMapReady;
105
113
  private initKiosk;
106
114
  private onSetKiosk;
115
+ private initGeoLocation;
107
116
  private initDirectionIcon;
108
117
  private initAnimatedRoute;
109
118
  private initRasterTiles;
@@ -113,6 +122,7 @@ export declare class Map {
113
122
  private onShopMouseEnter;
114
123
  private onShopMouseMove;
115
124
  private onShopMouseLeave;
125
+ private initUrlParams;
116
126
  private featureDialog;
117
127
  private onAddNewFeature;
118
128
  private onUpdateFeature;