@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 +10 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/wemap-osm/OsmRouter.ts +10 -5
package/dist/index.mjs
CHANGED
|
@@ -692,7 +692,16 @@ let OsmGraph = _OsmGraph;
|
|
|
692
692
|
__publicField(OsmGraph, "HIGHWAYS_PEDESTRIANS", HIGHWAYS_PEDESTRIANS);
|
|
693
693
|
__publicField(OsmGraph, "DEFAULT_WAY_SELECTOR", DEFAULT_WAY_SELECTOR);
|
|
694
694
|
const DEFAULT_OPTIONS = Object.assign({}, GeoGraphRouter.DEFAULT_OPTIONS, {
|
|
695
|
-
weightEdgeFn: (edge) =>
|
|
695
|
+
weightEdgeFn: (edge) => {
|
|
696
|
+
if (edge.data instanceof OsmNode && edge.data.isElevator) {
|
|
697
|
+
return 90;
|
|
698
|
+
}
|
|
699
|
+
let duration = getDurationFromLength(edge.length, 4);
|
|
700
|
+
if (edge.data instanceof OsmWay && edge.data.areStairs) {
|
|
701
|
+
duration *= 3;
|
|
702
|
+
}
|
|
703
|
+
return duration;
|
|
704
|
+
}
|
|
696
705
|
});
|
|
697
706
|
const WITHOUT_STAIRS_OPTIONS = Object.assign({}, DEFAULT_OPTIONS, {
|
|
698
707
|
acceptEdgeFn: (edge) => edge.data.tags.highway !== "steps"
|