Search code examples
androidskmaps

How to get the coordinates of a route without having to clear the previous drawn route?


By using the method

SKRouteManager.getInstance().calculateRoute(route);

the previously drawn map is deleted and replaced. Is it possible to get a list of coordinates for a route without having to delete the route currently drawn on the map and not having to create a route and cache it?


Solution

  • You can calculate multiple routes without displaying them on the map by setting the isRouteExposed parameter to false.

    I believe that once you display a route on the map, any call to calculateRoute (even if not shown on the map) will make the route on map disappear. A potential workaround this would be to use the online routing service.