IndoorAtlas SDK offers this API for general purpose route planning. You can use it for multiple tasks, for example:
- Requesting a route between any points A and B, independent on where the users current location estimate is (note: other IndoorAtlas wayfinding APIs assume the user starts navigating from the current location estimate to a single destination)
- Planning route through a list of destination points, based on your own criteria.
To request a one shot route, you can use this API:
IALatLngFloorCompatible fromLoc ... // see above example IALatLngFloorCompatible toLoc ... // see above example mIALocationManager.requestWayfindingRoute(fromLoc, toLoc, new IAWayfindingListener() { @Override public void onWayfindingUpdate(IARoute iaRoute) { // Handle the one shot response here } });
For the above tasks, you likely find the methods of IARouteLeg (iOS) and IARoute.Leg (Android) useful. These are "getLength()" and "getDirection()".
// Calculate route length in meters double routeLength = 0; for (IARoute.Leg leg : route.getLegs()) { routeLength += leg.getLength(); } return routeLength;
Android:
iOS: