GltfPlugin | MapGL | 2GIS Documentation
MapGL JS API

GltfPlugin

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,
    },
]);
Parameters
map
MapGL

The map instance

pluginOptions?
PluginOptions

GltfPlugin initialization options

Returns
Methods