v1.0.1
polylabel
一种快速算法,用于查找多边形的不可达中心点,以 Dart 库的形式实现。对于在多边形上最优放置文本标签非常有用。
10喜欢 19.4万近 30 天下载160Pub 分数
AndroidiOSWebmacOSWindowsLinux
Dart 版本的 https://github.com/mapbox/polylabel
^1.15.0^1.0.0^1.16.0以下为英文项目原文快照,最新内容请访问 GitHub。
build pub package pub points popularity likes
Dart port of https://github.com/mapbox/polylabel.
A fast algorithm for finding polygon pole of inaccessibility implemented as a Dart library. Useful for optimal placement of a text label on a polygon.
import 'dart:math';
import 'package:polylabel/polylabel.dart';
final polygon = [[Point(0, 0), Point(1, 0), Point(1, 1), Point(0, 1), Point(0, 0)]];
final result = polylabel(polygon); // PolylabelResult(Point(0.5, 0.5), distance: 0.5)