You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to Trigger Behavior
1. Initialize a maplibregl.Map instance with renderingMode: "3d".
2. Add a custom WebGL layer (type: "custom") to render a non-regular 3D object.
3. The map loads, but the custom 3D object does not appear on the map.
maplibre-gl-js version:
5.1.0
@maptiler/sdk version:
3.0.1
Browser:
Google Chrome
Steps to Trigger Behavior
1. Initialize a maplibregl.Map instance with renderingMode: "3d".
2. Add a custom WebGL layer (type: "custom") to render a non-regular 3D object.
3. The map loads, but the custom 3D object does not appear on the map.
`
const map = new maplibregl.Map({
container: "map",
style: "https://api.maptiler.com/maps/streets/style.json?key=YOUR_MAPTILER_KEY",
center: [121.5, 31.2], // Example coordinates
zoom: 15,
pitch: 60,
bearing: 30,
renderingMode: "3d",
});
map.on("load", () => {
map.addLayer({
id: "custom-3d-layer",
type: "custom",
renderingMode: "3d",
onAdd: function (map, gl) {
this.gl = gl;
this.program = gl.createProgram(); // Custom WebGL setup here
// Shader setup, buffer initialization, etc.
},
render: function (gl, matrix) {
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
// WebGL rendering logic for 3D object
},
});
});
.....................
`
Expected Behavior
The custom 3D geometry should render correctly on the map, appearing above the terrain.
Actual Behavior
The custom 3D object does not appear on the map. The map itself loads normally. No errors appear in the console.
This prevents me from rendering custom 3D objects on MapLibre maps using type: "custom" layers. Please advise on possible solutions or workarounds.
The text was updated successfully, but these errors were encountered: