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)