aratcliffe / Leaflet.print

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

JSON Exception - Unable to print using Geoserver print plugin #5

Closed kyiannis closed 10 years ago

kyiannis commented 10 years ago

Hi, I was trying to print to pdf using POST method and Geoserver print plugin but geoserver logged the following error: ..... Caused by: org.json.JSONException: A JSONObject text must begin with '{' at character 0 at org.json.JSONTokener.syntaxError(JSONTokener.java:410) at org.json.JSONObject.(JSONObject.java:179) at org.json.JSONObject.(JSONObject.java:402) at org.mapfish.print.MapPrinter.parseSpec(MapPrinter.java:154) ......

I modified the source code in leaflet.print-src.js. Added the following after line 138 (i.e. print function): contentType: 'application/json; charset=UTF-8', processData: false, Now the plugin works as its supposed to work!!! Yiannis

aratcliffe commented 10 years ago

Thanks for your contribution Yiannis I've committed this today.