Destroys instance and frees resources
Returns the current scale of the map in meters per pixel.
Hide collision boxes for 2D entities for debugging.
Filters out layers at a certain point on the outdoor map. This can be used to hide the outdoor building footprint underneath the 3D geometry.
The polygons to filter layers under.
The layers to filter out.
Unsubscribe a function previously subscribed with on
Unsubscribe a function previously subscribed with on
An event name to which the provided function was previously subscribed.
A function that was previously passed to on. The function must have the same reference as the function that was subscribed.
A function that was previously passed to on. The function must have the same reference as the function that was subscribed.
Subscribe a function to an event.
Subscribe a function to an event.
An event name which, when fired, will call the provided function.
A callback that gets called when the corresponding event is fired. The callback will get passed an argument with a type that's one of event payloads.
Optionaloptions: { signal?: AbortSignal }Optional options object. If a signal is provided, the subscription will be automatically cleaned up when that signal is aborted.
A cleanup function that unsubscribes the event listener when called.
Projects a 3D position into screen space.
The vector to store the projected screen coordinates (x, y). If Vector3, z will contain depth from camera.
The 3D world position to project
Project a geographic coordinate to a screen coordinate
Project a clientX/clientY screen coordinate to a geographic coordinate
Perform a render of the scene. This is called internally when something changes, but can be called when adding external models The render happens in an animation frame, not matter how frequently it is called
Perform a synchronous render of the scene. This bypasses the animation frame and renders immediately.
Note: Only use this if you have an animation frame setup elsewhere
Sets the background color of the renderer. Only applies to "standalone mode"
Show collision boxes for 2D entities for debugging. Draws visible bounding rectangles on a transparent overlay canvas.
Returns the background alpha of the renderer. Only applies to "standalone mode"
Returns the background color of the renderer. Only applies to "standalone mode"
The perspective camera used for 3D scene calculations and view-dependent lighting
Returns the mode the Renderer is in.
Returns pixel ratio of the renderer
Returns the AbortSignal for this PubSub instance. Use this signal with APIs that support cancellation (fetch, addEventListener, etc.) When the PubSub is destroyed, the signal will be aborted and all listeners using it will be automatically removed.
The view camera is used for projecting both the outdoor map and our scene
Add a custom THREE.js entity to the map. The geometry is placed at the GeoJSON coordinate and includes a setup and update methods.
Setup is called when the first time the geometry visible, and update is called every render frame.
Add a conceptual feature collection from GeoJSON data.
Each feature is converted into a batched entity, which may be split across
multiple BatchedMeshes internally based on material. The collection itself
is a lightweight container; visual properties such as color, opacity,
altitude, height, etc. are driven per-feature via the style callback.
To toggle visibility of the whole collection, wrap it in a
GroupContainer via the parent argument and set visibility on the
container.
The only collection-level concern honored at creation time is the optional
mask — read from style(features[0]).
Optionalstyle: OptionalfcState: { altitude?: number; visible?: boolean }Optionalparent: null | string | number | EntityId<GroupContainerState>Add a container that can hold other containers, geometry groups, markers, labels and paths. Use this to group entities together.
Optionaloptions: {Optionalparent: null | string | number | EntityId<GroupContainerState>Add a 2D label at a GeoJSON coordinate.
Optionaloptions: AddLabelOptionsInternalOptionalparent: null | string | EntityId<GroupContainerState>Add an HTML Marker at a GeoJSON coordinate.
Optionaloptions: AddMarkerOptionsOptionalparent: null | string | number | EntityId<GroupContainerState>Add a group of models from GeoJSON data. These will be instanced automatically for better performance.
Optional__namedParameters: {Optionalparent: null | string | number | EntityId<GroupContainerState>Add a Path along a set of GeoJSON coordinates that can be animated.
Optionaloptions: AddPathOptionsOptionalparent: null | string | EntityId<GroupContainerState>Optionalparent: null | string | EntityId<GroupContainerState>Convert a GeoJSON position to a 3D map position.
The GeoJSON position to convert.
Optionalvector: Vector3Optional vector to copy the result into instead of creating a new vector.
The converted 3D map position.
Convert latitude and longitude to a 3D map position.
The latitude to convert.
The longitude to convert.
Optionalaltitude: numberOptional altitude to include in the conversion. Defaults to 0.
Optionalvector: Vector3Optional vector to copy the result into instead of creating a new vector.
The converted 3D map position.
Gets the bounding area (4 corners) in lon,lat of a geometry, geomrtry group, or group container. This can be used with Camera to focus on an entity
OptionalgeometryOrGeometryId: string | number | EntityId<EntityState>Get the center of a geometry or bounding box.
Geometry, geometry id, or bounding box to get the center of.
Get rendered state for an entity (e.g., runtime rendering state that changes frequently)
The entity to get rendered state for
Object with all available rendered state properties, or undefined if not found
Recursively get the state for the whole scene. Can be an expensive operation.
Get the current state of the map view, or any entity that was added, regardless of whether it is visible in the scene
Get the current state of the map view, or any entity that was added, regardless of whether it is visible in the scene
Get the current state of the map view, or any entity that was added, regardless of whether it is visible in the scene
OptionalgeometryOrGeometryId: string | number | Record<string | number, any>Get the current state of the map view, or any entity that was added, regardless of whether it is visible in the scene
internal
Check if the state for a given geometry or geometry id exists
The geometry or geometry id to check
True if the state exists, false otherwise
Checks if the given entity is within the current camera's view frustum. This method is useful for determining if an entity is visible on the screen.
The entity to check. This can be an object with id and type properties,
a string representing the entity's ID, or an entity state object.
true if the entity is within the camera's view, otherwise false.Labels an existing 3D geometry with a text area.
The ID of the target 3D geometry to label.
The text content to display.
Optionaloptions: AddText3DOptions & { parentId?: string }Additional options for adding the text label, including:
An object containing the ID and type of the created or existing text label, or undefined if labeling failed. If geometry is already labeld, the same text id will be returned
Subscribe a function to be called when the signal is aborted.
The function to call when the signal is aborted.
Return a list of Geometry2D IDs currently rendered on screen.
Optionaloptions: { fullyContains?: boolean; screenOffsets?: Partial<InsetPadding> }The options to query.
OptionalfullyContains?: booleanWhether to exclude entities that intersect with the screen edges after accounting for offsets.
OptionalscreenOffsets?: Partial<InsetPadding>Optional offsets to account for on the edges of the screen.
A list of IDs.
Remove an entity from the renderer and release associated resources.
Remove an entity from the renderer and release associated resources.
Set the state of the map view or any entity that was added, regardless of whether it is visible in the scene.
Updates the watermark on the map.
{WatermarkUpdateOptions}
Generic PubSub class implementing the Publish-Subscribe pattern for event handling.