문제

I have been trying to figure out driving directions using user input and it looks like that functionality has been removed from the google maps API. Is this corrects? I have been searching and have not been able to find any documentation on how to get directions using user input. Does anyone know of any tutorials or documentation on this?

도움이 되었습니까?

해결책

The official documentation contains everything you need:

  1. make a request to retrieve the coordinates related to the user-input: Geocoder.geocode()
  2. Fetch the latlng out of the GeocoderResult
  3. Request the route by using DirectionsService.route() and the given start/endpoint
  4. set the route by using DirectionsRenderer.setDirections()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top