PrintViewModel

require(["esri/widgets/Print/PrintViewModel"], function(PrintVM) { /* code goes here */ });
Class: esri/widgets/Print/PrintViewModel
Inheritance: PrintViewModel Accessor
Since: ArcGIS API for JavaScript 4.2

Provides the logic for the Print widget.

See also:
Example:
var view = new MapView({
  container: "viewDiv",
  map: map
});

var print = new Print({
  viewModel: new PrintVM({
    view: view
  })
});

Constructors

new PrintViewModel(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
String

The name of the class.

more details
more detailsAccessor
String

The URL of the REST endpoint of the Export Web Map Task.

more details
more detailsPrintViewModel
Number

The time interval in milliseconds between each job status request sent to an asynchronous GP task.

more details
more detailsPrintViewModel
MapView

The view from which the widget will operate.

more details
more detailsPrintViewModel

Property Details

declaredClassStringreadonly inherited
Since: ArcGIS API for JavaScript 4.7

The name of the class. The declared class name is formatted as esri.folder.className.

printServiceUrlString

The URL of the REST endpoint of the Export Web Map Task.

updateDelayNumber

The time interval in milliseconds between each job status request sent to an asynchronous GP task.

Default Value:1000

The view from which the widget will operate.

Method Overview

NameReturn TypeSummaryClass
Promise<Object>

Prints (exports) the current MapView according to selected options.

more details
more detailsPrintViewModel

Method Details

print(printTemplate){Promise<Object>}

Prints (exports) the current MapView according to selected options.

Parameter:
printTemplate PrintTemplate

The PrintTemplate is used to specify the layout template options which is then used by the PrintTask to generate the print page.

Returns:
TypeDescription
Promise<Object>Resolves to an object with the following properties:
PropertyTypeDescription
urlStringURL to the exported printout.

API Reference search results

NameTypeModule
Loading...