Select to view content in your preferred language

routing task error on android

2648
0
05-28-2016 09:27 PM
tohamihussin1
Deactivated User

i can not perform routing

whin i run this code it does not give any errors , i have make logs every where to figure out what is the problem and i found that its stop at  parameters = task.retrieveDefaultRouteTaskParameters(); , or any where i use routing task "task"

pleeeeeeese help me

RouteParameters parameters = null;

RouteTask task = null;

try {

  task = RouteTask.createOnlineRouteTask(

   "http://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/NAServer/Route", null);

  parameters = task.retrieveDefaultRouteTaskParameters();

  Log.e("result" ,"142");

  parameters.setOutSpatialReference(mMap.getSpatialReference());

  NAFeaturesAsFeature naFeatures = new NAFeaturesAsFeature();

  Log.e("result" ,"1");

  Point startPoint = new Point(-119.866896, 36.793653);

  Point stopPoint = new Point(-119.853345, 36.795488);

  StopGraphic startPnt = new StopGraphic(startPoint);

  StopGraphic stopPnt = new StopGraphic(stopPoint);

  Log.e("result" ,"2");

  naFeatures.setFeatures(new Graphic[] {startPnt, stopPnt});

  naFeatures.setSpatialReference(mMap.getSpatialReference());

  parameters.setStops(naFeatures);

  RouteResult result = null;

  result = task.solve(parameters);

  Log.e("result" , result.getStops().toString()) ;

} catch (Exception e) {

  e.printStackTrace();

}

0 Kudos
0 Replies