Code Monkey home page Code Monkey logo

Comments (6)

geekdenz avatar geekdenz commented on September 3, 2024

When I yank it through my print module, I get:

<ServiceExceptionReport version="1.1.1">   
<ServiceException>      Error rendering coverage on the fast pathjava.net.SocketTimeoutException: Read timed outRead timed out</ServiceException>
</ServiceExceptionReport>

for the WMS image request. Is the WMS not public?

from mapfish-print.

geekdenz avatar geekdenz commented on September 3, 2024

Never mind, it just timed out. But now I get another unrelated exception... Still investigating.

from mapfish-print.

geekdenz avatar geekdenz commented on September 3, 2024

Can you please provide as much information as possible about the exact version of MFP you are using?

Preferably commit, but if you say release 2.0-SNAPSHOT or similar that is also helpful. Best if you say how you downloaded it.

from mapfish-print.

geekdenz avatar geekdenz commented on September 3, 2024

OK, found it in the trunk version, so this is a valid problem. It should fix it if you provide a style in the geojson.

This works for me:

{
    "layout": "A4 portrait",
    "title": "A simple example",
    "srs": "EPSG:4326",
    "units": "dd",
    "outputFilename": "mapfish-print",
    "outputFormat": "pdf",
    "layers": [
        {
            "type": "WMS",
            "format": "image/png",
            "layers": [
                "OSM-GB:__all__"
            ],
            "baseURL": "http://projects.local/OSM-GB.png"
        },
        {
            "type": "Vector",
            "styles": {
                "": {
                    "fill": "red",
                    "stroke-width": "3",
                    "fill-opacity": 0.6
                }
            },
            "geoJson": {
                "type": "FeatureCollection",
                "features": [
                    {
                        "type": "Feature",
                        "geometry": {
                            "type": "Point",
                            "coordinates": [
                                -0.0996621,
                                51.5059247
                            ]
                        },
                        "properties": {}
                    },
                    {
                        "type": "Feature",
                        "geometry": {
                            "type": "Point",
                            "coordinates": [
                                -0.099332,
                                51.5072
                            ]
                        },
                        "properties": {}
                    },
                    {
                        "type": "Feature",
                        "geometry": {
                            "type": "Point",
                            "coordinates": [
                                -0.0945508,
                                51.50240484
                            ]
                        },
                        "properties": {}
                    }
                ]
            }
        }
    ],
    "pages": [
        {
            "center": [
                0.09,
                51.5
            ],
            "scale": 4000000,
            "dpi": 190,
            "mapTitle": "First map",
            "comment": "The \"routes\" layer is not shown (the scale is too small)",
            "data": [
                {
                    "id": 1,
                    "name": "blah",
                    "icon": "icon_pan"
                },
                {
                    "id": 2,
                    "name": "blip",
                    "icon": "icon_zoomin"
                }
            ]
        },
        {
            "center": [
                0.09,
                51.5
            ],
            "scale": 500000,
            "dpi": 190,
            "mapTitle": "Second map",
            "comment": "This is a zoomed in version of the first map. Since the scale is more appropriate, we show the \"routes\" layer.",
            "data": [
                {
                    "id": 1,
                    "name": "blah",
                    "icon": "icon_pan"
                },
                {
                    "id": 2,
                    "name": "blip",
                    "icon": "icon_zoomin"
                }
            ]
        }
    ]
}

Although I noticed that the points were black. Maybe the vector rendering needs some more work, which I'm happy to do if there is some kind of reward.

from mapfish-print.

chill avatar chill commented on September 3, 2024

With regards to how I downloaded it, I went to https://github.com/mapfish/mapfish-print, hit the download zip button on the right side, and built from that. Version just says 2.0-SNAPSHOT

Thanks a lot for this, brilliant response! I'll have a play around with it and if I encounter more issues or the Vector rendering needs a lot of improvement (may try using images instead, see what happens), I'll get back to you!

Similarly if I find that images etc works fine, I'll update this.

from mapfish-print.

chill avatar chill commented on September 3, 2024

Seemed that the reason the points were showing up black was that instead of specifying:

 "fill": "red"

In styles, you need to actually specify:

 "fillColor": "red",

Think that solves this.

from mapfish-print.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.