Open mateuszbem opened 1 year ago
Do you register it properly? Can you provide a code example with a registration of this layer?
It is in ngAfterViewInit(), I tried multiple solutions, everytime with no effect.
this.layerGroup = L.layerGroup().addTo(this.map);
this.browserPrint = L.control.browserPrint({
title: 'Geotiff test',
}).addTo(this.map);
L.BrowserPrint.Utils.registerLayer(
L.LayerGroup,
'L.LayerGroup',
function(layer, utils) {
const cluster: LayerGroup = L.layerGroup(layer._group.options);
cluster.addLayer(utils.cloneInnerLayers(layer._group));
return cluster;
});
@edit In structure it is canvas
L.LayerGroup is already in the list, you need to register actual layer that is missing => GeoRasterLayer try
L.BrowserPrint.Utils.registerLayer(
GeoRasterLayer,
'GeoRasterLayer',
function(layer, utils) {
const cluster: GeoRasterLayer = GeoRasterLayer(layer._group.options);
cluster.addLayer(utils.cloneInnerLayers(layer._group));
return cluster;
});
or something like that, you would need to debug/check what exactly to pass inside function.
Thank you Igor, it works.
L.BrowserPrint.Utils.registerLayer(
GeoRasterLayer,
'GeoRasterLayer',
function(layer: any) {
const options: GeoRasterLayerOptions = {
georaster: layer.options.georaster,
opacity: 0.6,
resolution: 128,
};
const cluster: Layer = new GeoRasterLayer(options);
return cluster;
});
Following worked for me:
L.BrowserPrint.Utils.registerLayer(
GeoRasterLayer,
'GeoRasterLayer',
function(layer) {
return new GeoRasterLayer(layer.options);
});
Have you ever tried priting *.tiff files (layerGroup)?
I'm using https://github.com/GeoTIFF/georaster-layer-for-leaflet for showing .tiff files on map, but when it comes to printing it doesn't show. and the effect: