Menu Items


Menu Items are configured toggles for the user or Bookmarks to enable in a Project View.

Menu Items don't have their own records. They sit within their Project View record.

Base settings

Below are the settings that are consistent between the different Menu Item types.

interface IMenuItem {
    // Unique ID for this Menu Item.
    id: string;
    // Human readable name for this Menu Item.
    Caption: string;
    // Child Menu Items.
    // These should only be set if the Type is null, or set to 'NONE'.
    Children?: IMenuItem[];

    // The type of Menu Item.
    // This will drive the different actions and configuration settings.
    Type: EType;

    // Priority in relation to other Menu Items.
    // If two Menu Items draw the same Entity, the higher priority is drawn and the other is hidden.
    // If the priority is equal, BOTH are drawn at the same time.
    renderPriority?: number;
}

enum EType {
    // Container for other menu items.
    None = "NONE",

    // Renders Nextspace Entities based on an Entity Type ID and optional attribute filter.
    Entities = "BruceEntity",
    // Renders Entities matching specific IDs.
    EntitiesIds = "EntitiesIds",

    // Renders a Cesium Tileset made from importing an assembly file into Nextspace.
    CadTileset = "ModelTileset",
    // Renders legacy Nextspace tilesets.
    // This is primarily used for static Tilesets as they don't have an upgraded version yet.
    ArbTileset = "ArbitraryTileset",
    // Renders a Cesium Tileset by Ion asset ID.
    IonTileset = "Cesium3DTileset",
    // Renders a Cesium Tileset made from arbitrary Nextspace Entities.
    EntityTileset = "EntitiesTileset",
    // Renders a Cesium Point Cloud imported from LAS/LAZ file into Nextspace.
    PointCloud = "PointCloudTileset",

    // Renders Cesium OSM Buildings.
    Osm = "OSMBuildingsTileset",
    // Renders the Cesium Google photogrammetry tileset.
    GooglePhotoTileset = "GooglePhotoTileset",
    // Renders the result of a Google search.
    // Eg: the Menu Item can be configured to render 'restaurants' around the viewport.
    GoogleSearch = "GoogleSearch"
}

Loading Entities

Below are the Menu Items for loading Nextspace Entity data.

// Loading Entities around the viewport based on the configured Entity Type.
interface IMenuItem {
    "Type": "BruceEntity";
    "BruceEntity": {
        // ID of the Entity Type to query.
        "EntityType.ID": string;

        // (Optional) Scenario Key/ID to use when requesting Entities.
        // Scenario attributes will be overlaid if found.
        "Scenario"?: number;

        // (Optional) If true, the Menu Item will request historic Entities.
        // The scene's datetime will be included in the request to overlay historic attributes.
        // When set, the Menu Item will also react to the scene's time changing to update the Entities.
        historic?: boolean;

        // (Optional) alternative schema to request.
        // This is used to calculate read-only Entity data under a different Data Schema.
        schemaId?: string;

        // Entity attribute filter to apply.
        // This will be combined with a view-port boundary search when requesting Entities.
        // See Entities documentation around "Requesting list with an attribute query" for more information.
        "Filter"?: any;
    }

    // The historic settings are only used when the 'historic' flag is set to true.

    // If true, historic Entities will interpolate between records based on current scene time.
    // This will slow down initial render as more data will be required for the render.
    historicInterpolation?: boolean;
    // If true, historic point/icon/model Entities will draw their movement as a polyline.
    // Polyline styling will apply.
    historicDrawTrack?: boolean;
}

If you want to keep things simple and render a specific set of Entities, you can use this type:

// Loading specific array of Entity IDs.
interface IMenuItem {
    "Type": "EntitiesIds";
    "BruceEntity": {
        // Array of Entity IDs to load.
        EntityIds: string[];
    }
}

Here is how you can control the appearance of the Entities through Style records. Both of the above Menu Items support this.

interface IMenuItem {
    // Extending the above data models.
    ...
    // Defining what Style should be applied between different distances from the camera.
    // The maximum distance will determine how far away before the Entities are hidden from view.
    "CameraZoomSettings": {
        // The minimum distance in meters from the camera to enable this setting.
        MinZoom: number,
        // The maximum distance in meters from the camera to enable this setting.
        MaxZoom: number,

        // The display type to use for this setting.
        // This will determine the "best" allowed rendering type.
        // For example, if you display as "3D", then it will first try find a 3D model, then geometry, then point.
        // If you display as "geometry", it will first try find a geometry, then point and skip 3D models.
        DisplayType?: "hidden" | "point" | "geometry" | "3d",

        // The Style to use for this item.
        // If unset it will locate the default Style for the Entity Type.
        // If that is missing, then hard-coded defaults will apply.
        StyleID?: number,

        // The LOD category to use for this item.
        // When unset, it will be GLB to get GLB or GLTF 3D model files.
        LODCategoryID?: string,
        // The LOD level to use for this item.
        // When unset, it will be 0 for the highest quality.
        LODLevel?: number | string;
    }[];
}

Loading Tilesets

Below is how you can load different kinds of Tilesets.

This includes our imported assemblies (IFC, RVT, etc), point clouds (LAS/LAZ), and other Cesium tilesets that aren't terrains or basemaps.

// Loading an assembly (IFC, RVT, etc).
interface IMenuItem {
    "Type": "ModelTileset";
    "tileset": {
        // ID of the Tileset record to load.
        "TilesetID": string;
    }

    // An assembly can contain Entities from a range of Entity Types.
    // As a result, we provide a way to map different Styles by Entity Type ID>

    // Mapping for Entity Type IDs and their Styles to load.
    "StyleMapping"?: {
        // The Entity Type ID to map to a Style ID.
        "EntityTypeID": string;
        // The Style ID to use when colouring the Entities.
        "StyleID": number;
    }[];
    // The default Style to use when a specific mapping is not available.
    // If unset it will locate the default Style for the related Entity Types.
    "styleId"?: number;

    // Setting for how the style colours should be blended.
    StyleBlending?: {
        // Hightlight = 0, replace = 1, mix = 2.
        blendMode: 0 | 1 | 2;
        // 1 = 100% new colour. 0 = original colour.
        blendPercent: number;
    };
}

// Loading a Point Cloud.
interface IMenuItem {
    "Type": "PointCloudTileset";
    "tileset": {
        // ID of the Tileset record to load.
        "TilesetID": string;
    }
}

// Loading a static Tileset or Cesium Ion asset.
interface IMenuItem {
    "Type": "Cesium3DTileset" | "ArbitraryTileset";

    // If set, an ion asset is loaded..
    IonResource?: {
        AssetID: string | number;
        // If not supplied then the Client Account default is used.
        AccessToken?: string;
    }

    // If set, a Nextspace static Tileset is loaded.
    tileset?: {
        // ID of the static Tileset to load.
        "TilesetID": string;
        // Alternatively, you can use an external URL to the "tileset.json" file.
        // This is not recommended for accessing Nextspace Tilesets.
        TilesetURL?: string;
    }

    // If true, it will disable the memory watcher that distributes a max-memory allowance between Tilesets.
    // This is occasionally needed for poorly optimized Tilesets.
    // Default is false.
    noMaximumMemory?: boolean;

    // If a colour mask should be applied.
    applyMask?: boolean;
    // Css color string to apply to the tileset.
    // This follows Cesium logic for when color is pure white,
    // that means don't apply colour and only apply alpha.
    colorMask?: string;
}

Loading OSM 3D Buildings

This is a data-set provided by Cesium. Learn more about IP rights and usage at Cesium OSM Buildings.

This Menu Item will load the Cesium OSM Buildings tileset into the scene. It is recommended to pair this with the Cesium World Terrain to ensure buildings are on the ground.

// Loading a Point Cloud.
interface IMenuItem {
    "Type": "OSMBuildingsTileset";
    BruceEntity?: {
        // Preferred Entity Type ID for making new Entity records.
        // When a graphic is selected in UI and no record is found, this type ID will be used as the suggested type.
        "EntityType.ID"?: string;

        // Source record for loading and saving the mapping between OSM IDs and Nextspace IDs.
        // If not set then Entity selection will not work.
        // While documentation is not available, create a new 'Simple ID mapping' Data Source through Operator and use that ID.
        // Keep the ID consistent between different projects to maintain the same mapping.
        SourceId: string;
    };

    // If enabled then pending OSM buildings will be partially transparent.
    // A sourceId must be set for this to work.
    // A building is considered pending while it hasn't checked for a corresponding Nextspace ID.
    ghostLoading?: boolean;
}

Loading Google 3D Photorealistic tiles

This is a data-set provided by Cesium and Google. Learn more about IP rights and usage at Google 3D Photorealistic tiles.

Your account (organization) must be configured with an API key to use this feature. See the 'application keys' panel in Operator for more information.

This Menu Item will the Google photogrammetry tileset into the scene. It is recommended to hide the globe when this is enabled.

// Loading a Point Cloud.
interface IMenuItem {
    "Type": "GooglePhotoTileset";

    // Css color string to apply to the tileset.
    // This follows Cesium logic for when color is pure white,
    // that means don't apply colour and only apply alpha.
    colorMask?: string;
}

Loading Google Places

This is a data-set provided by Google. Learn more about IP rights and usage at Google Places API.

Your account (organization) must be configured with an API key to use this feature. See the 'application keys' panel in Operator for more information.

This Menu Item will load Google places based on a search keyword around the viewport.

// Loading a Point Cloud.
interface IMenuItem {
    "Type": "GoogleSearch";

    // Search keyword, eg: 'restaurants'.
    keyword: string;
    // Google API Key to use.
    // If not provided then the account default will be used.
    accessToken?: string;
}