class
GltfPlugin
Event emitter.
new constructor(map, pluginOptions?)
The main class of the plugin.
Example:
const plugin = new GltfPlugin(map, {
modelsLoadStrategy: 'waitAll',
modelsBaseUrl: 'https://url_to_models',
});
plugin.addModels([
{
modelId: '03a234cb',
coordinates: [82.886554, 54.980988],
modelUrl: 'models/cube_draco.glb',
rotateZ: 90,
scale: 2,
},
]);
map
The map instance.
pluginOptions?
GltfPlugin initialization options.
addLabelGroup(options, state?)
Adds a group of labels to the map.
options
Options of the group of labels.
state?
A state of active building and floor a group of labels is associated with.
addModel(modelToLoad, hideOnLoad)
Adds a model to the map.
modelToLoad
Options of a model.
hideOnLoad
Set to
true
if a model should be hidden on loading completion.
addModels(modelsToLoad, modelIdsToShow?)
Adds a list of models to the map.
modelsToLoad
An array of options of models.
modelIdsToShow?
An array of ids of models that should be shown. If it's not provided all models will be shown.
addRealtyScene(scene, state?)
Adds an interactive realty scene to the map.
scene
Options of the scene to add to the map.
state?
A state of building and floor that should be active on realty scene initialization.
getModelStatus(id)
Returns a current status of a model. There can be no model or it can be loading or loaded.
removeLabelGroup(id)
Removes a group of labels from the map.
id
A label group id.
removeModel(id, keepModel?)
Removes a model from the map.
id
A model id.
keepModel?
Specifies whether model data should be cached for future use.
removeModels(ids, keepModels?)
Removes models from the map.
ids
keepModels?
Specifies whether model data should be cached for future use.
removeRealtyScene(keepModels?)
Removes an interactive realty scene from the map.
keepModels?
Specifies whether model data should be cached for future use.
setOptions(pluginOptions)
Sets options of the plugin.
pluginOptions
Plugin options that are available for setting.