setPollenCondition は一度に一条件のみ有効です。再設定すると上書きされます。clearPollenCondition で表示を完全に無効化できます。import * as GIA from '@ntj/gaia';
const date = (document.querySelector('[name="map-pollen-date"]') as HTMLInputElement).value;
const time = (document.querySelector('[name="map-pollen-time"]') as HTMLInputElement).value;
const offset = (document.querySelector('[name="map-pollen-offset"]') as HTMLInputElement).value;
const pollenTime = date && time ? new Date(`${date}T${time}:00`) : new Date();
map.setPollenCondition(new GIA.value.PollenCondition({
offset: parseInt(offset, 10),
time: pollenTime,
}));
// 非表示
map.clearPollenCondition();
花粉情報の表示条件を設定する — 詳細な使用例
花粉飛散量・予報データを地図上にメッシュ表示します。
PollenConditionはoffset(対象分)とtime(対象日時)を指定できます。