@wemap/routers 14.5.2 → 14.5.5

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/dist/index.js CHANGED
@@ -852,27 +852,25 @@ var Logger = _Logger, SKIP_STEP_ANGLE_MAX = deg2rad(20), StepsBuilder = class {
852
852
  for (let n = 0; n < e.vertices.length - 1; n++) {
853
853
  let i = e.vertices[n], l = i.coords, u = e.vertices[n + 1], d = u.coords, f = e.edges[n], p = i.bearingTo(u), m = diffAngle(s, p + Math.PI), h = t.length ? t[t.length - 1] : null, g = n > 0 ? e.edges[n - 1] : null, _ = OsmTagsUtils.isGate(i.rawTags), v = OsmTagsUtils.isTurnstile(i.rawTags), y = OsmTagsUtils.isTactilePaving(f.rawTags), b = g ? OsmTagsUtils.isTactilePaving(g.rawTags) : !1, x = y && !b ? "entrance" : !y && b ? "exit" : void 0, S = OsmTagsUtils.isFunicular(f.rawTags), C = g ? OsmTagsUtils.isFunicular(g.rawTags) : !1, w = S && !C ? "entrance" : !S && C ? "exit" : void 0, { isElevator: T, areEscalators: E, areStairs: D, isMovingWalkway: O, incline: k } = f.properties, A;
854
854
  (D || T) && k && (h?.levelDifference === null || h?.levelDifference === void 0) && (A = k);
855
- let ee = g?.properties || {};
856
- ee.incline && ee.areStairs;
857
- let j = OsmTagsUtils.isSubwayEntrance(i.rawTags), N = OsmTagsUtils.isEntrance(i.rawTags), P = N || j, F;
858
- if (N) {
855
+ let ee = g?.properties || {}, j = !!(ee.incline && ee.areStairs && (!k || !D)), N = OsmTagsUtils.isSubwayEntrance(i.rawTags), P = OsmTagsUtils.isEntrance(i.rawTags), F = P || N, I;
856
+ if (P) {
859
857
  if (n > 0) {
860
858
  let t = e.vertices[n - 1].coords.level, r = d.level;
861
- t === null && r !== null ? F = "entrance" : t !== null && r === null && (F = "exit");
859
+ t === null && r !== null ? I = "entrance" : t !== null && r === null && (I = "exit");
862
860
  }
863
- F ||= a.level === null ? "exit" : "entrance";
861
+ I ||= a.level === null ? "exit" : "entrance";
864
862
  }
865
- let I = f.properties.name || i.properties.name || OsmTagsUtils.getRef(i.rawTags), L = e.edgesWeights[n], te = Math.abs(diffAngle(Math.PI, m)) >= SKIP_STEP_ANGLE_MAX, R = Level.isRange(f.level) && !Level.isRange(l.level) || A;
866
- te &&= !(l.level && Level.isRange(l.level));
867
- let B = !!(R || P || w || v), V = B || x || te && g?.length !== 0;
868
- if (!o || V) {
863
+ let L = f.properties.name || i.properties.name || OsmTagsUtils.getRef(i.rawTags), te = e.edgesWeights[n], R = Math.abs(diffAngle(Math.PI, m)) >= SKIP_STEP_ANGLE_MAX, B = Level.isRange(f.level) && !Level.isRange(l.level) || A;
864
+ R &&= !(l.level && Level.isRange(l.level));
865
+ let V = isStepLevelChange(h) && !Level.isRange(l.level) || j, H = !!(B || V || F || w || v || _), ne = H || x || R && g?.length !== 0;
866
+ if (!o || ne) {
869
867
  let e = null, i = null, a = null;
870
- T ? a = "elevator" : E ? a = "escalator" : D ? a = "stairs" : j ? a = "subway-entrance" : _ ? a = "gate" : v ? a = "turnstile" : O ? a = "moving-walkway" : R ? a = "incline-plane" : F ? a = F : n > 0 && (a = "turn");
868
+ T ? a = "elevator" : E ? a = "escalator" : D ? a = "stairs" : N ? a = "subway-entrance" : _ ? a = "gate" : v ? a = "turnstile" : O ? a = "moving-walkway" : B ? a = "incline-plane" : I ? a = I : n > 0 && (a = "turn");
871
869
  let s = getDirectionFromAngle(m);
872
- R && (e = Level.diff(l.level, d.level) || 0, i = l.level + e, s = e > 0 ? "up" : "down", A && (s = A)), o = {
870
+ B && (e = Level.diff(l.level, d.level) || 0, i = l.level + e, s = e > 0 ? "up" : "down", A && (s = A)), o = {
873
871
  coords: l,
874
- ...I && { name: I },
875
- important: B,
872
+ ...L && { name: L },
873
+ important: H,
876
874
  type: a,
877
875
  direction: s,
878
876
  levelDifference: e,
@@ -883,7 +881,7 @@ var Logger = _Logger, SKIP_STEP_ANGLE_MAX = deg2rad(20), StepsBuilder = class {
883
881
  duration: 0
884
882
  }, t.push(o);
885
883
  }
886
- o.distance += l.distanceTo(d), o.duration += L, s = p;
884
+ o.distance += l.distanceTo(d), o.duration += te, s = p;
887
885
  }
888
886
  let l = e.vertices[e.vertices.length - 1].coords;
889
887
  return Coordinates.equals(l, a) || t.push({
@@ -1 +1 @@
1
- {"version":3,"file":"StepsBuilder.d.ts","sourceRoot":"","sources":["../../../src/model/StepsBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,YAAY,CAAC;AAK9D,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAY,MAAM,QAAQ,CAAC;AAG1D,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAI7C,MAAM,CAAC,OAAO,OAAO,YAAY;IAE7B,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,GAAG,CAA4B;IACvC,OAAO,CAAC,UAAU,CAA8B;IAChD,OAAO,CAAC,SAAS,CAAqB;IAEtC,QAAQ,CAAC,KAAK,EAAE,WAAW;IAK3B,MAAM,CAAC,GAAG,EAAE,WAAW;IAKvB,aAAa,CAAC,UAAU,EAAE,WAAW,EAAE;IAKvC,YAAY,CAAC,SAAS,EAAE,WAAW,EAAE;IAKrC,WAAW,CAAC,QAAQ,EAAE,WAAW;IAKjC,aAAa,CAAC,UAAU,EAAE,UAAU;IAuKpC,KAAK,IAAI,IAAI,EAAE;CA6GlB"}
1
+ {"version":3,"file":"StepsBuilder.d.ts","sourceRoot":"","sources":["../../../src/model/StepsBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,YAAY,CAAC;AAK9D,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAA2B,MAAM,QAAQ,CAAC;AAGzE,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAI7C,MAAM,CAAC,OAAO,OAAO,YAAY;IAE7B,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,GAAG,CAA4B;IACvC,OAAO,CAAC,UAAU,CAA8B;IAChD,OAAO,CAAC,SAAS,CAAqB;IAEtC,QAAQ,CAAC,KAAK,EAAE,WAAW;IAK3B,MAAM,CAAC,GAAG,EAAE,WAAW;IAKvB,aAAa,CAAC,UAAU,EAAE,WAAW,EAAE;IAKvC,YAAY,CAAC,SAAS,EAAE,WAAW,EAAE;IAKrC,WAAW,CAAC,QAAQ,EAAE,WAAW;IAKjC,aAAa,CAAC,UAAU,EAAE,UAAU;IAuKpC,KAAK,IAAI,IAAI,EAAE;CA6GlB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wemap/routers",
3
- "version": "14.5.2",
3
+ "version": "14.5.5",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -23,9 +23,9 @@
23
23
  "@turf/convex": "^6.5.0",
24
24
  "@turf/helpers": "^6.5.0",
25
25
  "@types/mapbox__polyline": "^1.0.2",
26
- "@wemap/core": "14.5.2",
27
- "@wemap/geo": "14.5.2",
28
- "@wemap/osm": "14.5.2",
26
+ "@wemap/core": "14.5.5",
27
+ "@wemap/geo": "14.5.5",
28
+ "@wemap/osm": "14.5.5",
29
29
  "@wemap/salesman.js": "^2.1.0"
30
30
  },
31
31
  "devDependencies": {