Skip to content

Commit 96f3d2a

Browse files
committed
New config example to search for a value provided in the app's url.
1 parent e0e381b commit 96f3d2a

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

config/queryStringSearch.js

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
define([
2+
'dojo/io-query'
3+
], function (ioQuery) {
4+
5+
var uri = window.location.href;
6+
var qs = uri.substring(uri.indexOf('?') + 1, uri.length);
7+
var qsObj = ioQuery.queryToObject(qs);
8+
var fips = qsObj.fips || '';
9+
10+
return {
11+
isDebug: false,
12+
13+
mapOptions: {
14+
basemap: 'streets',
15+
center: [-96.59179687497497, 39.09596293629694],
16+
zoom: 5,
17+
sliderStyle: 'small'
18+
},
19+
20+
panes: {
21+
left: {
22+
collapsible: false,
23+
style: 'display:none'
24+
},
25+
bottom: {
26+
id: 'sidebarBottom',
27+
placeAt: 'outer',
28+
splitter: true,
29+
collapsible: true,
30+
region: 'bottom',
31+
style: 'height:200px;',
32+
content: '<div id="attributesContainer"></div>'
33+
}
34+
},
35+
36+
operationalLayers: [
37+
],
38+
39+
widgets: {
40+
growler: {
41+
include: true,
42+
id: 'growler',
43+
type: 'domNode',
44+
path: 'gis/dijit/Growler',
45+
srcNodeRef: 'growlerDijit',
46+
options: {}
47+
},
48+
attributesTable: {
49+
include: true,
50+
id: 'attributesContainer',
51+
type: 'domNode',
52+
srcNodeRef: 'attributesContainer',
53+
path: 'widgets/AttributesTable',
54+
options: {
55+
map: true,
56+
mapClickMode: true,
57+
58+
// use a tab container for multiple tables or
59+
// show only a single table
60+
useTabs: false,
61+
62+
// used to open the sidebar after a query has completed
63+
sidebarID: 'sidebarBottom',
64+
65+
tables: [
66+
{
67+
title: 'Census',
68+
topicID: 'censusQuery',
69+
queryOptions: {
70+
queryParameters: {
71+
url: 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/4',
72+
where: 'FIPS = \'' + fips + '\''
73+
},
74+
idProperty: 'ObjectID'
75+
},
76+
toolbarOptions: {
77+
show: false
78+
}
79+
}
80+
]
81+
}
82+
}
83+
}
84+
};
85+
});

0 commit comments

Comments
 (0)