map_zone_manager
Google 지도에서 영역을 생성하고 표시하며 관리할 수 있는 강력한 Flutter 패키지입니다. 다중 영역 지원, 사용자 정의 지도 스타일 및 카메라 제어 기능을 포함하여 원활한 사용자 경험을 제공합니다.
muhsindev4/map_zone_manager open-source repository details.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
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.
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
To use the MapZoneManager widget, you need to add it to your widget tree. Here's a basic example:
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:map_zone_manager/map_zone_manager.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Map Zone Manager')),
body: MapZoneManager(
initialCameraPosition: CameraPosition(target: LatLng(37.7749, -122.4194), zoom: 12),
multiZone: true,
showAddButton: true,
showResetButton: true,
viewOnly: false,
onZoneAdded: (zone) {
print('New Zone Added: ${zone.zoneId}');
},
),
),
);
}
}
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).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.
MapZoneManagerController controller = MapZoneManagerController(
onZoneAdded: (zone) {
print('New Zone Added: ${zone.zoneId}');
},
multiZone: true,
);
controller.createZone();
controller.addPositionOnCurrentZone(LatLng(37.7749, -122.4194));
This package is licensed under the MIT License. See the LICENSE file for more details.
의존성 목록 6 개
{"sdk":"flutter"}^2.10.0^0.28.0^1.2.2{"sdk":"flutter"}^5.0.0사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗