搜尋套件、儲存庫與 APP 分類

flutter_map_marker_cluster 封面
套件詳情v8.2.2

flutter_map_marker_cluster

Flutter 應用中 Leaflet.makercluster 的 Dart 實作。為 flutter_map 提供美觀的動畫標記群集功能。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
10萬
喜歡數
224
Pub 分數
150

安裝套件

flutter pub add flutter_map_marker_cluster

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個為 flutter_map 帶來動畫標記群集的 Flutter 套件,靈感來自 Leaflet.markercluster。它能有效將附近的標記分組為群集,改善地圖上密集資料的效能與使用者體驗。此套件支援展開或收合群集時的平滑動畫,並可在所有主要平台順暢運作。適用於顯示大量地理位置點的應用程式,例如商家清單、送貨位置或活動標記。

適用情境

  • 顯示高密度位置資料
  • 透過大量標記改善地圖效能
  • 建立互動式地圖體驗
  • 即時可視化地理空間資料
  • 增強使用者在地圖上的導航體驗

主要特色

  • 動畫聚類過渡
  • 高效標記分組
  • 與 flutter_map 的無縫整合
  • 支援自定群集樣式
  • 跨平台相容性

適合對象

  • 帶有數百個或數千個標記的地圖
  • 基於位置的服務應用
  • 數據可視化儀表板
  • 行動與網路地圖應用
  • 使用 flutter_map 的開發者

使用建議

  • 需要安裝 flutter_map
  • 可能影響非常大的資料集的效能
  • 自定義需要了解 flutter_map 設定
  • 有限的內建樣式選項,需額外程式碼
  • 最佳搭配靜態或更新緩慢的資料使用

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Flutter Map Marker Cluster

pub package travis

A Dart implementation of Leaflet.markercluster for Flutter apps. This is a plugin for flutter_map package

Usage

Add flutter_map and flutter_map_marker_cluster to your pubspec:

dependencies:
  flutter_map: any
  flutter_map_marker_cluster: any # or the latest version on Pub

flutter_map package removed old layering system with v3.0.0 use MarkerClusterLayerWidget as member of children parameter list and configure it using MarkerClusterLayerOptions.

 @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Clustering Many Markers Page')),
      drawer: buildDrawer(context, ClusteringManyMarkersPage.route),
      body: FlutterMap(
        options: MapOptions(
          center: LatLng((maxLatLng.latitude + minLatLng.latitude) / 2,
              (maxLatLng.longitude + minLatLng.longitude) / 2),
          zoom: 6,
          maxZoom: 15,
        ),
        children: <Widget>[
          TileLayer(
            urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
          ),
          MarkerClusterLayerWidget(
            options: MarkerClusterLayerOptions(
              maxClusterRadius: 45,
              size: const Size(40, 40),
              alignment: Alignment.center,
              padding: const EdgeInsets.all(50),
              maxZoom: 15,        
              markers: markers,
              builder: (context, markers) {
                return Container(
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(20),
                      color: Colors.blue),
                  child: Center(
                    child: Text(
                      markers.length.toString(),
                      style: const TextStyle(color: Colors.white),
                    ),
                  ),
                );
              },
            ),
          ),
        ],
      ),
    );
  }
Run the example

See the example/ folder for a working example app.

Supporting Me

A donation through my Ko-Fi page would be infinitly appriciated: ko-fi

but, if you can't or won't, a star on GitHub and a like on pub.dev would also go a long way!

Every donation gives me fuel to continue my open-source projects and lets me know that I'm doing a good job.

所屬分類

依賴

依賴清單 3 項

原始碼儲存庫

使用此套件的專案