google_directions_api 패키지는 Google Directions API에 대한 Flutter 인터페이스를 제공하여 운전, 도보, 자전거, 대중교통과 같은 다양한 교통 수단을 사용해 위치 간 경로를 계산할 수 있게 해줍니다. Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원합니다. 이 패키지는 Google의 루팅 서비스와의 통합을 간소화하여 앱에서 단계별 안내, 여행 시간 예측, 거리 계산을 표시할 수 있도록 합니다. 내비게이션, 여행 계획 및 경로 데이터가 필요한 위치 기반 애플리케이션에 이상적입니다.
사용 사례
내비게이션 앱
여행 계획 기능
배달 경로 최적화
위치 기반 서비스 개선
실시간 대중교통 방향 조회
주요 기능
여러 가지 전송 모드를 지원합니다
크로스 플랫폼 호환성
간단한 API 통합
경로 거리 및 소요 시간 계산
단계별 안내 지원
적합한 대상
내비게이션 도구를 개발하는 개발자
경로 계획이 필요한 앱
여행 및 물류 애플리케이션
모바일 및 웹 위치 서비스
Google Maps 라우팅 기능 통합
고려 사항
Google Cloud Platform API 키가 필요합니다
사용량에 따라 레이트 제한이 적용됩니다
고용량 사용 시 추가 비용이 발생할 수 있습니다
실시간 데이터를 사용하려면 인터넷 연결이 필요합니다
API 오류 응답에 적절한 처리가 필요합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
google_directions_api
The Directions API is a service that calculates directions between locations. You can search for directions for several modes of transportation, including transit, driving, walking, or cycling.
Getting Started
The Directions API is a service that calculates directions between locations using an HTTP request.
With the Directions API, you can:
Search for directions for several modes of transportation, including transit, driving, walking or cycling.
Return multi-part directions using a series of waypoints.
Specify origins, destinations, and waypoints as text strings (e.g. "Chicago, IL" or "Darwin, NT, Australia"), or as latitude/longitude coordinates, or as place IDs.
The API returns the most efficient routes when calculating directions. Travel time is the primary factor optimized, but the API may also take into account other factors such as distance, number of turns and many more when deciding which route is the most efficient.
Note: This service is not designed to respond in real time to user input.
For full info about Directions API visit official documentation
Usage
import'package:google_directions_api/google_directions_api.dart';
voidmain() {
DirectionsService.init('API_KEY');
final directionsService = DirectionsService();
final request = DirectionsRequest(
origin: 'New York',
destination: 'San Francisco',
travelMode: TravelMode.driving,
);
directionsService.route(request,
(DirectionsResult response, DirectionsStatus status) {
if (status == DirectionsStatus.ok) {
// do something with successful response
} else {
// do something with error response
}
});
}
Feature requests and Bug reports
Feel free to post a feature requests or report a bug here.