arcgis JavaScriptを使用して現在のマップのスクリーンショットを撮っているうちに、スクリーンショットを撮るには2通りの方法があることがわかりました。だから、esriプリントタスクとエクスポートウェブマップの違い
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);
を使用して
I could see same question asked here
、これらの2つの方法の違いは何ですか?
REST APIを直接使用すると利点はありますか? – AhammadaliPK
パフォーマンスに関して、私はそうは思わないが、JS APIがREST APIのすべての設定を完全にサポートしていないことを知っている。たとえば、レイヤーを除外したい場合、レイヤー・パラメーターにexclude:2,4,5,6を追加することでレイヤーを除外することができます。あなたはJS APIを使ってそれを行うことはできません。それはshowだけを行います:visibleLayers配列を使う – greenkarmic