패키지, 저장소 및 앱 카테고리 검색

fluster 표지
패키지 상세v1.2.0

fluster

Dart용 지리공간 포인트 클러스터링 라이브러리로, 지도 솔루션에서 마커 간의 간격을 제공하는 데 도움을 줍니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.4만
좋아요
134
Pub 점수
150

패키지 설치

flutter pub add fluster

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Fluster는 Dart용 지오스페이셜 포인트 클러스터링 라이브러리로, 매핑 애플리케이션에서 지도 마커를 효율적으로 그룹화하고 관리하도록 설계되었습니다. 줌 레벨과 공간적 근접성에 따라 포인트를 동적으로 클러스터링함으로써 마커 과잉 표시를 방지합니다. 대규모 데이터셋을 포함한 맵의 성능 최적화에 적합하며, 플랫폼 간 원활한 사용자 경험을 보장합니다. 이 라이브러리는 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);

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트