虽然使用ArcGIS的JavaScript以当前地图的截图,我可以看到,我们有两种方式采取截图。使用
I could see same question asked here之间有什么ESRI打印任务和出口网络地图的区别
/使用打印任务API
var printTask = new esriLoader.PrintTask(PrintTaskServiceUrl); esriLoader.Config.defaults.io.proxyUrl = proxyUrl; esriLoader.Config.defaults.io.alwaysUseProxy = true; var template = new esriLoader.PrintTemplate(); template.exportOptions = { width: 1015, height: 633, dpi: 96 // if 200 ,map image will get good quality }; template.format = "JPG"; template.layout = "MAP_ONLY", template.preserveScale = false; template.showLabels = true; template.showAttribution = false; template.layoutOptions = { "legendLayers": [], // empty array means no legend "scalebarUnit": "Miles", "copyrightText": "<div>xxx</div>", } var params = new esriLoader.PrintParameters(); params.map = map; params.template = template; printTask.execute(params, success, error);
的出口,正是这2种方法之间的区别?
直接使用REST API有什么优势?反之亦然? – AhammadaliPK
就性能而言,我不这么认为,但我知道JS API并不完全支持REST API的所有设置。例如,如果你想排除图层,你可以通过在layers参数中添加排除:2,4,5,6来实现。你不能用JS API来做到这一点,它只会显示:使用visibleLayers数组 – greenkarmic