Closed Lauranna closed 3 months ago
Hey Anna. new-print-layersrenderers-registration => here is all you need to register layer. Please note where uppercase and lover case is used. Uppercase means object and lovercase means function. You need to register an Object constructor for Object type, in your example above it most likelly you are mixing function with object. You need to find out what is the actual object created under L.nonTiledLayer.wms function and try something like:
L.BrowserPrint.Utils.registerLayer(L.nonTiledLayer.WMS, 'L.nonTiledLayer.WMS', function (layer, utils) {
return L.nonTiledLayer.wms(layer._url, utils.cloneOptions(layer.options));
});
Hi Igor, thanks for your quick response. The Uppercase parts were part of the solution. But the featurenames in this function are also different. Here is my solution:
L.BrowserPrint.Utils.registerLayer(L.NonTiledLayer.WMS, 'L.NonTiledLayer.WMS', function (layer, utils) {
return new L.nonTiledLayer.wms(layer._wmsUrl, utils.cloneOptions(layer.wmsParams));
});
Now it works pretty fine.
Thanks a lot. Regards, Anna
Hello, on my map you can display overlays such as hiking trails or municipal boundaries. I have combined the layers in an overlay group. I would like to have these included in the print as well if a overlay layer is displayed. Unfortunately I always get the error: "Unknown layer, cannot clone this layer. Leaflet version: 1.9.4". I tried registering the layers but to no avail.
Here is my Layerdefintion:
Here is my non-working layer registration:
I also tried cloning the layers individually with "cloneLayer();" , but the same error occurs.
Could the nonTiledLayer be causing problems here? I need a nudge in the right direction please -.-
Many thanks in advance for your help. Regards, Anna