class
GltfPlugin
Event emitter
new constructor(map, pluginOptions?)
The main class of the plugin
Example:
const plugin = new GltfPlugin (map, {
modelsLoadStrategy: 'waitAll',
dracoScriptsUrl: 'libs/draco/',
ambientLight: { color: 'white', intencity: 2.5 },
});
plugin.addModels([
{
modelId: '03a234cb',
coordinates: [82.886554, 54.980988],
modelUrl: 'models/cube_draco.glb',
rotateX: 90,
scale: 1000,
},
]);
map
The map instance
pluginOptions?
GltfPlugin initialization options
addModels(modelOptions)
Add the list of models to the map Use this method if you want to add a list of models to the map at the same time
modelOptions
An array of models' options
addModelsPartially(modelOptions, ids)
Add the list of models to the map partially Use this method if you want to add to the map some models from the list of models and want to preserve remaining ones in the cache without adding them to the map
modelOptions
An array of models' options
ids
An array of identifiers of the models that must be added to the scene
addPoiGroup(options, state?)
Add the group of poi to the map
options
Options of the group of poi to add to the map
state?
State of the active building to connect with added the group of poi
addRealtyScene(scene, state?)
Add the interactive realty scene to the map
scene
The options of the scene to add to the map
state?
State of the active building to connect with added scene
removeModel(id, preserveCache?)
Remove the model from the map and cache or from the map only
id
Identifier of the model to delete
preserveCache?
Flag to keep the model in the cache
removeModels(ids, preserveCache?)
Remove models from the map and cache or from the map only
ids
preserveCache?
Flag to keep the model in the cache
removeRealtyScene(preserveCache?)
Remove interactive realty scene from the map
preserveCache?
Flag to keep the model in the cache