Coder Social home page Coder Social logo

Comments (5)

Igor-Vladyka avatar Igor-Vladyka commented on June 18, 2024

Do you register it properly? Can you provide a code example with a registration of this layer?

from leaflet.browser.print.

mateuszbem avatar mateuszbem commented on June 18, 2024

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
image

from leaflet.browser.print.

Igor-Vladyka avatar Igor-Vladyka commented on June 18, 2024

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.

from leaflet.browser.print.

mateuszbem avatar mateuszbem commented on June 18, 2024

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;
  });

from leaflet.browser.print.

Falke-Design avatar Falke-Design commented on June 18, 2024

Following worked for me:

L.BrowserPrint.Utils.registerLayer(
        GeoRasterLayer,
    'GeoRasterLayer',
    function(layer) {
            return new GeoRasterLayer(layer.options);
    });

from leaflet.browser.print.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.