SDK JS
    Preparing search index...
    • Drive a set of layers as one.

      Type Parameters

      • T extends object

      Parameters

      • layers: readonly T[]

        The members. They must already be added to the map; this does not add them.

      • opts: UnifyLayersOptions = {}

        See UnifyLayersOptions. Pass map + budgetBytes to enable the governor.

      Returns UnifiedLayer & Partial<T>

      A UnifiedLayer that also carries every method the members share, so it can be handed straight to LayerSettingsWidget (or nested inside another unifyLayers).

      const campus = unifyLayers(areas, { map, label: 'Campus', budgetBytes: 1.5e9 });
      map.addControl(new LayerSettingsWidget({ layer: campus }), 'top-right');
      map.addControl(new MeasurementWidget({ pickLayers: [campus] }), 'top-right');