我有一张要在用户打开某些图层后打印的地图。这些层是geoserver wms,基础层是OSM。
我知道geoserver具有打印模块(该模块已安装并且可以正常工作,因为我收到geoserver / pdf / info.json?var = printCapabilities的回复
我不了解的是如何使用它来打印具有可见图层的当前地图。
我看过GeoExt示例(mapfish),但并没有帮助我理解。
更新1: 我通过代码生成了以下URL:
http://77.235.53.170/geoserver/pdf/print.pdf?spec={%22units%22:%22degrees%22,%22srs%22:%22EPSG:4326%22,%22layout%22:%22A4%22,%22dpi%22:%22300%22,%22mapTitle%22:%22This%20is%20the%20map%20title%22,%22comment%22:%22This%20is%20the%20map%20comment%22,%22resourcesUrl%22:%20%22http://77.235.53.170/img%22,%22layers%22:[{%22baseURL%22:%22http://77.235.53.170/geoserver/Lehavim/wms%22,%22opacity%22:1,%22singleTile%22:true,%22type%22:%22WMS%22,%22layers%22:[%22%D7%A7%D7%95%20%D7%9E%D7%99%D7%9D%22],%22format%22:%22image/jpeg%22,%22styles%22:[%22%22]}],%22pages%22:[{%22center%22:[3875254.1134954,3680894.557955],%22scale%22:32000,%22rotation%22:0}]}
而且我得到的PDF为空(仅包含标题)...可能出什么问题了?