Skip to content

gi-nx


gi-nx / getBlock

ts
function getBlock(blockId: string): {
  description?: string;
  features: (
     | PreStackedPoint
     | PreStackedLineString
    | PreStackedPolygon<Record<string, any>>)[];
  id: string;
  keyWords?: string[];
  name: string;
  properties?: Record<string, any>;
};

Returns the block definition for the given id, or undefined if not found.

Parameters

ParameterTypeDescription
blockIdstringThe id of the block to retrieve.

Returns

NameType
description?string
features( | PreStackedPoint | PreStackedLineString | PreStackedPolygon<Record<string, any>>)[]
idstring
keyWords?string[]
namestring
properties?Record<string, any>

Example

ts
const block = gi.getBlock("94d84733617e4c2d91b87a4da6106e8a");
if (block) {
  console.log(block.name); // "My Cool Block"
}