[求助]根据属性值定位(arcgis server + c#)
前台输入村庄名称,实现根据该属性值进行地图定位。“xzqhmc”为村庄属性的字段名,“期末地类图斑”为村庄属性输在的图层。为什么输入正确的村庄名,还是会显示找不到该村庄呢?主要代码如下求高手帮忙,小弟是新手,请多多指教。
public void RaiseCallbackEvent(string enventargs)
{
System.Collections.IEnumerable func_enum = null;
//获取当前map1控件中所有的functionality
func_enum = Map1.GetFunctionalities();
System.Data.DataTable datatable;
//对所有的functionality进行遍历
foreach (ESRI.ArcGIS.ADF.Web.DataSources.IGISFunctionality gisfunctionality in func_enum)
{
ESRI.ArcGIS.ADF.Web.DataSources.IGISResource gisresource = null;
//得到该functionality的resource
gisresource = gisfunctionality.Resource;
//判断该resource是否支持IQueryFunctionality
bool supported = false;
supported = gisresource.SupportsFunctionality(typeof(ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality));
if (supported)
{
ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality qfunc;
qfunc = (ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality)gisresource.CreateFunctionality(typeof(ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality), null);
string[] lids;
string[] lnames;
//获得图层的layerId和layerName,GetQueryableLayers的重载方法可以指定图层类型
qfunc.GetQueryableLayers(null, out lids, out lnames);
int selindex = -1;
for (int i = 0; i < lids.Length; i++)
{
if (lnames[i] == "期末地类图斑")