Closed egemenokten closed 6 years ago
Hard to tell without seeing the network, but a first thing is to ensure that the start and finish points are both in the network. That is, both must be coordinates in some segment (and of course the segments have to be connected to be able to find a route between them).
For an application with arbitrary start and finish points, I usually first look up the points in the network closest to the route's desired start and finish, to make sure they're always in the network. One way to this is to use Turf's nearest module.
Thanks @perliedman ! My segments wasn't connected. This solved my problem.
Hi @perliedman I copied a part of your network.json file for my geoJson object and my points in this file. Here is the code
But findPath method returning null. What am i doing wrong, can you help me ?