【发布时间】:2015-03-17 15:20:22
【问题描述】:
我在使用 ESRI ArcGIS Javascript API 关系查询类时遇到问题。
我正在尝试使用 RelationshipQuery 类从我的 GIS 服务中的不同 GIS 层(在本例中为第 1 层)获取字段。换句话说,我希望在第 1 层中抓取具有与单击点的评估者图层 FeatureLayer 对象中的 SCTM 字段相同的 SCTM 字段的记录,以便我可以将所有信息填充到一个弹出窗口中。
这是我关于 RelationshipQuery 类的代码段
var title, content, graphicAttributes;
var relatedQuery = new RelationshipQuery();
relatedQuery.relationshipId = 1;
relatedQuery.outFields = ["*"];
assessorLayer.on("click", function(evt)
{ /* start assessorLayer.on click event */
graphicAttributes = evt.graphic.attributes;
title = "Assessor";
content = "<b>Name: </b>" + graphicAttributes.OWNER_NAME + graphicAttributes.OWNER_NAME2
+ "<br><b>Dimensions: </b>" + graphicAttributes.DIMENSIONS
+ "<br><b>Garbage District: </b>" + graphicAttributes.CBA;
relatedQuery.definitionExpression = ("SCTM = " + graphicAttributes.SCTM);
assessorLayer.queryRelatedFeatures(relatedQuery, function(relatedRecords)
{ /* start assessorLayer.queryRelatedFeatures function */
var status = relatedRecords[graphicAttributes.STATUS];
content = content + "<br><hr><br> Status: " + status;
map.infoWindow.setTitle(title);
map.infoWindow.setContent(content);
map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));*/
}); /* End assessorLayer.queryRelatedFeatures function */
}); /* End assessorLayer.on click event */
【问题讨论】:
标签: javascript arcgis esri arcgis-js-api