日期:2013-05-24 浏览次数:20459 次
MapX从数据库读取数据形成新图层(C#)
代码如下: private void CreatNewLayerfromDB(string layerName, ADODB.Recordset rsNoPass) { this.DeleteLayerByName(layerName); //将原有层删除
CMapXFields flds=new FieldsClass();
// Describe the structure of the Unbound dataset flds.Add("stationid", "theid", AggregationFunctionConstants.miAggregationIndividual, FieldTypeConstants.miTypeString); flds.Add("address", "address", AggregationFunctionConstants.miAggregationIndividual, FieldTypeConstants.miTypeString); flds.Add("longitude", "longitude", AggregationFunctionConstants.miAggregationSum, FieldTypeConstants.miTypeNumeric); //经度 flds.Add("latitude", "latitude", AggregationFunctionConstants.miAggregationSum, FieldTypeConstants.miTypeNumeric); //纬度
CMapXBindLayer bindLayerObject=new BindLayerClass(); bindLayerObject.LayerName=layerName; bindLayerObject.RefColumn1=3; &nb