Function setMapVectorCondition

  • ベクター地図の表示条件を設定する — 詳細な使用例

    GaIA のベクター地図(SVG/WebGL ベースの地図タイル)の表示条件を設定します。 MapVectorCondition でスタイル・フィルタリング・表示レイヤーなどをカスタマイズできます。

    Returns void

    Warning

    • setMapVectorCondition は一度に一条件のみ有効です。再設定すると上書きされます。
    • clearMapVectorCondition でベクター地図の条件をリセットできます。
    • setTileType('satellite') 中に 3D ビル設定を変更した場合、表示モード復帰の順序に注意してください。

    Example: ベクター地図の条件を設定する

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

    map.setMapVectorCondition(new GIA.value.MapVectorCondition({
    zoomRange: new GIA.value.ZoomRange(8, 22),
    }));

    Example: 3DモードON/OFFに連動して building3D を切り替える

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

    const setMapVector3D = (enabled: boolean) => {
    if (enabled) {
    map.setMapVectorCondition(
    new GIA.value.MapVectorCondition({
    building3D: { enable: true, opacity: 0.8 },
    }),
    );
    } else {
    map.setMapVectorCondition(
    new GIA.value.MapVectorCondition({
    building3D: { enable: false },
    }),
    );
    }
    };

    setMapVector3D(true);

    // 例: satellite表示中に3D設定変更した場合は、必要に応じて表示モードを再設定
    // map.setTileType('satellite');

    See