Skip to content

Commit

Permalink
対象レイヤーのフィーチャー取得
Browse files Browse the repository at this point in the history
  • Loading branch information
rensanrenren committed Feb 14, 2025
1 parent 2915277 commit d81c494
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ if (searchBox) {
if (!query) return; // 空文字の場合は処理しない

// 現在のビューポート内にある「moon_craters_newfixed-bk5j1l」ソースのフィーチャーを取得
const features = map.querySourceFeatures('moon_craters_newfixed-bk5j1l');
const features = map.querySourceFeatures('composite', {
sourceLayer: 'moon_craters_newfixed-bk5j1l'
});
console.log("取得したフィーチャー数:", features.length);

// フィーチャーのプロパティ "name" に対して検索
Expand Down

0 comments on commit d81c494

Please sign in to comment.