Leaflet browser print plugin doesn't show scale on print

215 views
Skip to first unread message

Elton Santos

unread,
Dec 5, 2017, 8:51:30 AM12/5/17
to Leaflet
I'm using the plugin Leaflet browser print and have a problem, when I click to print, I I would like to show the scale in the print, but I can not do it at all. Even though you configured exactly as shown in the example (https://github.com/Igor-Vladyka/leaflet.browser.print), it does not appear.

My code is basic:

// PRINT
        ctlPrint
= L.browserPrint({
            closePopupsOnPrint
: false,      
            printModesNames
: {Portrait:"Retrato", Landscape:"Paisagem", Auto:"Auto", Custom:"Selecione a área"}
       
}).addTo(map);


        map
.on("browser-print-start", function(e){
            L
.control.scale({
                position
: 'topleft',
                imperial
: false,
                maxWidth
: 200
           
}).addTo(e.printMap);
       
});

Just it! According to the code, the scale was to be shown at the top and left, and in the preview before printing it actually shows the scale, but when it is to print no. Somebody help me? Thanks! My code is here: https://github.com/eltonsantos/mapasFortaleza/blob/master/js/script.js
Reply all
Reply to author
Forward
0 new messages