Skip to content

gi-nx


gi-nx / toggleLensLayer

ts
const toggleLensLayer: (layerNameOrId: string, overrides?: Partial<{
  aggregateBy?: string;
  columnDef?: Record<string, LensTypedProperty>;
  columnKeys?: string[];
  filter?: AdvancedFeatureFilter;
  filterMode?: FilterMode;
  promoteId?: string;
  sortBy?: SortBy[];
  sortDescending?: boolean;
  sourceLayer?: string;
} & {
  baseHeightKey?: string;
  circleRadius?: number;
  cluster?: boolean;
  clusterColor?: string;
  displayKeys?: string[];
  fillOpacity?: number;
  heightKey?: string;
  heightScale?: number;
  iconColor?: ColorPaletteOrFixed;
  iconHaloColor?: ColorPaletteOrFixed;
  iconImage?: string;
  iconSize?: number;
  lineColor?: ColorPaletteOrFixed;
  lineDimension?: "meters" | "pixels";
  lineWidth?: number;
  mainColor?: ColorPaletteOrFixed;
  mainLayer?: "fill" | "fill-extrusion" | "circle" | "icon" | "model" | "giraffe-baked";
  overrideCircle?: Pick<CircleLayerSpecification, "paint">;
  overrideFill?: Pick<FillLayerSpecification, "paint">;
  overrideFillExtrusion?: Pick<FillExtrusionLayerSpecification, "paint" | "layout">;
  overrideIcon?: Pick<SymbolLayerSpecification, "paint" | "layout">;
  overrideLabel?: Pick<SymbolLayerSpecification, "paint" | "layout">;
  overrideLine?: Pick<LineLayerSpecification, "paint" | "layout">;
  overrideModel?: Pick<ModelLayerSpecification, "paint" | "layout">;
  primaryLabelMaxChars?: number;
  props?: PropToProp[];
  showLabels?: boolean;
  showLines?: boolean;
  showPalette?: LensPaletteKey;
  showTable?: boolean;
  showValuesOnly?: boolean;
  tableColumnWidths?: Record<string, number>;
  textColor?: ColorPaletteOrFixed;
  textHaloColor?: ColorPaletteOrFixed;
}>, uiOverrides?: Partial<{
  defaultShowStyleConfigurator: boolean;
  doubleClickToZoom: boolean;
  enableGridCharts: boolean;
  searchString: string;
  showEmptyCellInfo: boolean;
  showInvalidCells: boolean;
  showSelectedOnly: boolean;
}>) => void = activateLensLayer;

Activate the lens for a layer.

Parameters

ParameterTypeDescription
layerNameOrIdstringThe layer name or layer ID
overrides?Partial<{ aggregateBy?: string; columnDef?: Record<string, LensTypedProperty>; columnKeys?: string[]; filter?: AdvancedFeatureFilter; filterMode?: FilterMode; promoteId?: string; sortBy?: SortBy[]; sortDescending?: boolean; sourceLayer?: string; } & { baseHeightKey?: string; circleRadius?: number; cluster?: boolean; clusterColor?: string; displayKeys?: string[]; fillOpacity?: number; heightKey?: string; heightScale?: number; iconColor?: ColorPaletteOrFixed; iconHaloColor?: ColorPaletteOrFixed; iconImage?: string; iconSize?: number; lineColor?: ColorPaletteOrFixed; lineDimension?: "meters" | "pixels"; lineWidth?: number; mainColor?: ColorPaletteOrFixed; mainLayer?: "fill" | "fill-extrusion" | "circle" | "icon" | "model" | "giraffe-baked"; overrideCircle?: Pick<CircleLayerSpecification, "paint">; overrideFill?: Pick<FillLayerSpecification, "paint">; overrideFillExtrusion?: Pick<FillExtrusionLayerSpecification, "paint" | "layout">; overrideIcon?: Pick<SymbolLayerSpecification, "paint" | "layout">; overrideLabel?: Pick<SymbolLayerSpecification, "paint" | "layout">; overrideLine?: Pick<LineLayerSpecification, "paint" | "layout">; overrideModel?: Pick<ModelLayerSpecification, "paint" | "layout">; primaryLabelMaxChars?: number; props?: PropToProp[]; showLabels?: boolean; showLines?: boolean; showPalette?: LensPaletteKey; showTable?: boolean; showValuesOnly?: boolean; tableColumnWidths?: Record<string, number>; textColor?: ColorPaletteOrFixed; textHaloColor?: ColorPaletteOrFixed; }>Optional style overrides
uiOverrides?Partial<{ defaultShowStyleConfigurator: boolean; doubleClickToZoom: boolean; enableGridCharts: boolean; searchString: string; showEmptyCellInfo: boolean; showInvalidCells: boolean; showSelectedOnly: boolean; }>Optional UI state overrides

Returns

void

Deprecated