dayjournal memo

Total 974 articles!!

MapLibre GL JS #057 - ホイール更新イベント取得

Yasunori Kirimoto's avatar


画像



ホイール更新イベントを取得するメモ。



画像



main.ts

// MapTiler読み込み
const map = new maplibregl.Map({
    container: 'map',
    style: 'https://api.maptiler.com/maps/jp-mierune-streets/style.json?key=[APIキー]',
    center: [139.767, 35.681],
    zoom: 11,
});

// コントロール関係表示
map.addControl(new maplibregl.NavigationControl());

// ホイール更新イベント
map.on('wheel', function () {
    console.log('ホイール更新済');
});



MapLibre GL JSを手軽に始めるビルド環境公開しています。
maplibregljs-starter



book

Q&A