aratcliffe / Leaflet.print

Plugin for printing a Leaflet map using either Mapfish or the GeoServer print module.
114 stars 40 forks source link

Configuration in Mapfish print 3 with leaflet #24

Open BasmaNabil opened 7 years ago

BasmaNabil commented 7 years ago

I am new to Mapfish print 3,i need help to know the configuration of the files to be able to print map in leaflet using mapfish print 3 (config.yaml,json.etc...),can anyone help me in that? This is my map:

      `var 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);

    ProvincesLayer=L.geoJson(
            Provinces,
            {style : ProvincesStyle,
             onEachFeature : ProvincesOnEachFeature
            }).addTo(mymap);
    mymap.fitBounds(ProvincesLayer.getBounds());`