@wemap/routers 12.8.8 → 12.8.9

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.mjs CHANGED
@@ -447,7 +447,7 @@ class StepsBuilder {
447
447
  const forceEndOfLevelChange = Boolean(
448
448
  previousEdgeProperties.incline && previousEdgeProperties.areStairs && (!incline || !areStairs)
449
449
  );
450
- const createNewStep = vertex.properties.isSubwayEntrance;
450
+ const isEntrance = vertex.properties.isSubwayEntrance;
451
451
  const stepName = edge.properties.name || null;
452
452
  const duration = graphRoute.edgesWeights[i];
453
453
  const stepExtras = {
@@ -459,7 +459,7 @@ class StepsBuilder {
459
459
  const splitByLevel = Level.isRange(edge.level) && !Level.isRange(currentCoords.level) || forceLevelChange;
460
460
  splitByAngle = splitByAngle && !(currentCoords.level && Level.isRange(currentCoords.level));
461
461
  const splitByEndOfLevelChange = (previousStep == null ? void 0 : previousStep.levelChange) && !Level.isRange(currentCoords.level) || forceEndOfLevelChange;
462
- const splitStepCondition = splitByAngle || splitByLevel || splitByEndOfLevelChange || createNewStep;
462
+ const splitStepCondition = splitByAngle || splitByLevel || splitByEndOfLevelChange || isEntrance;
463
463
  if (isFirstStep || splitStepCondition) {
464
464
  let levelChange;
465
465
  if (splitByLevel) {
@@ -2786,7 +2786,10 @@ const _OsmGraphUtils = class _OsmGraphUtils {
2786
2786
  })) == null ? void 0 : _a[1]) || null;
2787
2787
  if (vertex) {
2788
2788
  if (!Level.equals(vertex.coords.level, nodeLevel)) {
2789
- vertex.coords.level = Level.intersection(vertex.coords.level, nodeLevel) || nodeLevel;
2789
+ vertex.coords.level = Level.intersection(vertex.coords.level, nodeLevel);
2790
+ if (vertex.coords.level === null) {
2791
+ vertex.coords.level = nodeLevel;
2792
+ }
2790
2793
  }
2791
2794
  return vertex;
2792
2795
  }