Skip to content

2gis/mapgl-gltf

This branch is 5 commits ahead of, 2 commits behind master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Nov 7, 2024
ab0ea82 · Nov 7, 2024
Sep 5, 2024
Jul 4, 2023
Nov 7, 2024
Nov 7, 2024
Nov 7, 2024
Jun 9, 2023
Apr 17, 2023
Sep 28, 2023
Apr 17, 2023
Jun 9, 2023
Apr 21, 2023
Apr 25, 2024
Apr 25, 2024
Jun 9, 2023
Sep 28, 2023
May 31, 2023
Nov 7, 2024
Nov 7, 2024
Apr 17, 2023
Jul 5, 2023
Nov 7, 2024
Sep 28, 2023
Apr 17, 2023
Apr 17, 2023
Apr 25, 2024
Apr 25, 2024

Repository files navigation

mapgl-gltf

Plugin for the rendering glTF models with MapGL

The basic usage via npm package

Install @2gis/mapgl and @2gis/mapgl-gltf packages:

npm install @2gis/mapgl
npm install @2gis/mapgl-gltf

Import mapgl and plugin into your project:

import { load } from '@2gis/mapgl';
import { GltfPlugin } from '@2gis/mapgl-gltf';

const mapglAPI = await load();

const map = new mapglAPI.Map('container', {
    center: [82.886554, 54.980988],
    zoom: 18,
});

const plugin = new GltfPlugin(map);
plugin.addModels([{
    modelId: '03a234cb',
    coordinates: [82.886554, 54.980988],
    modelUrl: 'models/cube_draco.glb',
    rotateX: 90,
    scale: 1000,
    linkedIds: ['141373143530065', '70030076379181421'],
}]);

Testing

If you write screenshot tests, you will need run npm run docker:test after coding. This command runs your tests on the docker image that is used in pipeline build. This guarantees the authenticity of the screenshots used.

Documentation

You can find the more information in the official documentation.