Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I successfully fired up a MapFish print server on Elastic Beanstalk, and it prints out the sample spec files fine, but I'm trying to pass bounds from my Leaflet frontend now, and encountering a lot of difficulty.

The OSM spec provided uses scale and center, but the docs indicate that bbox is another option allowed, so I thought I could use that. But whenever I try to modify said OSM config to use my working bounds from LeafLet, all I end up with is a blank PDF output.

I have been experimenting with Proj4 to convert these latlng points in meter units with the Google Projection used in spec below, but that isnt working out too well for me either.

So my base question is, how would I modify the sample,working, OSM spec, seen below, to allow for lat/lngs bounds?

I figure I would have to modify the SRS to 'EPSG:3857' (since that is what Leaflet is using), and units to 'degrees'...but how do I prep my latlng numbers?

{
layout: 'A4 portrait',
title: 'A simple example',
srs: 'EPSG:900913',
dpi: 190,
units: 'm',
layers: [
    {
        baseURL: 'http://tile.openstreetmap.org/',
        type : 'Osm',
        maxExtent: [-20037508.3392,-20037508.3392,20037508.3392,20037508.3392],
        tileSize: [256,256],
        resolutions: [156543.0339,78271.51695,39135.758475,19567.8792375,9783.93961875,4891.969809375,2445.9849046875,1222.99245234375,611.496226171875,305.7481130859375,152.87405654296876,76.43702827148438,38.21851413574219,19.109257067871095,9.554628533935547,4.777314266967774,2.388657133483887,1.1943285667419434,0.5971642833709717],
        extension : 'png'
    }
],
pages: [
    {
        center: [731000,5864000],
        scale: 100000,
        mapTitle: "OSM Map",
        comment: "This is the first page selected by the user.",
        rotation: 0,
        data: {
            data: [
                {id:1, name: 'blah', icon: 'icon_pan', nameBackgroundColor: 'red', nameBorderColor: 'blue'},
                {id:2, name: 'blip', icon: 'icon_zoomin', nameBackgroundColor: 'yellow', nameBorderColor: 'green'}
            ],
            columns: ['id', 'name', 'icon']
        }
    }
]

}

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.