markers_cluster_google_maps_flutter 0.0.1 copy "markers_cluster_google_maps_flutter: ^0.0.1" to clipboard
markers_cluster_google_maps_flutter: ^0.0.1 copied to clipboard

Package for clustering markers on Google Maps in Flutter applications

markers_cluster_google_maps_flutter #

A flutter package for clustering the markers on google maps flutter.

Installation #

To use this plugin, add markers_cluster_google_maps_flutter as a dependency in your pubspec.yaml file.

Usage #

  1. Import the package with:
import 'package:markers_cluster_google_maps_flutter/markers_cluster_google_maps_flutter.dart';
  1. Initialize the MarkersClusterManager:
final clusterManager = MarkersClusterManager();
  1. Add markers using following method:
clusterManager.addMarker()
  1. Update clusters at a specific zoom level:
await clusterManager.updateClusters(zoomLevel: 12);
  1. Get the clustered markers with following method
final clusteredMarkers = clusterManager.getClusteredMarkers();
  1. Use the clustered markers in your GoogleMap widget:
GoogleMap(
  mapType: MapType.normal,
  onMapCreated: (GoogleMapController controller) {
    // Complete controller and update clusters
  },
  initialCameraPosition: CameraPosition(
    target: LatLng(33.6937, 73.0653),
    zoom: 10.0,
  ),
  onCameraMove: (CameraPosition position) {
    // Update clusters based on zoom level
  },
  markers: Set<Marker>.of(clusteredMarkers),
);

Support and Contribute #

For support, please star on Github repository. Contributions are welcome! Please submit issues and pull requests on the GitHub repository.

4
likes
0
points
13
downloads

Publisher

verified publisherzeexan.com

Weekly Downloads

Package for clustering markers on Google Maps in Flutter applications

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, google_maps_flutter

More

Packages that depend on markers_cluster_google_maps_flutter