proximiio-js-library 1.13.39 → 1.13.41
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/lib/components/map/main.d.ts +32 -1
- package/lib/components/map/main.js +47 -6
- package/lib/proximiio.js +1 -1
- package/package.json +1 -1
|
@@ -150,6 +150,7 @@ export interface Options {
|
|
|
150
150
|
lineProgress?: boolean;
|
|
151
151
|
showTailSegment?: boolean;
|
|
152
152
|
showCompassDirection?: boolean;
|
|
153
|
+
stepChangeThreshold?: number;
|
|
153
154
|
};
|
|
154
155
|
useRasterTiles?: boolean;
|
|
155
156
|
rasterTilesOptions?: {
|
|
@@ -199,6 +200,7 @@ export interface Options {
|
|
|
199
200
|
autoRestartAnimationAfterFloorChange?: boolean;
|
|
200
201
|
poiIconSize?: (string | number | string[])[] | number | any;
|
|
201
202
|
disableUnavailablePois?: boolean;
|
|
203
|
+
arrivalThreshold?: number;
|
|
202
204
|
}
|
|
203
205
|
export interface PaddingOptions {
|
|
204
206
|
bottom: number;
|
|
@@ -233,6 +235,8 @@ export declare class Map {
|
|
|
233
235
|
private onPersonUpdateListener;
|
|
234
236
|
private onStepSetListener;
|
|
235
237
|
private onStopSetListener;
|
|
238
|
+
private onPositionSetListener;
|
|
239
|
+
private onArrivalListener;
|
|
236
240
|
private defaultOptions;
|
|
237
241
|
private routeFactory;
|
|
238
242
|
private startPoint?;
|
|
@@ -1420,10 +1424,12 @@ export declare class Map {
|
|
|
1420
1424
|
* map.onSetCustomPosition({ coordinates: [17.833135351538658, 48.60678469647394], level: 0});
|
|
1421
1425
|
* });
|
|
1422
1426
|
*/
|
|
1423
|
-
setCustomPosition({ coordinates, level, recenter, }: {
|
|
1427
|
+
setCustomPosition({ coordinates, level, recenter, iconSize, arrowSize, }: {
|
|
1424
1428
|
coordinates: [number, number];
|
|
1425
1429
|
level: number;
|
|
1426
1430
|
recenter?: boolean;
|
|
1431
|
+
iconSize?: number;
|
|
1432
|
+
arrowSize?: number;
|
|
1427
1433
|
}): void;
|
|
1428
1434
|
/**
|
|
1429
1435
|
* Method for setting custom position
|
|
@@ -1452,4 +1458,29 @@ export declare class Map {
|
|
|
1452
1458
|
* });
|
|
1453
1459
|
*/
|
|
1454
1460
|
cancelCustomPosition(): void;
|
|
1461
|
+
/**
|
|
1462
|
+
* @memberof Map
|
|
1463
|
+
* @name getPositionSetListener
|
|
1464
|
+
* @returns returns position set listener
|
|
1465
|
+
* @example
|
|
1466
|
+
* const map = new Proximiio.Map();
|
|
1467
|
+
* map.getPositionSetListener().subscribe({coordinates, level} => {
|
|
1468
|
+
* console.log('custom position set', coordinates, level);
|
|
1469
|
+
* });
|
|
1470
|
+
*/
|
|
1471
|
+
getPositionSetListener(): CustomSubject<{
|
|
1472
|
+
coordinates: number[];
|
|
1473
|
+
level: number;
|
|
1474
|
+
}>;
|
|
1475
|
+
/**
|
|
1476
|
+
* @memberof Map
|
|
1477
|
+
* @name getArrivalListener
|
|
1478
|
+
* @returns returns event when custom position reach the destination
|
|
1479
|
+
* @example
|
|
1480
|
+
* const map = new Proximiio.Map();
|
|
1481
|
+
* map.getArrivalListener().subscribe(() => {
|
|
1482
|
+
* console.log('you have reached your destination');
|
|
1483
|
+
* });
|
|
1484
|
+
*/
|
|
1485
|
+
getArrivalListener(): CustomSubject<boolean>;
|
|
1455
1486
|
}
|
|
@@ -94,6 +94,8 @@ export class Map {
|
|
|
94
94
|
this.onPersonUpdateListener = new CustomSubject();
|
|
95
95
|
this.onStepSetListener = new CustomSubject();
|
|
96
96
|
this.onStopSetListener = new CustomSubject();
|
|
97
|
+
this.onPositionSetListener = new CustomSubject();
|
|
98
|
+
this.onArrivalListener = new CustomSubject();
|
|
97
99
|
this.defaultOptions = {
|
|
98
100
|
selector: 'proximiioMap',
|
|
99
101
|
allowNewFeatureModal: false,
|
|
@@ -211,6 +213,7 @@ export class Map {
|
|
|
211
213
|
lineProgress: false,
|
|
212
214
|
showTailSegment: false,
|
|
213
215
|
showCompassDirection: false,
|
|
216
|
+
stepChangeThreshold: 5,
|
|
214
217
|
},
|
|
215
218
|
useRasterTiles: false,
|
|
216
219
|
handleUrlParams: false,
|
|
@@ -234,6 +237,7 @@ export class Map {
|
|
|
234
237
|
autoLevelChange: false,
|
|
235
238
|
autoRestartAnimationAfterFloorChange: false,
|
|
236
239
|
disableUnavailablePois: false,
|
|
240
|
+
arrivalThreshold: 3,
|
|
237
241
|
// poiIconSize: ['interpolate', ['exponential', 0.5], ['zoom'], 17, 0.1, 22, 0.5],
|
|
238
242
|
};
|
|
239
243
|
this.showStartPoint = false;
|
|
@@ -3708,8 +3712,8 @@ export class Map {
|
|
|
3708
3712
|
setInitialBearing(bearingValue) {
|
|
3709
3713
|
this.routingSource.setInitialBearing(bearingValue);
|
|
3710
3714
|
}
|
|
3711
|
-
onSetCustomPosition({ coordinates, level, recenter = true, }) {
|
|
3712
|
-
var _a;
|
|
3715
|
+
onSetCustomPosition({ coordinates, level, recenter = true, iconSize = 1.5, arrowSize = 1.25, }) {
|
|
3716
|
+
var _a, _b, _c;
|
|
3713
3717
|
// Initialize debounce/cooldown tracking
|
|
3714
3718
|
this.floorChangeBuffer = this.floorChangeBuffer || [];
|
|
3715
3719
|
this.lastFloorChangeTimestamp = this.lastFloorChangeTimestamp || 0;
|
|
@@ -3788,7 +3792,7 @@ export class Map {
|
|
|
3788
3792
|
type: 'symbol',
|
|
3789
3793
|
source: 'custom-position-point',
|
|
3790
3794
|
layout: {
|
|
3791
|
-
'icon-size':
|
|
3795
|
+
'icon-size': iconSize,
|
|
3792
3796
|
'icon-image': 'pulsing-dot',
|
|
3793
3797
|
'icon-allow-overlap': true,
|
|
3794
3798
|
},
|
|
@@ -3801,7 +3805,7 @@ export class Map {
|
|
|
3801
3805
|
source: 'custom-position-point',
|
|
3802
3806
|
layout: {
|
|
3803
3807
|
'icon-image': 'heading-arrow',
|
|
3804
|
-
'icon-size':
|
|
3808
|
+
'icon-size': arrowSize,
|
|
3805
3809
|
'icon-rotate': ['get', 'bearing'],
|
|
3806
3810
|
'icon-rotation-alignment': 'map',
|
|
3807
3811
|
'icon-allow-overlap': true,
|
|
@@ -3822,9 +3826,20 @@ export class Map {
|
|
|
3822
3826
|
userPosition: coordinates,
|
|
3823
3827
|
steps: this.routingSource.steps,
|
|
3824
3828
|
lastKnownStepIndex: this.currentStep,
|
|
3829
|
+
thresholdMeters: this.defaultOptions.routeAnimation.stepChangeThreshold,
|
|
3825
3830
|
});
|
|
3826
3831
|
this.setNavStep(stepIndex);
|
|
3832
|
+
if ((_c = (_b = this.routingSource.finish) === null || _b === void 0 ? void 0 : _b.geometry) === null || _c === void 0 ? void 0 : _c.coordinates) {
|
|
3833
|
+
const distanceToFinish = distance(this.routingSource.finish.geometry.coordinates, point(coordinates)) * 1000;
|
|
3834
|
+
if (distanceToFinish <= this.defaultOptions.arrivalThreshold) {
|
|
3835
|
+
this.onArrivalListener.next(true);
|
|
3836
|
+
}
|
|
3837
|
+
}
|
|
3827
3838
|
}
|
|
3839
|
+
this.onPositionSetListener.next({
|
|
3840
|
+
coordinates,
|
|
3841
|
+
level,
|
|
3842
|
+
});
|
|
3828
3843
|
}
|
|
3829
3844
|
}
|
|
3830
3845
|
onCancelCustomPosition() {
|
|
@@ -5386,8 +5401,8 @@ export class Map {
|
|
|
5386
5401
|
* map.onSetCustomPosition({ coordinates: [17.833135351538658, 48.60678469647394], level: 0});
|
|
5387
5402
|
* });
|
|
5388
5403
|
*/
|
|
5389
|
-
setCustomPosition({ coordinates, level, recenter = true, }) {
|
|
5390
|
-
this.onSetCustomPosition({ coordinates, level, recenter });
|
|
5404
|
+
setCustomPosition({ coordinates, level, recenter = true, iconSize, arrowSize, }) {
|
|
5405
|
+
this.onSetCustomPosition({ coordinates, level, recenter, iconSize, arrowSize });
|
|
5391
5406
|
}
|
|
5392
5407
|
/**
|
|
5393
5408
|
* Method for setting custom position
|
|
@@ -5422,6 +5437,32 @@ export class Map {
|
|
|
5422
5437
|
cancelCustomPosition() {
|
|
5423
5438
|
this.onCancelCustomPosition();
|
|
5424
5439
|
}
|
|
5440
|
+
/**
|
|
5441
|
+
* @memberof Map
|
|
5442
|
+
* @name getPositionSetListener
|
|
5443
|
+
* @returns returns position set listener
|
|
5444
|
+
* @example
|
|
5445
|
+
* const map = new Proximiio.Map();
|
|
5446
|
+
* map.getPositionSetListener().subscribe({coordinates, level} => {
|
|
5447
|
+
* console.log('custom position set', coordinates, level);
|
|
5448
|
+
* });
|
|
5449
|
+
*/
|
|
5450
|
+
getPositionSetListener() {
|
|
5451
|
+
return this.onPositionSetListener;
|
|
5452
|
+
}
|
|
5453
|
+
/**
|
|
5454
|
+
* @memberof Map
|
|
5455
|
+
* @name getArrivalListener
|
|
5456
|
+
* @returns returns event when custom position reach the destination
|
|
5457
|
+
* @example
|
|
5458
|
+
* const map = new Proximiio.Map();
|
|
5459
|
+
* map.getArrivalListener().subscribe(() => {
|
|
5460
|
+
* console.log('you have reached your destination');
|
|
5461
|
+
* });
|
|
5462
|
+
*/
|
|
5463
|
+
getArrivalListener() {
|
|
5464
|
+
return this.onArrivalListener;
|
|
5465
|
+
}
|
|
5425
5466
|
}
|
|
5426
5467
|
/* TODO
|
|
5427
5468
|
* - check clusters
|