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.
NameTypeSummary
String

The name of the class.

more details
more details
String

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

more details
more details
Number

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

more details
more details
MapView

The view from which the widget will operate.

more details
more details

Property Details

declaredClassStringreadonly

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 TypeSummary
Promise

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

more details
more details

Method Details

print(printTemplate){Promise}

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
PromiseResolves to an object with the following properties:
PropertyTypeDescription
urlStringURL to the exported printout.

API Reference search results

NameTypeModule

There were no match results from your search criteria.