-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplayAttributeData.htm
242 lines (227 loc) · 8.03 KB
/
displayAttributeData.htm
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<html>
<HEAD>
<script language="javascript">
var t;
var t2 = "";
if (opener) {
t = opener.parent.MapFrame;
t2 = "opener.parent.MapFrame";
} else {
t = parent.MapFrame;
t2 = "parent.MapFrame";
}
var theReply = t.lastXMLResponse;
var theError = t.getXMLErrorMessage(theReply);
var fList="";
var lpos1 = 1;
var lpos2 = 1;
var epos = 1;
var spos = 1;
var morePoints=true;
var moreFeatures=true;
var featureCount = t.justGetFeatureCount(theReply);
//alert(featureCount);
var pos = 0;
var startpos = 0;
var endpos = t.xmlEndPos;
var stillMore = false
pos = theReply.indexOf('hasmore="true"',endpos);
if (pos!=-1) stillMore = true;
pos=0;
var tempCount = 0;
var selectedData="";
var inData="";
var xStr="";
var yStr="";
var tempString = "";
var fCount = featureCount;
//alert("displayAttributeData()[featurecount=" + featureCount + "]");
t.selectCount = 0;
var tempString="";
var theFrame = t2;
if (featureCount > 0) {
t.newSelectCount += 1;
document.writeln('<title>' + t.titleList[7] + '</title></head>');
document.writeln('<body bgcolor="' + t.textFrameBackColor + '" text="Black" link="Blue" vlink="Gray" LEFTMARGIN=0 onload="window.focus()">');
document.writeln('<center>');
document.writeln('<FONT FACE="Arial" SIZE="-1"><b>' + t.LayerName[t.ActiveLayerIndex] + '</b></FONT>');
document.writeln('<table border="1" cellspacing="0" cellpadding="2" nowrap bgcolor="' + t.tableBackColor + '">');
endpos = 1;
for (var i=0;i<fCount;i++) {
//alert(endpos);
if (t.toolMode!=4) {
var theXYs = t.getEnvelopeXYs(theReply, endpos)
t.selectLeft[t.selectCount] = theXYs[0];
t.selectBottom[t.selectCount] = theXYs[1];
t.selectRight[t.selectCount] = theXYs[2];
t.selectTop[t.selectCount] = theXYs[3];
endpos = t.xmlEndPos;
}
//alert(endpos);
inData = t.parseRecordString(theReply, endpos);
endpos = t.xmlEndPos;
//selectedData = clearLeadingSpace(inData);
selectedData = inData;
epos = theReply.indexOf("</FEATURE",endpos);
//if (showSelectedData) {
//alert("2\n" + selectedData);
var showHyper = false;
if (t.hyperLinkLayers!=null) {
for (var s1=0;s1<t.hyperLinkLayers.length;s1++) {
if (t.hyperLinkLayers[s1] == t.LayerName[t.ActiveLayerIndex]) showHyper=true;
}
}
var fName1 = t.getFieldNames(selectedData);
var fValue1 = t.getFieldValues(selectedData);
t.selectPoints[t.selectCount] = t.getIdValue(fName1, fValue1);
var idFieldNum = -1;
var shapeFieldNum = -1;
if (t.hideIDFieldData) {
// hide ID column header
for (var f=0;f<fName1.length;f++) {
if (fName1[f]==t.LayerIDField[t.ActiveLayerIndex]) idFieldNum = f;
}
}
if (t.hideShapeFieldData) {
// hide Shape column header
for (var f=0;f<fName1.length;f++) {
if (fName1[f]==t.LayerShapeField[t.ActiveLayerIndex]) shapeFieldNum = f;
}
}
if (t.selectCount==0) {
document.write('<tr><th><FONT FACE="Arial" SIZE="-2">' + t.msgList[86] + '</FONT></a></th>');
for (var f=0;f<fName1.length;f++) {
if ((f!=idFieldNum) && (f!=shapeFieldNum)) {
var f2 = -1;
if (t.useFieldAlias) {
for (var f3=0;f3<t.AliasFieldName.length;f3++) {
if (t.AliasFieldName[f3]==fName1[f]) f2 = f3;
}
}
if (f2!=-1) {
document.write('<th><FONT FACE="Arial" SIZE="-2">' + t.AliasFieldAlias[f2] + '</FONT></a></th>');
} else {
document.write('<th><FONT FACE="Arial" SIZE="-2">' + fName1[f] + '</FONT></a></th>');
}
}
}
document.writeln('</tr>');
}
document.write('<tr><td>');
if (t.toolMode!=4) document.write('<a href="javascript:' + t2 + '.showHighlight(' + t.selectCount + ')">');
document.write('<FONT FACE="Arial" SIZE="-2">' + (t.selectCount+t.queryStartRecord) + '</FONT>');
if (t.toolMode!=4) document.write('</a>');
document.writeln('</td>');
for (var f=0;f<fName1.length;f++) {
if ((f!=idFieldNum) && (f!=shapeFieldNum)) {
document.write('<TD>');
var isHyper=false;
if (showHyper) {
for (var s1=0;s1<t.hyperLinkFields.length;s1++) {
if (t.hyperLinkFields[s1]==fName1[f]) {
var theLinkURL = t.hyperLinkPrefix[s1] + fValue1[f] + t.hyperLinkSuffix[s1];
document.write('<a href="' + theLinkURL + '" target="_blank">');
isHyper=true;
}
}
}
var s2 = -1;
for (var s1=0;s1<t.LayerFields.length;s1++) {
if (fName1[f]==t.LayerFields[s1]) s2=s1;
}
if (t.LayerFieldType[s2]=="91") {
//alert(fName1[f]);
if (isNaN(fValue1[f])) {
var theDate = fValue1[f];
} else {
//var theDate = new Date(parseInt(fValue1[f]));
var theDateObj = new Date(parseFloat(fValue1[f]));
var d = theDateObj.toUTCString();
var theDate = d.replace(/GMT|UTC/,"");
}
document.write('<FONT FACE="Arial" SIZE="-2">' + theDate + '</FONT>');
theDate=null;
} else {
// put html entity for spaces so display is correct - browsers trim extra spaces
tempString = fValue1[f].replace(/ /g, " ");
document.write('<FONT FACE="Arial" SIZE="-2">' + tempString + '</FONT>');
//document.write('<FONT FACE="Arial" SIZE="-2">' + fValue1[f] + '</FONT>');
}
if (isHyper) document.write('</a>');
document.writeln('</td>');
}
}
document.writeln('</tr>');
fName1 = null;
fValue1 = null;
//}
t.selectCount += 1;
}
//if (showSelectedData) {
document.writeln('</table><FONT FACE="Arial" SIZE="-2">');
if (t.toolMode!=25) {
if (t.queryStartRecord>1) {
var prevRecord = t.queryStartRecord - t.maxFeaturesReturned;
if (prevRecord<1) prevRecord=1;
document.write('<a href="javascript:' + t2 + '.getMoreData(' + prevRecord + ')">' + t.msgList[61] + t.maxFeaturesReturned + t.msgList[62] + '</a> ');
}
if (stillMore) {
var nextRecord=featureCount + t.queryStartRecord;
document.writeln('<a href="javascript:' + t2 + '.getMoreData(' + nextRecord + ')">' + t.msgList[63] + '</a>');
}
}
if ((t.toolMode!=4) && (t.toolMode!=25) && (t.selectCount>1)) {
document.writeln(' <b><a href="javascript:' + t2 + '.zoomToReturnedRecords()">Zoom to these records</A></b>');
}
document.writeln('</font></center></body>');
//}
//alert("toolMode:" + toolMode);
if ((t.queryStartRecord==1) && (t.toolMode!=4) && (t.toolMode!=25)) {
if ((t.selectCount==1) && (t.zoomToSingleSelect)) {
var fWidth = t.selectRight[0] - t.selectLeft[0];
var fHeight = t.selectTop[0] - t.selectBottom[0];
var mWMargin = 0;
var mHMargin = 0;
if (t.selectType=="point") {
mWMargin = t.fullWidth * t.selectPointMargin;
mHMargin = t.fullHeight * t.selectPointMargin;
if (mWMargin > t.xDistance/2) {
mWMargin = t.xDistance/2;
mHMargin = t.yDistance/2;
}
} else {
mWMargin = fWidth * t.selectMargin;
mHMargin = fHeight * t.selectMargin;
}
t.saveLastExtent();
t.eLeft = t.selectLeft[0] - mWMargin;
t.eRight = t.selectRight[0] + mWMargin;
t.eTop = t.selectTop[0] + mHMargin;
t.eBottom = t.selectBottom[0] - mHMargin;
}
t.sendMapXML();
}
} else {
document.writeln(' <title>' + t.titleList[8] + '</title>');
document.writeln('</head>');
document.writeln('<body BGCOLOR="White" TEXT="Black" LEFTMARGIN=0 TOPMARGIN=0>');
document.writeln('<FONT FACE="Arial"><B>' + t.LayerName[t.ActiveLayerIndex] +'</B></font><FONT FACE="Arial" size="-2">');
document.writeln('<br>' + t.msgList[64]);
if (t.debugOn>0) {
document.writeln('<p>' + t.msgList[65] + '<br>');
document.writeln(untag(theReply));
} else {
if (theError!="") {
document.writeln('<p>' + t.msgList[66] + '<br>');
document.writeln(theError);
}
}
document.writeln('</FONT>');
document.writeln('</body>');
}
if (t.toolMode==4) t.selectCount=0;
t.hideRetrieveData();
</script>
</html>