パッケージ、リポジトリ、アプリカテゴリを検索

fluster のカバー
パッケージ詳細v1.2.0

fluster

Dart向けの地理空間ポイントクラスタリングライブラリで、マッピングソリューションにおけるマーカー間の間隔を確保するのに役立ちます。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1.4万
いいね数
134
Pub ポイント
150

パッケージをインストール

flutter pub add fluster

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Fluster は、Dart を対象としたジオスパティアルポイントクラスタリングライブラリであり、マッピングアプリケーションにおけるマップマーカーのグループ化と管理を効率的に行うことを目的としています。ズームレベルおよび空間的近接に基づいてポイントを動的にクラスタリングすることで、マーカーの過密状態を防ぎます。大規模データセットを扱うマップでのパフォーマンス最適化に最適で、Fluster は複数プラットフォーム間で滑らかなユーザー体験を実現します。このライブラリは Flutter アプリにシームレスに統合でき、Android、iOS、Web、macOS、Windows、Linux など複数のプラットフォームをサポートしています。

用途

  • 大規模なマップマーカーの可視化
  • 密度の高いデータによるリアルタイム位置追跡
  • マッピングUIにおけるパフォーマンス最適化
  • ズームレベルに基づく動的クラスタリング
  • 地図ベースの分析ダッシュボード

主な機能

  • 効率的な空間クラスタリングアルゴリズム
  • ズームレベルに応じたクラスタリング
  • クロスプラットフォーム対応(Android、iOS、Web、macOS、Windows、Linux)
  • 軽量で高速処理
  • Flutterマップウィジェットとの簡単な統合

適している対象

  • インタラクティブマップを開発する開発者
  • 高密度の位置データを持つアプリ
  • パフォーマンスを必要とする場所ベースのサービス
  • Google Maps や同様のプラグインを使用する Flutter 開発者
  • スケーラブルなマーカー管理が必要なプロジェクト

注意事項

  • 静的または準静的データセットに最適
  • 非常に高い頻度の更新には調整が必要になる可能性があります
  • ポイントクラスタリングに限定(ポリゴンやライン特徴は除く)
  • 正確な座標入力に依存します
  • オフラインクラスタリングのシナリオに最適化されていません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Build Status Pub

Fluster = Flutter + Cluster

A geospatial point clustering library for Dart (Flutter not actually required). The algorithm is a Dart port of supercluster.

Image

Usage

Implement Clusterable

Fluster will cluster a List of objects that conform to the Clusterable abstract class, which includes necessary information such as latitude and longitude:

class MapMarker extends Clusterable {
  String locationName;
  String thumbnailSrc;

  MapMarker(
      {this.locationName,
      latitude,
      longitude,
      this.thumbnailSrc,
      isCluster = false,
      clusterId,
      pointsSize,
      markerId,
      childMarkerId})
      : super(
            latitude: latitude,
            longitude: longitude,
            isCluster: isCluster,
            clusterId: clusterId,
            pointsSize: pointsSize,
            markerId: markerId,
            childMarkerId: childMarkerId);
}
Set up Fluster

Create a Fluster instance once you have a set of points you'd like to cluster:

List<MapMarker> markers = getMarkers();

Fluster<MapMarker> fluster = Fluster<MapMarker>(
      minZoom: 0,
      maxZoom: 20,
      radius: 150,
      extent: 2048,
      nodeSize: 64,
      points: markers,
      createCluster: (BaseCluster cluster, double longitude, double latitude) {
        return MapMarker(
            markerId: cluster.id.toString(),
            latitude: latitude,
            longitude: longitude);
      });

Parameters:

/// Any zoom value below minZoom will not generate clusters.
int minZoom;

/// Any zoom value above maxZoom will not generate clusters.
int maxZoom;

/// Cluster radius in pixels.
int radius;

/// Adjust the extent by powers of 2 (e.g. 512. 1024, ... max 8192) to get the
/// desired distance between markers where they start to cluster.
int extent;

/// The size of the KD-tree leaf node, which affects performance.
int nodeSize;

/// The List to be clustered.
List<T> points;

/// A callback to generate clusters of the given input type.
T Function(BaseCluster, double, double) createCluster;
Get the clusters

You can then get the clusters for a given bounding box and zoom value, where the bounding box = [southwestLng, southwestLat, northeastLng, northeastLat]:

List<MapMarker> clusters = fluster.clusters([-180, -85, 180, 85], _currentZoom);
Get the cluster children

You can also get the children (points and sub-clusters inside a cluster at the next zoom level, given the cluster id:

List<MapMarker> chilren = fluster.children(int clusterId);
Get the cluster points

Get only the child points (not sub-clusters) of a cluster in all the remaining zoom levels, given the cluster id:

List<MapMarker> points = fluster.points(clusterId);

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト