パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.0.19

google_maps_webservice

Google マップ Web サービス [API](https://developers.google.com/maps/web-services)

30日間ダウンロード
9700
いいね数
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 Webサービスをサポートしています
  • クリーンで型安全なリクエストおよびレスポンスモデル
  • 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 件

ソースリポジトリ

このパッケージを使用しているプロジェクト