2

This is a question about Mapquest Android Maps API.

Does anyone know that the createRoute method is supporting lat/Lng or not in mapquest?

public void createRoute(java.lang.String from, java.lang.String to)

The document I found here:

I have read the "Location Format Documentation" : link

It seems that createRoute method supports lat/Lng.

I tried to input lat/Lng a whole day but it returns me an error message only:

 Unable to create route. 
 Error: -1"
 Message:[null]
Mano Marks
  • 8,761
  • 3
  • 27
  • 28
Yeny
  • 45
  • 2
  • 4

2 Answers2

0

You can write like this

RouteManager routeManager = new RouteManager(this);
          routeManager.setMapView(map);
          routeManager.createRoute("37.002004,35.322998", "36.802687,34.632812");

or like this

RouteManager routeManager = new RouteManager(this);
          routeManager.setMapView(map);
          routeManager.createRoute("Any City Name", "Any City Name");

MapQuest is supporting this types

Emre Koç
  • 1,343
  • 1
  • 25
  • 44
0

Are you still seeing this error message? The MapQuest Android Maps API does support lat/lng input for routing. Here is a sample request that uses lat/lng inputs:

private void displayRoute() {
RouteManager routeManager= new
RouteManager( this ); 
routeManager.setMapView( map ); 
routeManager.createRoute( "{latLng:{lat:37.765007,lng:-122.239937}}" , "Fremont, CA" );
}

Also, The MapQuest Developer Network has an Android Maps API forum. It is also a good resource to check!

jharahush
  • 767
  • 4
  • 6
  • Thanks jharahush. I have checked the forum and tried to use your code in the MapQuest Android Maps API, but still seeing this error message – Yeny Mar 23 '12 at 03:45
  • Can you post a code sample? Like I said, the API does support lat/lng input, so maybe I can help if I see what your code looks like. – jharahush Mar 26 '12 at 14:17