@wemap/routers 11.0.2 → 11.0.3

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
@@ -700,7 +700,16 @@ let OsmGraph = _OsmGraph;
700
700
  __publicField(OsmGraph, "HIGHWAYS_PEDESTRIANS", HIGHWAYS_PEDESTRIANS);
701
701
  __publicField(OsmGraph, "DEFAULT_WAY_SELECTOR", DEFAULT_WAY_SELECTOR);
702
702
  const DEFAULT_OPTIONS = Object.assign({}, geo.GeoGraphRouter.DEFAULT_OPTIONS, {
703
- weightEdgeFn: (edge) => edge.data instanceof osm.OsmNode && edge.data.isElevator ? 90 : getDurationFromLength(edge.length)
703
+ weightEdgeFn: (edge) => {
704
+ if (edge.data instanceof osm.OsmNode && edge.data.isElevator) {
705
+ return 90;
706
+ }
707
+ let duration = getDurationFromLength(edge.length, 4);
708
+ if (edge.data instanceof osm.OsmWay && edge.data.areStairs) {
709
+ duration *= 3;
710
+ }
711
+ return duration;
712
+ }
704
713
  });
705
714
  const WITHOUT_STAIRS_OPTIONS = Object.assign({}, DEFAULT_OPTIONS, {
706
715
  acceptEdgeFn: (edge) => edge.data.tags.highway !== "steps"