AE中如何由IFeature 如何获取所对应的FeatureClass
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AE中如何由IFeature 如何获取所对应的FeatureClass相关的知识,希望对你有一定的参考价值。
参考技术A private void OnDeleteFeatureMethod(object o) IFeature pFeature = o as IFeature; IFeatureClass pFeatureClass = pFeature.Class as IFeatureClass; for (int i = 0; i < axMapControl1.Map.LayerCount;i++ ) IFeatureLayer iFeatureLayer = axMapControl1.get_Layer(i) as IFeatureLayer; IFeatureClass iFeatureCla = iFeatureLayer.FeatureClass; if (iFeatureCla == pFeatureClass) IWorkspace pWorkSpace = m_EngineEditor.EditWorkspace; textBox3.Text += "操作的文件全路径:" + pWorkSpace.PathName + "\\" + axMapControl1.get_Layer(i).Name + ".shp " + "\r\n"; break; if (pFeature.Shape.GeometryType == esriGeometryType.esriGeometryPoint) IGeometry iGe = pFeature.Shape; IPoint ipo = new PointClass(); ipo = iGe as IPoint; int a = 0; int b = 0; axMapControl1.FromMapPoint(ipo, ref a, ref b); textBox3.Text += "删除的点的ID号:" + pFeature.OID + ",坐标:(" + a + "," + b + ")" + "\r\n"; else if (pFeature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon) textBox3.Text += "删除的多边形对象的ID号:" + pFeature.OID + ",坐标:"; IPolygon pPolygon = (IPolygon)pFeature.Shape; int a = 0; int b = 0; //把该feature强制转换为一个点的集合,再取点的坐标 IPointCollection pPointCollection = pPolygon as IPointCollection; for (int i = 0; i < pPointCollection.PointCount - 1; i++) IPoint ipo = pPointCollection.get_Point(i); axMapControl1.FromMapPoint(ipo, ref a, ref b); textBox3.Text += "(" + a + "," + b + ")" + "\t"; textBox3.Text += "\r\n"; else if (pFeature.Shape.GeometryType == esriGeometryType.esriGeometryPolyline) textBox3.Text += "删除的线对象的ID号:" + pFeature.OID + ",其坐标:"; IPolyline pPolygon = (IPolyline)pFeature.Shape; int a = 0; int b = 0; //把该feature强制转换为一个点的集合,再取点的坐标 IPointCollection pPointCollection = pPolygon as IPointCollection; for (int i = 0; i < pPointCollection.PointCount; i++) IPoint ipo = pPointCollection.get_Point(i); axMapControl1.FromMapPoint(ipo, ref a, ref b); textBox3.Text += "(" + a + "," + b + ")" + "\t"; textBox3.Text += "\r\n"; axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null); 本回答被提问者采纳PHP-CodeIgniter:如何通过Javascript获取要删除的对应html表格行值
【中文标题】PHP-CodeIgniter:如何通过Javascript获取要删除的对应html表格行值【英文标题】:PHP-CodeIgniter: How to get the corresponding html table row values to be deleted by Javascript 【发布时间】:2015-02-17 06:56:49 【问题描述】:在我的 codeigniter 项目中,我使用了一个由 Ajax 动态生成的表。在每一行上都有一个按钮,可以从 Html 表和 Mysql 表中删除相应的行。
我已经试过了。我得到了删除 Html 表格行的代码,它遵循
$(document).on('click', '#deleteRow', function()
$(this).parent().parent().remove();
);
它奏效了。但我也想从 Mysql 中删除相应的行。所以首先,它需要从javascript传递相应的行信息。然后通过 URL 将其传递给控制器。?
window.location.href = "<?php echo base_url("settings/remove_company"); ?>?id="+current;
我如何获取对应的行信息,例如 company_id、lic_id(html 表的字段名称)。? 任何帮助将不胜感激。
【问题讨论】:
使每一行都是唯一的,然后在您的删除按钮上调用一个函数。make 函数发出 ajax 请求以删除该行,当响应是使用您的唯一 ID 接收删除元素时 【参考方案1】:为<tr>
添加属性
<tr data-companyId="<?php echo $companyId;?>" data-licId="<?php echo $licId;?>">
在您的 jQuery 中,通过单击删除链接获取这些属性:
$(document).on('click', '#deleteRow', function()
var companyId = $(this).parent().parent().attr('data-companyId');
var licId = $(this).parent().parent().attr('data-licId');
$(this).parent().parent().remove();
);
甚至,您可以进行对象缓存(使用变量而不是对象来提高性能。
$(document).on('click', '#deleteRow', function()
var obj = $(this).parent().parent();
var companyId = obj.attr('data-companyId');
var licId = obj.attr('data-licId');
obj.remove();
);
【讨论】:
以上是关于AE中如何由IFeature 如何获取所对应的FeatureClass的主要内容,如果未能解决你的问题,请参考以下文章
java中如何获取我在ACCESS数据库中查询到的某个字段所对应的主键的值?