how to print map in leaflet using MapFish print 3

410 views Asked by At

I want to print my map in leaflet using MapFish print 3,i always got an error i want to know how to solve it & where is the file info.json?,what are the steps to add a print button in my application to print map?

Here is my code for the map in leaflet:

mymap = L.map('map').setView([8.7144, 125.7481],8);
    L.tileLayer( 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
        attribution: '&copy; <a href="https://www.openstreetmap.org/copyright"></a>',
        subdomains: ['a','b','c']
    }).addTo(mymap);
    L.control.scale({imperial:false}).addTo(mymap);

    var printProvider = L.print.provider({ 
            method: 'GET', 
            url: 'http://localhost:9090/print', 
            autoLoad: true, 
            outputFormat: 'pdf', 
            dpi: 90 
        }); 
    var printControl = L.control.print({ 
            provider: printProvider 
        }); 
    mymap.addControl(printControl);

Error: http://localhost:9090/print/info.json 404 (Not Found)

0

There are 0 answers