import "@arcgis/map-components/components/arcgis-print";
Print component connects your application with a printing service to allow the map to be printed.
Demo
Properties
Property | Attribute | Type |
---|---|---|
allowed-formats | Array<string> | string | |
allowed-layouts | Array<string> | string | |
auto-destroy-disabled | boolean | |
| ||
extra-parameters | any | |
heading-level | number | |
icon | string | |
include-default-templates-disabled | boolean | |
label | string | |
| ||
position | "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing" | |
print-service-url | string | |
reference-element | ArcgisLinkChart | ArcgisMap | ArcgisScene | string | |
show-print-area-enabled | boolean | |
state readonly | state | "disabled" | "error" | "initializing" | "ready" |
| {
[x: string]: Array<HashMap<string>> | undefined;
} | |
|
allowedFormats
allowedFormats: Array<string> | string
Specify the print output file format(s) that the user can select based on the options available from the print service.
- Attribute
- allowed-formats
- Default value
- "all"
allowedLayouts
allowedLayouts: Array<string> | string
Specify the print output layout(s) that the user can select based on the options available from the print service.
- Attribute
- allowed-layouts
- Default value
- "all"
autoDestroyDisabled
autoDestroyDisabled: boolean
If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporarily hide it. If this is set, make sure to call the `destroy` method when you are done to prevent memory leaks.
- Attribute
- auto-destroy-disabled
- Default value
- false
exportedLinks
exportedLinks: Collection<FileLink>
The collection of links exported from the Print widget.
extraParameters
extraParameters: any
This option allows passing extra parameters (in addition to templateOptions) to the print (export webmap) requests.
- Attribute
- extra-parameters
headingLevel
headingLevel: number
Indicates the heading level to use for the "Exported files" text where users can access the exported map printout.
- Attribute
- heading-level
- Default value
- 3
icon
icon: string
Icon which represents the component. Typically used when the component is controlled by another component (e.g. by the Expand component). Search Calcite Icons for possible values.
- Attribute
- icon
- Default value
- "print"
includeDefaultTemplatesDisabled
includeDefaultTemplatesDisabled: boolean
Indicates whether or not to include defaultTemplates.
- Attribute
- include-default-templates-disabled
- Default value
- false
portal
portal: Portal
It is possible to search a specified portal instance's locator services.
position
position: "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
- Attribute
- position
- Default value
- "bottom-left"
printServiceUrl
printServiceUrl: string
The URL of the REST endpoint of the Export Web Map Task.
- Attribute
- print-service-url
referenceElement
referenceElement: ArcgisLinkChart | ArcgisMap | ArcgisScene | string
- Attribute
- reference-element
showPrintAreaEnabled
showPrintAreaEnabled: boolean
The initial state of the print area toggle in the Print widget UI.
- Attribute
- show-print-area-enabled
- Default value
- false
state
state: "disabled" | "error" | "initializing" | "ready"
The view model's state.
- Attribute
- state
- Default value
- "disabled"
templateCustomTextElements
templateCustomTextElements: {
[x: string]: Array<HashMap<string>> | undefined;
}
An object containing an array of customTextElements
name-value pair objects
for each print template in a custom print service.
templateOptions
templateOptions: TemplateOptions
Defines the layout template options used by the Print widget to generate the print page.
Methods
Method | Signature |
---|---|
componentOnReady(): Promise<void> | |
destroy(): Promise<void> |
componentOnReady
componentOnReady(): Promise<void>
Create a promise that resolves once component is fully loaded.
- Returns
- Promise<void>
Events
Event | Type |
---|---|
PrintCompleteEvent | |
{ name: "state"; } | |
undefined | |
PrintSubmitEvent |
arcgisComplete
arcgisComplete: PrintCompleteEvent
Emitted when the component is complete.
Events triggered on this element will be propagated to their outermost elements.
The event is composable and will propagate across the shadow DOM into the standard DOM.
The event's default behavior can be canceled, allowing for custom behavior to be implemented instead.
arcgisPropertyChange
arcgisPropertyChange: { name: "state"; }
Emitted when the value of a property is changed. Use this to listen to changes to properties.
Events triggered on this element will be propagated to their outermost elements.
The event is composable and will propagate across the shadow DOM into the standard DOM.
The event's default behavior can be canceled, allowing for custom behavior to be implemented instead.
arcgisReady
arcgisReady: undefined
Emitted when the component associated with a map view is is ready to be interacted with.
Events triggered on this element will be propagated to their outermost elements.
The event is composable and will propagate across the shadow DOM into the standard DOM.
The event's default behavior can be canceled, allowing for custom behavior to be implemented instead.
arcgisSubmit
arcgisSubmit: PrintSubmitEvent
Emitted when the component is submitted.
Events triggered on this element will be propagated to their outermost elements.
The event is composable and will propagate across the shadow DOM into the standard DOM.
The event's default behavior can be canceled, allowing for custom behavior to be implemented instead.