Function setSnowfallCondition

  • 積雪深情報の表示条件を設定する — 詳細な使用例

    積雪深のデータを地図上にメッシュ表示します。 SnowfallConditionoffset(対象分)と time(対象日時)を指定できます。

    Returns void

    Warning

    • setSnowfallCondition は一度に一条件のみ有効です。再設定すると上書きされます。
    • clearSnowfallCondition で表示を完全に無効化できます。

    Example: 日時入力 + offset 指定で積雪深情報を表示する

    import * as GIA from '@ntj/gaia';

    const date = (document.querySelector('[name="map-snowfall-date"]') as HTMLInputElement).value;
    const time = (document.querySelector('[name="map-snowfall-time"]') as HTMLInputElement).value;
    const offset = (document.querySelector('[name="map-snowfall-offset"]') as HTMLInputElement).value;

    const snowfallTime = date && time ? new Date(`${date}T${time}:00`) : new Date();
    map.setSnowfallCondition(new GIA.value.SnowfallCondition({
    offset: parseInt(offset, 10),
    time: snowfallTime,
    }));

    // 非表示
    map.clearSnowfallCondition();

    See