Пример #1
0
 public void createRouteTo(Location location) {
   mapController.clearLines();
   mapFragment.clearMarkers();
   mapFragment.updateMap();
   isRouting = true;
   act.showLoadingIndicator();
   router
       .clearLocations()
       .setLocation(locationToPair(location))
       // To allow routing to see which direction you are travelling
       .setLocation(
           locationToPair(
               getDistancePointFromBearing(location, 15, (int) Math.floor(location.getBearing()))))
       .setLocation(geoPointToPair(SimpleFeatureHelper.getGeoPoint(simpleFeature)))
       .setCallback(this)
       .fetch();
 }
Пример #2
0
 @Provides
 @Singleton
 Router provideRouter() {
   return Router.getRouter().setEndpoint(context.getString(R.string.osrm_endpoint));
 }