-
Notifications
You must be signed in to change notification settings - Fork 0
/
queryonly.html
57 lines (48 loc) · 1.99 KB
/
queryonly.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Query State Info without Map</title>
<script src="https://js.arcgis.com/3.15/"></script>
<script>
require([
"dojo/dom", "dojo/on",
"esri/tasks/query", "esri/tasks/QueryTask", "dojo/domReady!"
], function (dom, on, Query, QueryTask) {
var queryTask = new QueryTask("//services3.arcgis.com/aD88pT4hjL80xq0F/arcgis/rest/services/MHcdsuffix/FeatureServer/0");
var query = new Query();
query.returnGeometry = false;
query.outFields = ["*"]
//query.outFields = ["bcat","bc","Boro","Block","Lot","Unit","ttlsqft","ttlunit","ressqft","resunit", "comsqft","comunit","AYB","Zone_1","story","fmv", "Street_Num","Street_Nam","Structure","NBHD"];
on(dom.byId("execute"), "click", execute);
function execute () {
//query.text = dom.byId("NBHD").value;
query.where = "CONDO_KEY = " + dom.byId("MatchOn").value;
queryTask.execute(query, showResults,function(error){console.log(error);});
}
function showResults (results) {
var resultItems = [];
var resultCount = results.features.length;
for (var i = 0; i < resultCount; i++) {
var featureAttributes = results.features[i].attributes;
for (var attr in featureAttributes) {
resultItems.push("<b>" + attr + ":</b> " + featureAttributes[attr] + "<br>");
}
resultItems.push("<br>");
}
dom.byId("info").innerHTML = resultItems.join("");
}
});
</script>
</head>
<body>
US state name : 1/134/7503
<input type="text" id="MatchOn" value="1536">
<input id="execute" type="button" value="Get Details">
<br />
<br />
<div id="info" style="padding:5px; margin:5px; background-color:#eee;">
</div>
</body>
</html>