@wemap/geo 11.8.0 → 11.8.2
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 +9 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/graph/GeoGraphRouter.ts +10 -3
package/dist/index.js
CHANGED
|
@@ -1750,7 +1750,7 @@ const _GeoGraphRouter = class _GeoGraphRouter {
|
|
|
1750
1750
|
const { acceptEdgeFn, weightEdgeFn, projectionMaxDistance } = options;
|
|
1751
1751
|
this._mapMatching.maxDistance = projectionMaxDistance;
|
|
1752
1752
|
const createdVertices = [];
|
|
1753
|
-
const retrieveOrCreateNearestVertex = (point
|
|
1753
|
+
const retrieveOrCreateNearestVertex = (point) => {
|
|
1754
1754
|
if (point instanceof GeoGraphVertex) {
|
|
1755
1755
|
return point;
|
|
1756
1756
|
}
|
|
@@ -1758,7 +1758,7 @@ const _GeoGraphRouter = class _GeoGraphRouter {
|
|
|
1758
1758
|
if (closeVertex) {
|
|
1759
1759
|
return closeVertex;
|
|
1760
1760
|
}
|
|
1761
|
-
const proj = this._mapMatching.getProjection(point, true, false, false,
|
|
1761
|
+
const proj = this._mapMatching.getProjection(point, true, false, false, options.acceptEdgeFn);
|
|
1762
1762
|
if (!proj) {
|
|
1763
1763
|
let message = `Point ${point.toString()} is too far from the graph > ${this._mapMatching.maxDistance.toFixed(0)} meters.`;
|
|
1764
1764
|
if (point.level !== null) {
|
|
@@ -1872,7 +1872,13 @@ const _GeoGraphRouter = class _GeoGraphRouter {
|
|
|
1872
1872
|
e.itinerary.end = e.input instanceof GeoGraphVertex ? e.input.coords : e.input;
|
|
1873
1873
|
}
|
|
1874
1874
|
});
|
|
1875
|
-
return
|
|
1875
|
+
return endsStruct.map((end) => {
|
|
1876
|
+
const endFiltered = endsStructFiltered.find((e) => e.input === end.input);
|
|
1877
|
+
if (endFiltered)
|
|
1878
|
+
return endFiltered.itinerary;
|
|
1879
|
+
const endCoords = end.input instanceof GeoGraphVertex ? end.input.coords : end.input;
|
|
1880
|
+
return GeoGraphItinerary.fromGraphVertices(startCoords, endCoords, [], []);
|
|
1881
|
+
});
|
|
1876
1882
|
}
|
|
1877
1883
|
createVertexInsideEdge(edge, point) {
|
|
1878
1884
|
const a = edge.vertex1;
|