v1.0.1
polylabel
一种快速算法,用于查找多边形的不可达中心点,以 Dart 库的形式实现。对于在多边形上最优放置文本标签非常有用。
10喜欢 36.8万近 30 天下载160Pub 分数
AndroidiOSWebmacOSWindowsLinux
Dart 版本的 https://github.com/mapbox/polylabel
以下为英文项目原文快照,最新内容请访问 GitHub。
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)
依赖清单 3 项
^1.15.0^1.0.0^1.16.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗