Google 지도에서 위치를 선택하는 것을 간편하게 만드는 플러터 패키지입니다. 사용자가 지도와 상호작용하여 장소를 선택할 수 있도록 직관적인 인터페이스를 제공하며, 정밀한 지리 정보 입력이 필요한 앱에 적합합니다. Google 지도 SDK와 원활하게 통합되며, 사용자 정의 마커 및 위치 세부 정보 검색을 지원합니다. 방대한 봇일러플레이트 코드 없이 지도 기반 장소 선택을 구현하고자 하는 개발자를 위한 솔루션으로 설계되었습니다.
사용 사례
지도 기반 주소 선택
양식 내 위치 선택기
여행 또는 배달 앱 체크인
지오태깅 기능
사용자 프로필 위치 설정
주요 기능
Google Maps SDK와의 간편한 통합
사용자 정의 가능한 마커 및 UI
세부 위치 데이터를 반환합니다
검색 및 핀 배치를 지원합니다
경량이며 장소 선택에 집중
적합한 대상
위치 인식 앱을 개발하는 개발자
사용자가 선택한 좌표가 필요한 앱
Google Maps를 광범위하게 사용하는 프로젝트
빠른 위치 입력이 필요한 프로토타입
고려 사항
Google Maps API 키가 필요합니다
Google Maps 플랫폼에 한정
오프라인 지도 지원 없음
인터넷 연결에 의존합니다
UI 일관성을 위해 추가 스타일링이 필요할 수 있습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Google Maps Pick Place
A pub.dev package to handle picking place from google map and use the picked data in the app.
On iOS you'll need to add the following entries to your Info.plist file (located under ios/Runner) in order to access the device's location.
Simply open your Info.plist file and add the following:
<key>NSLocationWhenInUseUsageDescription</key><string>This app needs access to location when open.</string><key>NSLocationAlwaysUsageDescription</key><string>This app needs access to location when in the background.</string><key>NSLocationAlwaysAndWhenInUseUsageDescription</key><string>This app needs access to location when open and in the background.</string>
In addition, you need to add the Background Modes capability to your XCode project (Project > Signing and Capabilties > "+ Capability" button) and select Location Updates.g>This app needs access to location when open and in the background.
Opt-in to the embedded views preview by adding a boolean property to the app's Info.plist file
with the key io.flutter.embedded_views_preview and the value YES.
You can use GoogleMapsPickPlace by pushing to a new page using Navigator, OR put as a child of any widget.
When the user picks a place on the map, it will return result to 'getResult' with FullAddress type.
import'package:flutter/material.dart';
import'package:google_maps_pick_place/google_maps_pick_place.dart';
// ...Navigator.push(
context,
MaterialPageRoute(
builder: (context) => GoogleMapsPickPlace(
apiKey: "YOU GOOGLE MAPS API KEY",
getResult: (FullAddress result) {
print('${result.address}');
/// Don't use Navigator.of(context).pop() it's build in the method
},
),
),
);
Note
Searching for a place feature needs a paid google map api key.
With free key map and picking a place feature will work correctly without any error.
But searching for a place feature will not work.
Google Maps Pick Place Properties
Parameter
Type
Description
apiKey
String
Google Map Api Token
mapLanguage
Language
map's language used in search and other widgets
getResult
Function(FullAddress)?
Method of Getting the address and position
initialPosition
LatLng
Initial position of the map in case there's no location and GPS is off
enableMyLocationButton
bool
Enable or disable the My Location button
enableSearchButton
bool
Enable or disable the Search button
loader
Widget
Widget to show while the map is loading
doneButton
Widget?
Widget to show when the map is done loading and apply getResult method
errorButton
Widget?
Widget to show when there's a corruption or there's no internet connection