TomTom Maps for JavaScript
    Preparing search index...

    Class Landmarks3D

    Renders TomTom Orbis 3D Landmarks (high-detail building meshes) on a TomTomMap.

    The plugin streams GLB tiles from the Orbis 3D Landmarks API (Private Preview), renders them with Three.js via a MapLibre custom layer, filters overlapping extruded basemap buildings out of the style, and keeps everything restored across map style changes.

    Private Preview until the plugin's 1.0.0 release.

    It requires an API key with Orbis 3D Landmarks entitlements. Its look is a set of knobs, listed in landmarks3DKnobCatalogue.

    • The colour, opacity, gradient and zoom range you leave unset follow the base map's 3D buildings, through style changes and anything that restyles them, falling back to the streetLight style's look.
    • Whether those buildings show is the buildings3D group of the BaseMapModule, hidden in most standard styles; the plugin leaves it as it is.
    • A visible Buildings3D on the same map takes their place: the landmarks then follow its look and its light instead.
    import { Landmarks3D } from '@tomtom-org/maps-sdk-plugin-landmarks-3d';

    // assume `map` is your initialized TomTomMap instance
    const landmarks = new Landmarks3D(map);

    landmarks.updateConfig({ color: '#c8b28a' });
    Index
    • Creates the plugin bound to a TomTom map and starts rendering landmarks as soon as the map is ready.

      Parameters

      • map: TomTomMap

        The TomTom map instance to render landmarks on.

      • Optionaloptions: Landmarks3DOptions

        The knobs to start with, how to request tiles, and where to load the texture transcoder from.

      Returns Landmarks3D

    • get events(): UserEvents<BuildingHit, never>

      The user events of the landmarks: a handler gets the landmark under the pointer, with its id and its position as [longitude, latitude].

      Returns UserEvents<BuildingHit, never>

      • While a handler listens, the hovered landmark turns towards hover.color and the clicked one towards click.color, until the next click lands elsewhere.
      • Among the buildings of a Buildings3D, a landmark takes the pointer only where no building stands in front of it. Over the style's own 3D buildings, it takes it wherever it shows.
      landmarks.events.on('click', (landmark) => console.log(landmark.id, landmark.properties.position));
      
    • get layer(): ModelsLayer

      The underlying MapLibre custom layer, for advanced use beyond this facade.

      Returns ModelsLayer

    • Replaces the whole configuration. An empty object unsets every knob, back to the base map's 3D buildings or the knob's own default.

      Parameters

      Returns void

      Use it, and updateConfig, for a look your code writes: as on a map module, the type is the check, and the values are not checked again. For values held as data, the SDK's setKnobs checks each against landmarks3DKnobCatalogue and sets them by id.

      landmarks.applyConfig({ color: '#c8b28a', opacity: 0.9 });
      
    • Returns the knobs set, as a plain serializable copy. The SDK's getKnob reads a knob's value in force: when unset, the base map's, or the knob's own default.

      Returns Landmarks3DConfig

    • The colours setLandmarkColors gave, by id.

      Returns Record<string, string>

    • Whether the landmarks are set to be shown: the visible knob, true unless set.

      Returns boolean

    • Unsets every knob, so the landmarks are shown and look like the base map's 3D buildings, with each other knob at its own default.

      Returns void

    • Gives the landmarks with these ids a colour of their own, in place of their color and palette colour, and every other one its own colour back. An empty object clears them.

      Parameters

      • colors: Readonly<Record<string, string>>

      Returns void

      The ids are the ones events report, which stay the same in every session, so you can colour a landmark before it loads. Under texture: 'color', a landmark you colour draws as under detail: your colour, with its texture's light and shade over it.

      landmarks.setLandmarkColors({ [landmark.id]: '#e4572e' });
      
    • Shows or hides the landmarks. Stored as visible in the configuration.

      Parameters

      • visible: boolean

        true to show landmarks, false to hide them.

      Returns void

    • Changes the given knobs and keeps the others, one level deep: a part you pass, such as hover, replaces that part's values.

      Parameters

      Returns void

      landmarks.updateConfig({ opacity: 1 }); // the colour still follows the base map