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
The render_to_texture.ts file, render the tiles by multiple layers and use the finished tile texture(were to pulled from RenderPool) to render the terrain.
However, in the if statement below, LAYER object does not have custom property, so the custom type layer is not entered in the if statement and is not pushed to this._stacks.
see the code here.
For the above reasons, the tile texture is not directly accessible on the custom type layer.
Also, in RenderPool, the tile texture is returned to the pool and reused, so even if access is possible, the custom layer does not know if it is the right timing tile texture.
That is why the custom layer does not have access to the textures used in the final terrain and therefore cannot interact with the terrain provided by maplibre.
To correct this issue, we need to add custom property to the LAYER object and add Tile and Framebuffer to the render parameter to make it accessible to the custom layer. Alternatively, you can add an optional new function such as .renderToTile to CustomLayerInterface.
// render_to_texture.ts
/**
* lookup table which layers should rendered to texture
*/
const LAYERS: { [keyof in StyleLayer['type']]?: boolean } = {
+ custom: true,
background: true,
fill: true,
line: true,
raster: true,
hillshade: true
};
The function of painter.renderLayer(painter, painter.style.sourceCaches[layer.source], layer, coords, options); does not seem to have a big problem because the function that handles the custom layer is working properly.
However, the coords parameter is not undefined. so must be passed to the custom layer.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The
render_to_texture.ts
file, render the tiles by multiple layers and use the finished tile texture(were to pulled fromRenderPool
) to render the terrain.However, in the
if
statement below,LAYER
object does not havecustom
property, so the custom type layer is not entered in the if statement and is not pushed tothis._stacks
.see the code here.
For the above reasons, the tile texture is not directly accessible on the custom type layer.
Also, in
RenderPool
, the tile texture is returned to the pool and reused, so even if access is possible, the custom layer does not know if it is the right timing tile texture.That is why the custom layer does not have access to the textures used in the final terrain and therefore cannot interact with the terrain provided by maplibre.
To correct this issue, we need to add
custom
property to theLAYER
object and add Tile and Framebuffer to the render parameter to make it accessible to the custom layer. Alternatively, you can add an optional new function such as.renderToTile
toCustomLayerInterface
.// render_to_texture.ts /** * lookup table which layers should rendered to texture */ const LAYERS: { [keyof in StyleLayer['type']]?: boolean } = { + custom: true, background: true, fill: true, line: true, raster: true, hillshade: true };
The function of
painter.renderLayer(painter, painter.style.sourceCaches[layer.source], layer, coords, options);
does not seem to have a big problem because the function that handles the custom layer is working properly.However, the
coords
parameter is notundefined
. so must be passed to the custom layer.Beta Was this translation helpful? Give feedback.
All reactions