コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ブロックする >ConnectionDB >searchForClosest
ConnectionDB.searchForClosest() メソッド
この接続に最も近い互換性のある接続を見つけます。
署名:
searchForClosest(conn: RenderedConnection, maxRadius: number, dxy: Coordinate): {
connection: RenderedConnection | null;
radius: number;
};
パラメータ
パラメータ |
型 |
説明 |
接続 |
RenderedConnection |
対応するパートナーを探している接続。 |
maxRadius |
数値 |
別の接続までの最大半径。 |
dxy |
座標 |
データベース内のこの接続の位置と現在の位置(ドラッグの結果)とのオフセット。 |
戻り値:
{ connection: RenderedConnection |null;radius: number;}
「connection」という 2 つのプロパティを含む別の接続または null、および「radius」距離です。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-25 UTC。"],[],["The `searchForClosest()` method in `ConnectionDB` locates the nearest compatible connection. It takes a `RenderedConnection` (`conn`), a `maxRadius` (number), and a `Coordinate` (`dxy`) for location offset as parameters. It returns an object containing two properties: `connection`, which is either a found `RenderedConnection` or `null`, and `radius`, the distance to the found connection. The method identifies the closest matching connection within the defined radius.\n"]]