패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.0.19

google_maps_webservice

Google 지도 웹 서비스 [API](https://developers.google.com/maps/web-services)

30일 다운로드
9.7천
좋아요
163
Pub 점수
30

패키지 설치

flutter pub add google_maps_webservice

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

google_maps_webservice 패키지는 Google Maps Web Services API와 상호 작용하기 위한 Dart 클라이언트를 제공합니다. HTTP 요청을 통해 Flutter 애플리케이션에서 지오코딩, 장소, 경로, 거리 행렬 및 기타 맵 관련 데이터에 접근할 수 있습니다. Google의 맵핑 인프라스트럭처에 프로그래밍 방식으로 접근이 필요한 개발자를 위해 설계되었으며, 직접 API 호출을 관리할 필요 없이 통합을 간소화합니다. 이 패키지는 가볍고 핵심 웹 서비스 기능에 집중되어 있어, Flutter 앱 내에서 백엔드 유사 작업에 이상적입니다.

사용 사례

  • 주소를 좌표로 변환하기
  • 근처 장소 및 세부 정보 가져오기
  • 경로 및 여행 거리 계산
  • 지도 데이터를 위치 기반 기능에 통합하기
  • 서버리스 함수에서 지도 데이터 처리

주요 기능

  • Google Maps API용 간단한 HTTP 클라이언트
  • 여러 Google Maps 웹 서비스를 지원합니다
  • 정결하고 타입 안전한 요청 및 응답 모델
  • Flutter 앱과의 간편한 통합
  • 잘 문서화되어 있으며 적극적으로 유지 관리됨

적합한 대상

  • 위치 인식 Flutter 앱을 개발하는 개발자
  • Google Maps Web Services에서 지도 데이터를 필요로 하는 앱
  • 지오코딩 또는 경로 계산이 필요한 프로젝트
  • Flutter 앱 내부의 백엔드 로직
  • Google Maps API를 광범위하게 사용하는 팀

고려 사항

  • 유효한 Google Cloud API 키가 필요합니다
  • 지도 UI 렌더링을 포함하지 않습니다 (google_maps_flutter와 함께 사용하세요)
  • 웹 서비스 엔드포인트에 국한되며 실시간 지도는 아님
  • Google Cloud 청구 기준으로 레이트 제한이 적용됩니다
  • 오프라인 지도 기능에 적합하지 않습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Build Status codecov Star on Github Buy Me A Coffee

google_maps_webservice

General Information

This is the Dart Library for Google Maps Webservices. You can find the Google Maps Platform Documentation here, but if you're new to this, you may want to start here.

API Key

To use this library you need a Web API key. Follow these steps to acquire the key relevant to your particular Dart application.

These keys are not to be used individually as Android or iOS API keys, but they are instead meant to be used in your Dart application.

Availables API

Usage

Geocoding
import "package:google_maps_webservice/geocoding.dart";

final geocoding = GoogleMapsGeocoding(apiKey: "<API_KEY>");
final geocoding = GoogleMapsGeocoding(apiKey: "<API_KEY>", httpClient: BrowserClient());
final geocoding = GoogleMapsGeocoding(baseUrl: "http://myProxy.com");

GeocodingResponse response = await geocoding.searchByAddress("1600 Amphitheatre Parkway, Mountain View, CA");
Places
import "package:google_maps_webservice/places.dart";

final places = GoogleMapsPlaces(apiKey: "<API_KEY>");
final places = GoogleMapsPlaces(apiKey: "<API_KEY>", httpClient: BrowserClient());
final places = GoogleMapsPlaces(baseUrl: "http://myProxy.com");

PlacesSearchResponse response = await places.searchNearbyWithRadius(Location(lat: 31.0424, lng: 42.421), 500);
PlacesSearchResponse response = await places.searchNearbyWithRankby(Location(lat: 31.0424, lng: 42.421), "distance");
PlacesSearchResponse response = await places.searchByText("123 Main Street");

PlacesDetailsResponse response = await places.getDetailsByPlaceId("PLACE_ID");
PlacesDetailsResponse response = await places.getDetailsByReference("REF");
Timezone
import "package:google_maps_webservice/timezone.dart";

final timezone = GoogleMapsTimezone(apiKey: "<API_KEY>");
final timezone = GoogleMapsTimezone(apiKey: "<API_KEY>", httpClient: BrowserClient());
final timezone = GoogleMapsTimezone(baseUrl: "http://myProxy.com");

TimezoneResponse response = await timezone.getByLocation(Location(lat: 31.0424, lng: 42.421));
TimezoneResponse response = await timezone.getByLocation(Location(lat: 31.0424, lng: 42.421), timestamp: DateTime.utc(2019, 4, 24));
TimezoneResponse response = await timezone.getByLocation(Location(lat: 31.0424, lng: 42.421), timestamp: DateTime.utc(2019, 4, 24), language: 'es');
Static Map

  StaticMap mapStatic = StaticMap(
    apiKey,
    markers: List.from([
      Location(lat: 23.721160, lng: 90.394435),
      Location(lat: 23.732322, lng: 90.385142),]
    ),
    path: Path(
      enc: 'svh~F`j}uOusC`bD',
      color: 'black',
    ),
    scale: 'false'
  )

  String url = mapStatic.getUrl();

  Image.network(url)


Proxy

In case of using a proxy the baseUrl can be set. The apiKey is not required in case the proxy sets it. (Not storing the apiKey in the app is good practice)

Feature Requests and Issues

Please file feature requests and bugs at the issue tracker.

카테고리

의존성

의존성 목록 2 개

소스 저장소

이 패키지를 사용하는 프로젝트