Skip to content

Commit 59a5474

Browse files
committed
revisiting the report widget. make it at least semi-operational
before work begins on a real first release.
1 parent b0a903f commit 59a5474

File tree

3 files changed

+13
-52
lines changed

3 files changed

+13
-52
lines changed

config/report.js

+6-35
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
define([
2-
'esri/urlUtils',
3-
'esri/layers/ImageParameters'
4-
], function (urlUtils, ImageParameters) {
2+
'esri/urlUtils'
3+
], function (urlUtils) {
54

65
urlUtils.addProxyRule({
7-
urlPrefix: 'http://gis.scwa.ca.gov',
6+
urlPrefix: 'http://server.domain',
87
proxyUrl: '/proxy/proxy.ashx'
98
});
109

11-
var imageParameters = new ImageParameters();
12-
imageParameters.format = 'png32';
13-
1410
return {
1511
isDebug: true,
1612

1713
mapOptions: {
18-
basemap: 'streets',
14+
basemap: 'hybrid',
1915
center: [-122.6314, 38.2658],
16+
// center: [-122.431297, 37.773972],
2017
zoom: 19,
2118
sliderStyle: 'small'
2219
},
@@ -35,33 +32,7 @@ define([
3532
},
3633
collapseButtonsPane: 'center', //center or outer
3734

38-
operationalLayers: [
39-
{
40-
type: 'dynamic',
41-
url: 'https://xara1-4.cityofpetaluma.net/arcgis/rest/services/BaseMaps/Basemap_WM_CL/MapServer',
42-
title: 'Basemap',
43-
options: {
44-
id: 'countyBasemap',
45-
opacity: 1,
46-
visible: true,
47-
imageParameters: imageParameters
48-
}
49-
},
50-
{
51-
type: 'dynamic',
52-
url: 'https://xara1-4.cityofpetaluma.net/arcgis/rest/services/BaseMaps/Parcels_Public/MapServer',
53-
title: 'Parcels',
54-
options: {
55-
id: 'countParcels',
56-
opacity: 0.7,
57-
visible: true,
58-
imageParameters: imageParameters
59-
},
60-
identifyLayerInfos: {
61-
layerIds: [0]
62-
}
63-
}
64-
],
35+
operationalLayers: [],
6536

6637
widgets: {
6738
growler: {

config/reportWidget.js

+3-13
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ define([
66
map: true,
77

88
/*
9-
printTaskURL must be on the same same as application
9+
printTaskURL must be on the same server as application
1010
or the server must be configured for CORS
1111
or you can use a proxy
1212
*/
13-
printTaskURL: 'http://gis.scwa.ca.gov/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task',
14-
//'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task',
13+
printTaskURL: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task',
1514

1615
startup: function () {
1716
topic.publish('reportWidget/createReport');
@@ -81,7 +80,7 @@ define([
8180
}
8281
},
8382
copyright: {
84-
text: 'Copyright 2015, City of Petaluma California',
83+
text: 'Copyright 2016, City of Petaluma California',
8584
left: 575, // just inside the right margin
8685
align: 'right',
8786
font: {
@@ -101,15 +100,6 @@ define([
101100
preserveScale: true,
102101
border: true
103102
},
104-
images: [
105-
{
106-
top: 15,
107-
left: 15,
108-
width: 50,
109-
height: 50,
110-
url: '/proxy/proxy.ashx?https://xara1-4.cityofpetaluma.net/jsviewers/maplibrary/images/Petaluma1858verC2_graybg.bmp'
111-
}
112-
],
113103
text: [],
114104
lines: [],
115105
shapes: [],

widgets/Report.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ define([
6060
addjsPDFModules: function () {
6161
var modules = [
6262
// load the autotable plugin
63-
'https//cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/2.0.16/jspdf.plugin.autotable.js'
63+
'https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/2.0.16/jspdf.plugin.autotable.js'
6464
];
6565

6666
switch (this.reportLayout.output.type) {
6767
case 'blob':
6868
case 'bloburi':
6969
case 'bloburl':
7070
case 'save':
71-
modules.push('https//cdn.rawgit.com/eligrey/Blob.js/master/Blob.js');
72-
modules.push('https//cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2014-11-29/FileSaver.min.js');
71+
modules.push('https://cdn.rawgit.com/eligrey/Blob.js/master/Blob.js');
72+
modules.push('https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2014-11-29/FileSaver.min.js');
7373
break;
7474
default:
7575
}
@@ -611,7 +611,7 @@ define([
611611

612612
getProxiedUrl: function (url) {
613613
var proxyRule = urlUtils.getProxyRule(url);
614-
if (proxyRule.proxyUrl) {
614+
if (proxyRule && proxyRule.proxyUrl) {
615615
return proxyRule.proxyUrl + '?' + url;
616616
}
617617
return url;

0 commit comments

Comments
 (0)