Skip to content

Commit 9ba1032

Browse files
committed
Add PrintPlus widget.
1 parent 39b7501 commit 9ba1032

File tree

10 files changed

+1764
-0
lines changed

10 files changed

+1764
-0
lines changed

config/printplus.js

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
define([
2+
'esri/config',
3+
'esri/tasks/GeometryService',
4+
'esri/layers/ImageParameters'
5+
], function (esriConfig, GeometryService, ImageParameters) {
6+
7+
esriConfig.defaults.geometryService = new GeometryService('http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer');
8+
9+
var imageParameters = new ImageParameters();
10+
imageParameters.format = 'png32';
11+
12+
return {
13+
isDebug: true,
14+
15+
mapOptions: {
16+
basemap: 'streets',
17+
center: [-96.59179687497497, 39.09596293629694],
18+
zoom: 4,
19+
sliderStyle: 'small'
20+
},
21+
22+
titles: {
23+
header: 'CMV PrintPlus Widget',
24+
subHeader: 'This is an example of the PrintPlus Widget',
25+
pageTitle: 'CMV PrintPlus Widget'
26+
},
27+
28+
collapseButtonsPane: 'center', //center or outer
29+
30+
operationalLayers: [
31+
{
32+
type: 'dynamic',
33+
url: 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer',
34+
title: 'Louisville Public Safety',
35+
options: {
36+
id: 'louisvillePubSafety',
37+
opacity: 1.0,
38+
visible: true,
39+
imageParameters: imageParameters
40+
},
41+
identifyLayerInfos: {
42+
layerIds: [2, 4, 5, 8, 12, 21]
43+
}
44+
},
45+
{
46+
type: 'dynamic',
47+
url: 'http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/MapServer',
48+
title: 'Damage Assessment',
49+
options: {
50+
id: 'DamageAssessment',
51+
opacity: 1.0,
52+
visible: true,
53+
imageParameters: imageParameters
54+
}
55+
}
56+
],
57+
58+
widgets: {
59+
growler: {
60+
include: true,
61+
id: 'growler',
62+
type: 'domNode',
63+
path: 'gis/dijit/Growler',
64+
srcNodeRef: 'growlerDijit',
65+
options: {}
66+
},
67+
print: {
68+
include: true,
69+
id: 'print',
70+
type: 'titlePane',
71+
path: 'widgets/PrintPlus',
72+
canFloat: false,
73+
title: 'Print Plus',
74+
open: true,
75+
position: 0,
76+
options: 'config/printplusWidget'
77+
}
78+
}
79+
};
80+
});

config/printplusWidget.js

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
define([
2+
], function () {
3+
return {
4+
map: true,
5+
printTaskURL: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task',
6+
copyrightText: 'Copyright 2014',
7+
authorText: 'Me',
8+
defaultTitle: 'Viewer Map',
9+
defaultFormat: 'PDF',
10+
defaultLayout: 'Letter ANSI A Landscape',
11+
12+
//Print Enhancements BEGIN
13+
defaultDpi: 96,
14+
noTitleBlockPrefix: 'No TB ',
15+
layoutParams: {
16+
// The params array defines the template dimensions so the template footprint can be displayed on the map.
17+
// The first item is the page size.
18+
// The second item is the map hole size.
19+
// The third item is the offset to the lower left corner of the map area.
20+
// The fourth item is the side and top borders for the layout with no title block.
21+
'Letter ANSI A Landscape': {
22+
alias: 'Letter Landscape (ANSI A)',
23+
units: 'esriInches',
24+
pageSize: {x: 11, y: 8.5},
25+
mapSize: {x: 10, y: 6.25},
26+
pageMargins: {x: 0.5, y: 1.5},
27+
titleBlockOffsets: {x: 0.5, y: 0.5}
28+
},
29+
'Letter ANSI A Portrait': {
30+
alias: 'Letter Portrait (ANSI A)',
31+
units: 'esriInches',
32+
pageSize: {x: 8.5, y: 11},
33+
mapSize: {x: 7.5, y: 8},
34+
pageMargins: {x: 0.5, y: 2.25},
35+
titleBlockOffsets: {x: 0.5, y: 0.5}
36+
},
37+
'Tabloid ANSI B Landscape': {
38+
alias: 'Tabloid Landscape (ANSI B)',
39+
units: 'esriInches',
40+
pageSize: {x: 17, y: 11},
41+
mapSize: {x: 16, y: 7.75},
42+
pageMargins: {x: 0.5, y: 2.5},
43+
titleBlockOffsets: {x: 0.5, y: 0.5}
44+
},
45+
'Tabloid ANSI B Portrait': {
46+
alias: 'Tabloid Portrait (ANSI B)',
47+
units: 'esriInches',
48+
pageSize: {x: 11, y: 17},
49+
mapSize: {x: 10, y: 11.75},
50+
pageMargins: {x: 0.5, y: 4.5},
51+
titleBlockOffsets: {x: 0.5, y: 0.5}
52+
},
53+
'A4 Landscape': {
54+
alias: 'A4 Landscape',
55+
units: 'esriCentimeters',
56+
pageSize: {x: 29.7, y: 21},
57+
mapSize: {x: 27.7, y: 15.9},
58+
pageMargins: {x: 1, y: 3.8},
59+
titleBlockOffsets: {x: 1, y: 1}
60+
},
61+
'A4 Portrait': {
62+
alias: 'A4 Portrait',
63+
units: 'esriCentimeters',
64+
pageSize: {x: 21, y: 29.7},
65+
mapSize: {x: 19, y: 22.3},
66+
pageMargins: {x: 1, y: 5.7},
67+
titleBlockOffsets: {x: 1, y: 1}
68+
},
69+
'A3 Landscape': {
70+
alias: 'A3 Landscape',
71+
units: 'esriCentimeters',
72+
pageSize: {x: 42, y: 29.7},
73+
mapSize: {x: 40, y: 21.7},
74+
pageMargins: {x: 1, y: 6.3},
75+
titleBlockOffsets: {x: 1, y: 1}
76+
},
77+
'A3 Portrait': {
78+
alias: 'A3 Portrait',
79+
units: 'esriCentimeters',
80+
pageSize: {x: 29.7, y: 42},
81+
mapSize: {x: 27.7, y: 29},
82+
pageMargins: {x: 1, y: 11},
83+
titleBlockOffsets: {x: 1, y: 1}
84+
},
85+
'MAP_ONLY': {
86+
alias: 'Just the Map',
87+
units: NaN,
88+
pageSize: {x: 0, y: 0},
89+
mapSize: {x: 0, y: 0},
90+
pageMargins: {x: 0, y: 0},
91+
titleBlockOffsets: {x: 0, y: 0}
92+
}
93+
},
94+
relativeScale: '(1 inch = [value] miles)',
95+
relativeScaleFactor: 0.0000157828,
96+
scalePrecision: 1,
97+
mapScales: [6336000, 5068800, 3801600, 3168000, 2534400, 1900800, 1267200, 633600, 506880, 380160, 316800, 253440, 190080, 126720, 63360, 50688, 38016, 31680, 25344, 19008, 12672, 6336, 5069, 3802, 3168, 2534, 1901, 1267, 634, 507, 380, 317, 253, 190, 127, 63],
98+
showLayout: true
99+
//Print Enhancements END
100+
};
101+
});

images/printplus1.jpg

151 KB
Loading

0 commit comments

Comments
 (0)