2014-04-16 2 views
0

누군가가 google지도에서 운전 방향을 선택하는 데 accordind를 알고 있습니까? 그런어떤 google지도 운전 방향에 따라

빠른 도로와 일 ...

내 응용 프로그램에서 사용하고지도 v2의 방향을 구글과 나는 방향을 coosing 내용에 따라 알고 싶어요.

답변

1

Google에 따르면 고속도로, 페리 및 통행료를 피할 수 있습니다. 모드를 선택할 수도 있지만 '빠른 길'은 선택할 수 없습니다. 예를 들어
:

http://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&sensor=false&key=API_KEY&avoid=highways&mode=driving 

당신이 할 수있는 응용 프로그램의 경우 :

String url = "http://maps.googleapis.com/maps/api/directions/xml?origin=Toronto&destination=Montreal&sensor=false&key=API_KEY&avoid=highways&mode=driving"; 
HttpGet httpGet = new HttpGet(url); 
HttpClient httpClient = new DefaultHttpClient(); 
HttpResponse httpResponse; 
try { 
    httpResponse = httpClient.execute(httpGet); 
    HttpEntity httpEntity = httpResponse.getEntity(); 
    InputStream inputStream = httpEntity.getContent(); 

    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); 
    Document doc = builder.parse(inputStream); 
    //In doc is your response 
} catch (Exception e) { 
    e.printStackTrace(); 
} 
+0

그리고 따라 어떤 경로를 선택 Google지도 응용 프로그램? – Itay

+0

할 수 없습니다. 방금 체크 했어. 가능한 모드를 선택하고 통행료, 고속도로 및 페리를 피할 수 있습니다. – EarlOfEgo

관련 문제