proximiio-js-library 1.11.2 → 1.11.4
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 +1 -0
- package/assets/wayfinding.js +16 -9
- package/lib/assets/wayfinding.js +1 -1
- package/lib/components/map/main.d.ts +1 -0
- package/lib/components/map/main.js +2 -1
- package/lib/proximiio.js +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -126,6 +126,7 @@ const map = new Proximiio.Map({
|
|
|
126
126
|
enableTBTNavigation: true, // optional, you'll receive turn-by-turn text navigation object in found route listener response, default: true
|
|
127
127
|
mapboxOptions: { MapboxOptions }, // optional, you can pass mapbox initial options like center or zoom here, all options can be found at https://docs.mapbox.com/mapbox-gl-js/api/map/
|
|
128
128
|
defaultPlaceId: 'my_place_id', // optional, you can specify default place, if not specified the first place found will be used as default
|
|
129
|
+
defaultFloorLevel: 0, // optional, you can specify default level, if not specified the first floor found will be used as default
|
|
129
130
|
zoomIntoPlace: false // optional, the map will center and zoom into the default place location, default: true
|
|
130
131
|
isKiosk: false, // optional, this will enable kiosk like behavior for the map (will add dot at spiecified coordinates in kioskSettings and this point will be set as a starting point for generated routes)
|
|
131
132
|
kioskSettings: {
|
package/assets/wayfinding.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {
|
|
2
|
+
featureCollection as TurfFeatureCollection,
|
|
3
|
+
point as TurfPoint,
|
|
4
|
+
lineString as TurfLineString,
|
|
5
|
+
} from '@turf/helpers';
|
|
6
|
+
import { default as TurfFlatten } from '@turf/flatten';
|
|
7
|
+
import { polygonToLine as TurfPolygonToLine } from '@turf/polygon-to-line';
|
|
8
|
+
import { default as TurfBooleanContains } from '@turf/boolean-contains';
|
|
9
|
+
import { default as TurfDestination } from '@turf/destination';
|
|
6
10
|
import * as TurfLineIntersect from '@turf/line-intersect';
|
|
7
|
-
import
|
|
11
|
+
import { default as TurfBearing } from '@turf/bearing';
|
|
8
12
|
import * as TurfMidpoint from '@turf/midpoint';
|
|
9
13
|
import * as TurfPointToLineDistance from '@turf/point-to-line-distance';
|
|
10
14
|
import * as TurfDistance from '@turf/distance';
|
|
@@ -171,8 +175,9 @@ export class Wayfinding {
|
|
|
171
175
|
|
|
172
176
|
// Floor features == "walkable areas"
|
|
173
177
|
floor.features.forEach((walkableArea) => {
|
|
174
|
-
let wallLineStringList = TurfFlatten(TurfPolygonToLine(walkableArea))
|
|
175
|
-
|
|
178
|
+
let wallLineStringList = TurfFlatten(TurfPolygonToLine(walkableArea)).features.map(
|
|
179
|
+
(feature) => feature.geometry,
|
|
180
|
+
);
|
|
176
181
|
// Floor wall lines, we wish to split to individual walls
|
|
177
182
|
wallLineStringList.forEach((wallLineString) => {
|
|
178
183
|
let firstPoint;
|
|
@@ -1855,7 +1860,9 @@ export class Wayfinding {
|
|
|
1855
1860
|
let bestCorridorDistance = Infinity;
|
|
1856
1861
|
levelCorridorFeatures.forEach((corridor) => {
|
|
1857
1862
|
let corridorIndex = this.corridorLineFeatures.indexOf(corridor);
|
|
1858
|
-
let corridorDistance = TurfPointToLineDistance.default(point.geometry.coordinates, corridor, {
|
|
1863
|
+
let corridorDistance = TurfPointToLineDistance.default(point.geometry.coordinates, corridor, {
|
|
1864
|
+
units: this.UNIT_TYPE,
|
|
1865
|
+
});
|
|
1859
1866
|
if (corridorDistance < bestCorridorDistance) {
|
|
1860
1867
|
bestCorridorIndex = corridorIndex;
|
|
1861
1868
|
bestCorridorDistance = corridorDistance;
|
package/lib/assets/wayfinding.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{featureCollection as TurfFeatureCollection,point as TurfPoint,lineString as TurfLineString}from"@turf/helpers";import
|
|
1
|
+
import{featureCollection as TurfFeatureCollection,point as TurfPoint,lineString as TurfLineString}from"@turf/helpers";import{default as TurfFlatten}from"@turf/flatten";import{polygonToLine as TurfPolygonToLine}from"@turf/polygon-to-line";import{default as TurfBooleanContains}from"@turf/boolean-contains";import{default as TurfDestination}from"@turf/destination";import*as TurfLineIntersect from"@turf/line-intersect";import{default as TurfBearing}from"@turf/bearing";import*as TurfMidpoint from"@turf/midpoint";import*as TurfPointToLineDistance from"@turf/point-to-line-distance";import*as TurfDistance from"@turf/distance";import*as TurfNearestPointOnLine from"@turf/nearest-point-on-line";export class Wayfinding{configuration={avoidElevators:!1,avoidEscalators:!1,avoidStaircases:!1,avoidRamps:!1,avoidNarrowPaths:!1,avoidRevolvingDoors:!1,avoidTicketGates:!1,avoidBarriers:!1,avoidHills:!1};POI_TYPE={ELEVATOR:"elevator",ESCALATOR:"escalator",STAIRCASE:"staircase",RAMP:"ramp",HILL:"hill",NARROW_PATH:"narrow_path",REVOLVING_DOOR:"door",TICKET_GATE:"ticket_gate",BARRIER:"barrier"};ACCESSIBILITY_POI_TYPE=["door","ticket_gate"];LEVEL_CHANGER_TYPE=["elevator","escalator","staircase","ramp","hill"];PATH_TYPE="path";LINE_STRING_TYPE="LineString";DIRECTION_UP="up";DIRECTION_DOWN="down";ROUTABLE_TYPE=["MultiPolygon","Polygon"];UNIT_TYPE="meters";pathFixDistance=1;// meters
|
|
2
2
|
wallOffsetDistance=.5;// meters
|
|
3
3
|
walkingSpeed=1.4;// meters / second
|
|
4
4
|
floorHeight=4.5;// meters
|
|
@@ -85,6 +85,7 @@ export class Map {
|
|
|
85
85
|
newFeatureModalEvent: 'click',
|
|
86
86
|
enableTBTNavigation: true,
|
|
87
87
|
zoomIntoPlace: true,
|
|
88
|
+
defaultFloorLevel: 0,
|
|
88
89
|
isKiosk: false,
|
|
89
90
|
initPolygons: false,
|
|
90
91
|
polygonsOptions: {
|
|
@@ -520,7 +521,7 @@ export class Map {
|
|
|
520
521
|
this.updateImages();
|
|
521
522
|
this.filteredAmenities = this.amenityIds;
|
|
522
523
|
this.imageSourceManager.setLevel(map, (_b = this.state.floor) === null || _b === void 0 ? void 0 : _b.level, this.state);
|
|
523
|
-
yield this.onPlaceSelect(this.state.place, this.defaultOptions.zoomIntoPlace);
|
|
524
|
+
yield this.onPlaceSelect(this.state.place, this.defaultOptions.zoomIntoPlace, this.defaultOptions.defaultFloorLevel);
|
|
524
525
|
if (this.defaultOptions.useRasterTiles) {
|
|
525
526
|
this.initRasterTiles();
|
|
526
527
|
}
|