@wemap/routers 11.0.0-alpha.22 → 11.0.0-alpha.24
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 +12 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/wemap-osm/OsmGraph.ts +15 -1
package/dist/index.js
CHANGED
|
@@ -575,7 +575,8 @@ class RouterResponse {
|
|
|
575
575
|
}
|
|
576
576
|
const HIGHWAYS_PEDESTRIANS = ["footway", "steps", "pedestrian", "living_street", "path", "track", "sidewalk", "elevator"];
|
|
577
577
|
const DEFAULT_WAY_SELECTOR = (way) => {
|
|
578
|
-
|
|
578
|
+
const isElevatorArea = way.tags.highway === "elevator" && way.isArea;
|
|
579
|
+
return HIGHWAYS_PEDESTRIANS.includes(way.tags.highway) && !isElevatorArea || way.tags.footway === "sidewalk" || way.tags.public_transport === "platform" || way.tags.railway === "platform";
|
|
579
580
|
};
|
|
580
581
|
class OsmGraph extends geo.GeoGraph {
|
|
581
582
|
getVertexByCoords(coords) {
|
|
@@ -621,6 +622,16 @@ class OsmGraph extends geo.GeoGraph {
|
|
|
621
622
|
firstNode = secondNode;
|
|
622
623
|
}
|
|
623
624
|
});
|
|
625
|
+
osmModel.ways.filter((way) => way.isElevator).forEach((way) => {
|
|
626
|
+
way.nodes.forEach((node) => {
|
|
627
|
+
const connectedWays = node.ways.filter((otherWay) => otherWay != way);
|
|
628
|
+
if (connectedWays.length) {
|
|
629
|
+
const graphVertex = getOrCreateNode(node);
|
|
630
|
+
graphVertex.data.tags.highway = "elevator";
|
|
631
|
+
elevatorNodes.push(graphVertex);
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
});
|
|
624
635
|
elevatorNodes.forEach((node) => {
|
|
625
636
|
OsmGraph.createNodesAndEdgesFromElevator(nodes, edges, node);
|
|
626
637
|
});
|