多邊形查詢-屬性:
多邊形坐標(必填)(:
類型:
(其他聚落, 軍事機關, 一般地名, 二級城市, 三級城市, 四級城市)

層級:
(縣以下聚邑,布政使司所在地,縣級行政中心所在地,縣級、州級行政中心所在地)

朝代行政區:(清_江蘇, 明_南京)
模糊查詢或精確查詢:(0:模糊查詢,1:精確查詢,不填預設1)
回傳筆數的上限:(預設1000, 不填不限)
起時間彈性值:(無負值;如與結束時間彈性值其中一項未輸入,則與另一項相同;如與結束時間兩項皆未填,則彈性值為0。)
迄時間彈性值:(無負值;如與結束時間彈性值其中一項未輸入,則與另一項相同;如與開始時間兩項皆未填,則彈性值為0。)
時間區間:
(區間起或迄其中一欄若填”-“,表示該時間點往前(自古)或往後查(至今);其中一欄不填則自動與另一欄相同)
設定回傳欄位:
(以半形逗號做分隔,ID,CHINAME,ENGNAME,NOWNAME, YEARSTART,YEAREND,DYNASTYDISTRICT,LEVEL,TYPE, REFERENCE,PUBLISHER,VERSION,PUBYEAR,LON,LAT,MEMO, U_CLASS,NOTE,SHPNAME,WKT,WKTTYPE)
排序:(0:朝代,層級,1:層級,朝代)
範例程式碼(詳細請點右鍵觀看原始碼):
<script type="text/javascript" src="http://ccts.sinica.edu.tw/api/CCTS_API.js"> <script>
var getPGQ_Attr = function () {
if (document.getElementById("pWkt").value != "") {
var pQuery = new PolygonQuery2();
var aa = "";
document.getElementById("view").innerHTML = "";
var times = document.getElementById("timeS");
var timee = document.getElementById("timeE");
var Fields = document.getElementById("Fields");
var orderNum = document.getElementById("order");
var res = Fields.value.split(",");
if (times.value != "" && timee.value == "") {
timee.value = times.value;
}
else if (times.value == "" && timee.value != "") {
times.value = timee.value;
}

var drangeS = document.getElementById("drangeS");
var drangeE = document.getElementById("drangeE");
if (drangeS.value != "" && drangeE.value == "") {
drangeE.value = drangeS.value;
}
else if (drangeS.value == "" && drangeE.value != "") {
drangeS.value = drangeE.value;
}
pQuery.identify({
polygonwkt: document.getElementById("pWkt").value
}, {
typeName: document.getElementById("tName").value,
queryNum: parseInt(document.getElementById("qNum").value),
timeOption: ((times.value != "" && timee.value != "") ? [{ startdate: parseInt(times.value), enddate: parseInt(timee.value)}] : null),
startdaterange: parseInt(drangeS.value),
enddaterange: parseInt(drangeE.value),
level: document.getElementById("plevel").value,
dynastDistrict: document.getElementById("dDistrict").value,
resultLimit: parseInt(document.getElementById("rLimit").value),
mapTypeIds: ((res.length != 0) ? res : []),
order: parseInt(orderNum.value)
}, null
, function (result, status) {
if (result != "") {
console.log(result);
var fName = result[0].fieldName.split(",");
aa += ""
for (var fn = 0; fn < fName.length; fn++) {
aa += "";
}
aa += "";
for (var i = 0; i < result[0]["fieldAttr"].length; i++) {
aa += "";
for (var fa = 0; fa < result[0]["fieldAttr"][i].length; fa++) {
aa += "";
}
aa += "";
}
aa += "
status" + fName[fn] + "
" + status + "" + result[0]["fieldAttr"][i][fa] + "
";
document.getElementById("view").innerHTML = aa;
}
else {
document.getElementById("view").innerHTML = status;
}
})
}
else {
alert("多邊形坐標請勿空白");
document.getElementById("view").innerHTML = "";
}
}
</script>