SDK JS
    Preparing search index...

    Streams an Esri I3S Point feature SceneServer (layerType:"Point" — discrete features: trees, street furniture, wind turbines) and renders it georeferenced. Feature positions draw as GPU dots by default; I3sPointLayerOptions.autoModel instead resolves the service's own drawingInfo 3D asset and instances that real glTF model per feature, sized by its sizeInfo variable, while I3sPointLayerOptions.labels rasterises per-feature text over whichever base render is in use. Only id and url are required, and no network happens until map.addLayer runs it.

    Mercator only, and WebGL2 only — on a WebGL1 context the layer goes inert and draws nothing. Geographic (wkid 4326) and Web Mercator services are supported; any other projected CRS throws on load, so use the service's geographic (…_WGS) variant. This is the FEATURE entry point — for a lidar point cloud use I3sPointCloudLayer.

    import { I3sPointLayer } from '@bitruvius/sdk-maplibre';

    map.addLayer(new I3sPointLayer({ id: 'trees', url: 'https://…/SceneServer/layers/0' }));

    Implements

    • CustomLayerInterface
    Index

    Constructors

    Properties

    id: string

    A unique layer id.

    renderingMode: "3d" = ...

    Either "2d" or "3d". Defaults to "2d".

    type: "custom" = ...

    The layer's type. Must be "custom".

    Methods

    • Revert to the default (no-sun) lighting — the clearSun half of SunLightable (used when the geo-sun system is disabled). Clearing lastSun also gates off the cast-shadow pass.

      Returns void

    • Returns string | undefined

    • The dataset's camera target [lng, lat] (degrees) — handy for driving your own flyTo.

      Returns [number, number] | null

      [lng, lat] in degrees, or null until the dataset's anchor is known.

    • The dataset's geographic footprint as [west, south, east, north] in degrees, read from the service document and normalised out of whatever CRS it was published in.

      Returns LayerExtent | null

      [west, south, east, north] in degrees, or null before the layer document resolves — or after, when the service declared no extent (or one in a CRS the reader cannot invert).

      Where getCenter answers "point the camera here", this answers "is this dataset on screen at all" — what a caller holding several layers needs before deciding what to load, in what order, and which of them deserve resident memory.

    • Whether streaming text labels are active (a label field resolved to a fetchable attribute).

      Returns boolean

    • MapLibre CustomLayerInterface hook — invoked when the layer is added with map.addLayer; initializes GL resources and begins streaming.

      Parameters

      Returns void

    • MapLibre CustomLayerInterface hook — invoked when the layer is removed with map.removeLayer; releases GL resources and stops streaming.

      Returns void

    • Pick the Point FEATURE under a canvas pixel. A CPU ray pick over the resident MODEL tiles — nearest point within a few px, front-most wins — then fetches that feature's per-feature attributes on demand. Assumes one point per feature (the common Point case) for the ordinal → attribute mapping.

      Parameters

      • x: number

        Canvas X in CSS pixels, top-left origin (e.g. a MapLibre click event's e.point.x).

      • y: number

        Canvas Y in CSS pixels, top-left origin (e.g. e.point.y).

      Returns Promise<I3sPointPickedFeature | null>

      The picked I3sPointPickedFeature (objectId, ordinal, all attribute fields), or null on a miss, in dots mode (model mode only for now), or before the first frame.

    • Resolve a canvas point to the 3D geographic position of the frontmost rendered feature — the screen→scene primitive behind measurement and slice placement. Model mode picks the instanced 3D model surfaces (GPU pick pass); points/icon mode picks the GPU dots (in icon mode the hidden dots base sits exactly at the icons' anchor points, so picking it IS the icon position). When both renderers exist the nearest hit (smallest depth01) wins.

      Parameters

      • x: number

        Canvas X in CSS pixels, top-left origin (e.g. a MapLibre click event's e.point.x).

      • y: number

        Canvas Y in CSS pixels, top-left origin.

      • snapRadiusPx: number = 0

        Snap radius in CSS pixels (default 0 = exact pixel): the nearest hit within the radius wins.

      Returns PickedPosition | null

      The picked position (lng/lat degrees, height metres above the rendered ground datum, plus the cross-layer-comparable depth01), or null on a miss / before the first frame.

    • Optional method called during a render frame to allow a layer to prepare resources or render into a texture.

      The layer cannot make any assumptions about the current GL state and must bind a framebuffer before rendering.

      Parameters

      Returns void

    • Working-set load fraction (0–1): drawn tiles over drawn plus still-pending (loading/in-flight/queued). 1 once the current view is fully resolved.

      Returns number

      The fraction, or 0 before the engine exists.

    • Called during a render frame allowing the layer to draw into the GL context.

      The layer can assume blending and depth state is set to allow the layer to properly blend and clip other layers. The layer cannot make any other assumptions about the current GL state.

      If the layer needs to render to a texture, it should implement the prerender method to do this and only use the render method for drawing directly into the main framebuffer.

      The blend function is set to gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA). This expects colors to be provided in premultiplied alpha form where the r, g and b values are already multiplied by the a value. If you are unable to provide colors in premultiplied form you may want to change the blend function to gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA).

      Parameters

      Returns void

    • Which renderer is active: 'model' (instanced 3D models — an explicit model or an autoModel- resolved Esri asset), 'icon' (2D billboard sprites from the service's icon symbology), 'points' (GPU dots — the default or the autoModel fallback), or 'loading' before the renderer is chosen. Lets a consumer tell whether auto-symbology resolved a real model vs fell back to dots.

      Returns "model" | "loading" | "icon" | "points"

    • Model mode: per-frame DRAWN counts from the last frame — 3D-model instances + triangles + draw calls actually rendered (the GPU-load signal, distinct from stats().points = RESIDENT instances). Null in dots mode.

      Returns { drawCalls: number; instances: number; triangles: number } | null

    • Resize the resident-memory budget live (the runtime equivalent of the budget ctor option). Shrinking evicts far/out-of-view tiles down to the new ceiling on the next frame; growing lets the far LOD refill.

      Parameters

      • opts: { maxBytes?: number; maxPoints?: number }

        New ceilings. maxBytes = resident VRAM budget (bytes); maxPoints = resident point / model-instance cap. Each is applied independently when set.

      Returns void

    • Show/hide the icon billboards (icon-symbolised services).

      Parameters

      • visible: boolean

      Returns void

    • Show/hide the text labels (when a labelField or the service's labelingInfo is in effect).

      Parameters

      • visible: boolean

      Returns void

    • Live distance-weighted LOD: the distance (m) over which the LOD coarsens ~2× (smaller = thins harder/closer, denser near). null/0 disables (uniform LOD). Model mode only.

      Parameters

      • doubleDistanceM: number | null

      Returns void

    • Live model distance cusp (m): cull models beyond this. null restores the adaptive default. Ignored while the constructor's I3sPointLayerOptions.modelMaxDistance is set — that fixed value wins.

      Parameters

      • meters: number | null

      Returns void

    • Fade the layer over the basemap.

      Parameters

      • opacity: number

        Opacity in [0, 1] (clamped); 0 = transparent, 1 = opaque.

      Returns void

    • Toggle cast shadows at runtime (the setShadows half of SunLightable). Model mode only (the GPU-dots path has no mesh to cast). Needs a sun via I3sPointLayer.setSunState.

      Parameters

      • on: boolean

        true to cast the tree models into the shared cascade atlas, false to disable.

      Returns void

    • Adopt (or clear) the shared vector-drape atlas — satisfies the DrapeReceiver contract, so enableVectorDrape drives this layer directly. Forwarded to whichever renderer(s) exist — the model meshes and/or the GPU dots — and stashed until they do.

      Parameters

      • shared: SharedDrape | null

      Returns void

    • Light the tree models from a SunState — satisfies @bitruvius/sdk-maplibre's SunLightable, so a GeoSunSystem / RendererSunController drives this layer directly (relit as the sun moves). Model mode only; a no-op for the GPU-dots path (the sun is stored + applied if it later switches to model mode).

      Parameters

      Returns void

    • Show/hide the layer without removing it (streaming continues so it's instant to bring back).

      Parameters

      • visible: boolean

        true to show, false to hide.

      Returns void

    • Streaming stats for a debug HUD / load indicator.

      Returns I3sPointFeatureEngineStats | null

      The engine's I3sPointFeatureEngineStats (resident / loading / in-flight counts and bytes), or null before the engine has initialized.