google_maps_webservice 套件提供了一個 Dart 客戶端,用於與 Google Maps Web Services API 進行互動。它讓 Flutter 應用程式能夠透過 HTTP 請求存取地理編碼、地點、路線、距離矩陣及其他地圖相關資料。此套件專為需要程式化存取 Google 地圖基礎架構的開發者設計,簡化整合過程,無需直接管理 API 呼叫。該套件輕量且專注於核心 Web 服務功能,非常適合在 Flutter 應用中執行類似後端的作業。
適用情境
將地址轉換為座標
獲取附近地點和詳細資訊
計算路線和旅行距離
將地圖資料整合至位置相關功能
在無伺服器函數中處理地圖資料
主要特色
Google Maps API 的簡單 HTTP 客戶端
支援多個 Google Maps Web 服務
乾淨、類型安全的請求和回應模型
與 Flutter 應用輕鬆整合
文件完整且持續維護
適合對象
開發位置感知的 Flutter 應用程式開發者
需要從 Google Maps Web Services 取得地圖資料的應用程式
需要地理編碼或路線計算的專案
Flutter 應用中的後端邏輯
大量使用 Google 地圖 API 的團隊
使用建議
需要有效的 Google Cloud API 金鑰
不包含地圖UI渲染(請與 google_maps_flutter 一起使用)
僅限網頁服務端點,不支援即時地圖
根據 Google Cloud 計費應用速率限制
不適用於離線地圖功能
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
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.
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.