Skip to content

Documentation / @giro3d/piero / index / createPieroApp

Function: createPieroApp() ​

createPieroApp(params): Promise<PieroApplication>

Defined in: packages/piero/src/createPieroApp.ts:59

Entry point for a Piero application.

Parameters ​

params ​

baseUrl? ​

string

The base URL of the application. This is used to resolve relative URLs.

Example

ts
'http://localhost:8080/' or 'https://mydomain.com/myapp/'

Default Value

ts
'./'

configuration? ​

string | { annotations?: PointAnnotation[]; bookmarks?: Bookmark[]; crsDefinitions?: CrsDefinitionCollection; data?: DatasetOrGroup[]; modules?: Record<string, unknown>; scene: { basemap: { background?: string | null; extent: Extent; skirt?: number; }; camera: LookAt; crs: string; }; title?: string; version: 2; }

The static configuration to use, or the URL to a remote configuration. If no configuration is specified, the default configuration will be used.

container ​

string | Element

Where to attach the piero root DOM element. Can be either the id of an existing element, or a reference to a DOM element.

modules? ​

ModuleConstructor[]

The list of modules to load.

Default Value

ts
[]

Returns ​

Promise<PieroApplication>

A promise that resolves when the application has been initialized and is ready to use.