您好:
这边可以通过REST API实现地图打印,发送POST请求,请求代码示例如下:
$.ajax({
url: "http://127.0.0.1:8090/iserver/services/webprinting/rest/webprinting/v1/jobs.rjson",
data:
JSON.stringify(
{
"layoutOptions": {
"templateName": $('#templateName').val(),
"title": $('#title').val(),
"subTitle": $('#subTitle').val(),
"author": $('#author').val(),
"copyright": $('#copyright').val(),
"scaleBarOptions": {
"scaleText": $('#scaleText').val(),
},
"legendOptions": {
"title": "图例",
"customItems": [
]
},
"littleMapOptions": {
"center": { x: x, y: y },
"scale": $('#scale').val(),
"layers": [
{
"layerType": "TILE",
"name": "China",
"url": url
}
]
}
},
"exportOptions": {
"format": $('#format').val(),
"dpi": 96,
"scale": $('#scale').val(),
"center": { x: x, y: y }
},
"content": {
"type": "WEBMAP",
"value": {
"center": { x: x, y: y },
"minScale": "1:1155583.419744397",
"maxScale": "1:2543.200274474592",
"level": 2,
"projection": "EPSG:4326",
"layers":[{
"layerType": "TILE",
"name": "china",
"url": url
}]
}
}
}),
type: "POST",
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function(data) {
// 地图a链接
var aurl = "http://127.0.0.1:8090/iserver/services/webprinting/rest/webprinting/v1/jobs/";
aurl += data[0].name;
aurl += "/result";
}
});
更多内容请查看iserver帮助文档:http://support.supermap.com.cn/DataWarehouse/WebDocHelp/iServer/index.htm
搜索webPrintingJobs
希望可以帮助到您!