MapZoneManager는 Google 지도에서 영역을 생성하고 표시하며 관리하는 것을 간편하게 만드는 Flutter 패키지입니다. 여러 영역을 지원하며 지도 스타일을 사용자 정의할 수 있고, 부드러운 탐색을 위한 정밀한 카메라 제어 기능을 제공합니다. 배달 지역, 이벤트 영역 또는 지오패싱과 같은 공간적 영역 시각화가 필요한 애플리케이션에 적합합니다. 이 패키지는 Android, iOS 및 웹 플랫폼과 원활하게 통합되어 개발자에게 인터랙티브한 지도 기반 기능을 위한 강력한 솔루션을 제공합니다.
사용 사례
배송 지역 시각화
지오펜싱 애플리케이션
이벤트 지역 계획
인터랙티브 지도 주석
위치 기반 서비스
실시간 영역 추적
주요 기능
다중 영역 지원
사용자 정의 지도 스타일
카메라 제어 유틸리티
영역 생성 도구
인터랙티브 영역 마커
크로스 플랫폼 호환성
적합한 대상
위치 인식 앱을 개발하는 개발자
영역 기반 지도 상호작용이 필요한 팀
지오펜싱 또는 배달 구역을 사용하는 애플리케이션
웹 및 모바일 지도 통합
동적 지도 주석이 필요한 프로젝트
고려 사항
Google Maps API 키가 필요합니다
Google 지도 통합에 제한됨
대규모 영역에 대한 성능 조정이 필요할 수 있습니다
지도 렌더링을 위해서 안정적인 인터넷 연결이 필요합니다
웹 플랫폼을 위한 추가 설정이 필요합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
MapZoneManager
MapZoneManager is a Flutter package that provides a widget and controller to manage zones on a Google Map. It allows you to create, update, and manage multiple zones, with features for handling map markers, polygons, and custom actions like adding or resetting zones. It supports both single and multi-zone management and is highly customizable with features like custom buttons and map styles.
Features
Zone Creation: Create zones by tapping on the map and adding coordinates to form a polygon.
Multiple Zones: Supports managing multiple zones on the map.
Customizable: Customize zone colors, border colors, and border width.
View-Only Mode: Ability to display zones in a read-only mode (no zone creation).
Custom Buttons: Option to replace the default add/reset zone buttons with custom widgets.
Markers & Polygons: Displays markers and polygons for each zone created on the map.
Zoom Controls: Enable/disable zoom controls and gestures.
Location Services: Enable location tracking and display of the user's current location.
Map Styles: Apply different map styles to customize the appearance of the map.
Installation
To add the package to your Flutter project, update your pubspec.yaml file:
Run flutter pub get to install the dependencies.
dependencies:
map_zone_manager: ^0.0.1
Usage
Basic Usage
To use the MapZoneManager widget, you need to add it to your widget tree. Here's a basic example:
initialCameraPosition: The initial camera position for the map (optional).
markerIcon: The icon for the markers (optional).
multiZone: Whether multiple zones can be added (default is true).
showAddButton: Whether to show the button to add a zone (default is true).
showResetButton: Whether to show the button to reset the zone (default is true).
viewOnly: Whether the map is in view-only mode (default is false).
addButtonWidget: Custom widget for the add button (optional).
resetButtonWidget: Custom widget for the reset button (optional).
zones: A list of initial zones to display on the map (optional).
onZoneAdded: A callback triggered when a new zone is added (optional).
mapStyle: The map style to apply (optional, defaults to MapStyle.standard).
mapZoneManagerController: A controller to manage map zones (optional).
minimumCoordinatesForAdding: The minimum number of coordinates required to create a zone (default is 2).
defaultZoneColor: The default fill color for zones (default is Colors.yellow).
defaultBorderColor: The default border color for zones (default is Colors.black).
defaultBorderWidth: The default border width for zones (default is 2).
currentZoneColor: The color for the current zone being created (default is Colors.red).
currentBorderColor: The color for the current zone's border (default is Colors.black).
currentBorderWidth: The width of the current zone's border (default is 2).
onTap: A callback triggered when the map is tapped (optional).
onLongPress: A callback triggered when the map is long-pressed (optional).
zoomControlsEnabled: Whether zoom controls are enabled (default is true).
zoomGesturesEnabled: Whether zoom gestures are enabled (default is true).
myLocationEnabled: Whether the user's current location is displayed (default is false).
myLocationButtonEnabled: Whether the "My Location" button is enabled (default is true).
MapZoneManagerController
The MapZoneManagerController is a controller class for managing zones and map-related operations. You can use this controller to manage zones, add coordinates, and move the camera to fit a zone.