Development

The GeoTwin SDK exposes the scene and viewer APIs used by the platform applications. Use it to embed a scene, build a custom tool, or extend an existing map application.

Before you start

  • A published scene and the services it uses.
  • A project account with permission to read those services.
  • A browser with WebGL enabled.
  • The SDK build supplied with your deployment, or the package provided by your GeoTwin contact.

Basic flow

  1. Create a container element with a known width and height.
  2. Load the SDK assets before your application script.
  3. Create a Viewer with the container id and options.
  4. Load a scene or add layers.
  5. Register the events you need, and clean up the viewer when the page is destroyed.
<div id="map-container" style="width: 100%; height: 100%"></div>
const viewer = new Viewer('map-container', {
  // options depend on the deployment and the scene
});

// Load your scene, then release it when the page is closed.
// viewer.destroy();

The exact constructor options and scene loading calls are documented in the API pages below and in the SDK package you receive.

API reference

API Use it for
Viewer Map and 3D viewer, camera, layers, events
Scene Scene graph, navigation, highlighting, bookmarks
CompositeViewer Combine 3D, 2D map and panorama views
PanoramaViewer Panorama points, switching and screen capture
NodeData Node structure for layers, models and annotations

Conventions

  • Treat the SDK as an external dependency and pin the version used by your application.
  • Create one viewer per container; do not append multiple viewers to the same element.
  • Remove event listeners and call destroy() when leaving the page.
  • Test on the same browser and GPU class as the target users.

Support

For SDK versions, package access and compatibility questions, contact your GeoTwin project contact. Include the platform version, SDK version and a minimal reproduction when reporting an issue.