Class Text3D

Text3D creates three-dimensional text labels that are rendered directly in the 3D scene. These labels are perfect for displaying space names, room numbers, or any text that needs to be visible from any angle in the 3D environment.

  • 3D text rendering with depth and perspective
  • Automatic text wrapping and sizing
  • Customizable fonts, colors, and materials
  • Performance-optimized with web worker support
// Create labels for all spaces
const labels = mapView.Text3D.labelAll();

// Create a label for a specific space
const label = mapView.Text3D.label(space, "Room 101", { fontSize: 12 });

// Remove a specific label
mapView.Text3D.remove(label);

// Remove all labels
mapView.Text3D.removeAll();
  • Use labelAll() for better performance when creating multiple labels.
  • Customize text appearance with fonts, colors, and materials.
  • Use labelAll() with options to apply consistent styling to all labels.
  • Text3D labels are automatically positioned and sized based on space geometry.

This class is accessed using MapView.Text3D.

Methods

  • Creates a 3D text label for a given space.

    Parameters

    Returns undefined | Text3DView

    A Text3DView instance representing the created label, or undefined if creation failed.

    If the target is not a Space.

    const label = mapView.Text3D.label(space, "Conference Room A", { fontSize: 12 });
    
    const label = mapView.Text3D.label(space); // Uses space.name
    
    const label = mapView.Text3D.label(space, "VIP Room", {
    fontSize: 16,
    color: 'gold',
    backgroundColor: 'rgba(0, 0, 0, 0.8)'
    });
  • Creates polygon labels for all spaces.

    Parameters

    Returns Text3DView[]

    An array of Text3DView instances representing the created labels. If a space is already labeled, the existing Text3D instance will be returned.

    const labels = mapView.Text3D.labelAll();
    
    const labels = mapView.Text3D.labelAll({
    fontSize: 14,
    color: 'white',
    backgroundColor: 'rgba(0, 0, 0, 0.7)'
    });
  • Removes one or more Text3D labels from the map.

    Parameters

    • target: Text3DView

      Can be either:

      • A single Text3DView instance
      • An array of Text3DView instances
      • A string ID of the Text3DView to remove

    Returns void

    mapView.Text3D.remove(text3dView);
    
    mapView.Text3D.remove([text3dView1, text3dView2]);
    
    mapView.Text3D.remove("text3d-123");
    
  • Removes one or more Text3D labels from the map.

    Parameters

    • target: string

      Can be either:

      • A single Text3DView instance
      • An array of Text3DView instances
      • A string ID of the Text3DView to remove

    Returns void

    mapView.Text3D.remove(text3dView);
    
    mapView.Text3D.remove([text3dView1, text3dView2]);
    
    mapView.Text3D.remove("text3d-123");
    
  • Removes all Text3D labels from the current map.

    Returns void

    mapView.Text3D.removeAll();