new PrintDialog( [options])
Parameters:
Name | Type | Argument | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Control options. Properties
|
Extends
Members
-
_labels
-
Print dialog labels (for customisation)
-
formats
-
List of legeng options * / ol.control.PrintDialog.prototype.legendOptions = { off: 'Hide legend', on: 'Show legend' }; /** List of print image file formats
-
marginSize
-
List of margin size
-
paperSize
-
List of paper size
-
scales
-
List of print scale
Methods
-
<static> addLang(lang, labels)
-
Add a new language
Parameters:
Name Type Description lang
string lang id
labels
Objetct -
getContentElement()
-
Get dialog content element
Returns:
- Type
- Element
-
getMargin()
-
Get print margin
Returns:
- Type
- number
-
getOrientation()
-
Get print orientation
Returns:
- Type
- string
-
getPage()
-
Get page element
Returns:
- Type
- Element
-
getPrintControl()
-
Get print control
Returns:
- Type
- ol.control.Print
-
getScale()
-
Get the current map scale factor
Returns:
- Type
- number
-
getSize()
-
Get print size
Returns:
- Type
- ol.size
-
getUserElement()
-
Get dialog user element
Returns:
- Type
- Element
-
i18n(what)
-
Translate
Parameters:
Name Type Description what
string Returns:
- Type
- string
-
isOpen()
-
Check if the dialog is oprn
Returns:
- Type
- boolean
-
print(options)
-
Show print dialog
Parameters:
Name Type Description options
* Properties
Name Type Description size
ol/size | string map size as ol/size or A4, etc.
value
number | string the scale factor or a scale string as 1/xxx
orientation
string landscape or portrait
margin
number -
setMap(map)
-
Remove the control from its current map and attach it to the new map. Subclasses may set up event handlers to get notified about changes to the map here.
Parameters:
Name Type Description map
ol.Map Map.
-
setMargin(margin)
-
Set print margin
Parameters:
Name Type Description margin
number -
setOrientation(ori)
-
Set print orientation
Parameters:
Name Type Description ori
string landscape or portrait
-
setScale(value)
-
Set the current scale (will change the scale of the map)
Parameters:
Name Type Description value
number | string the scale factor or a scale string as 1/xxx
-
setSize(size)
-
Set map print size
Parameters:
Name Type Description size
ol/size | string map size as ol/size or A4, etc.