當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


JavaScript ArcGIS Print.exportedLinks用法及代碼示例


基本信息

以下是所在類或對象的基本信息。

AMD: require(["esri/widgets/Print"], (Print) => { /* code goes here */ });

ESM: import Print from "@arcgis/core/widgets/Print";

類: esri/widgets/Print

繼承: Print > Widget > Accessor

自從:用於 JavaScript 4.2 的 ArcGIS API

用法說明

Print.exportedLinks函數(或屬性)的定義如下:


自從:ArcGIS 適用於 JavaScript 4.17 的 API

從“打印”小部件導出的鏈接集合。

例子:

require([
  "esri/widgets/Print",
  "esri/config"
], function(Print, esriConfig) {

  // ...

  view.when(function () {
    print = new Print({
      view: view,
      // specify your own print service
      printServiceUrl:
        "https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
    });

    // Add widget to the top right corner of the view
    view.ui.add(print, "top-right");

    // use a requestInterceptor to monitor the print widget
    // for print completion
    esriConfig.request.interceptors.push({
      // set the `urls` property to the URL of the print service so that this
      // interceptor only applies to requests made to the print service URL
      urls: print.printServiceUrl,
      // use the AfterInterceptorCallback to interogate the exportedLinks property
      after: function(response) {
        console.log("exportedLinks: ", print.exportedLinks.items[0]);
      }
    });
  });

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 Print.exportedLinks。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。