Closed yemling closed 5 years ago
Hi, It's quite easy. And you need to add this code before first print (so it's actually in any place of your code near map creation logic).
So we adding first arg to compare for typeof, second to get for event as marker and last one to actually recreate marker.
L.Control.BrowserPrint.Utils.registerLayer( L.ShapeMarker, "L.ShapeMarker", function(layer, utils) { return L.shapeMarker(layer.getLatLng(), utils.cloneOptions(layer.options)); } );
thank you!
TE AMO!
Your leaflet.browser.print is a great plugin. I just need a little help. I’m not sure how to register a renderer for L.ShapeMarker (https://github.com/rowanwins/Leaflet.SvgShapeMarkers). I’ve tried L.Control.BrowserPrint.Utils.registerRenderer(L.SVG, 'L.SVG'); and L.Control.BrowserPrint.Utils.registerRenderer(L.ShapeMarker’ 'L.ShapeMarker'); (using different capitalisation variations) And I’ve added both… And it’s not working. Should the registerRenderer be added before or after the BrowserPrint is added to the map? Please can you advise? Thanks in advance.