MapXtreme2004代码 在地图上新增加点图元


     sender, System.EventArgs e)
</span>
{
</span>

</span></span>
Map map1=MapControl1.Map;
</span>
x=map1.Center.x/2;
</span>
y=map1.Center.y/2;
</span>
showPointOnSearchTableMap(x,y);
</span>
}
</span>

</span>
y)
</span>

</span>
Map map=MapControl1.Map;
</span>

</span>
CoordSys coordSys=map.GetDisplayCoordSys();
</span>

</span>
)
</span>

</span>
TableInfoMemTable("temp");
</span>
;
</span>

</span>
Column column;
</span>
GeometryColumn(coordSys);
</span>
column.Alias="MI_Geometry";
</span>
column.DataType =MIDbType.FeatureGeometry;
</span>
tableInfo.Columns.Add(column);
</span>

</span>
Column();
</span>
column.Alias="MI_Style";
</span>
column.DataType =MIDbType.Style;
</span>
tableInfo.Columns.Add(column);
</span>

</span>
table = MapInfo.Engine.Session.Current.Catalog.CreateTable(tableInfo);
</span>
}
</span>
else
</span></span>
{
</span>
MIConnection();
</span>
MICommand tempcmd=conn.CreateCommand();
</span>
tempcmd.CommandText ="delete from temp";
</span>
conn.Open();
</span>
tempcmd.ExecuteNonQuery();
</span>
conn.Close();
</span>
tempcmd.Dispose();
</span>
}
</span>

</span>

</span></span>

</span>
SimpleVectorPointStyle(40,System.Drawing.Color.Green,14);
</span>

</span></span>
MapInfo.Styles.CompositeStyle(vStyle);
</span>

</span>
MIConnection();
</span>
MICommand cmd=connection.CreateCommand();
</span>
cmd.Parameters.Add("geometry",MIDbType.FeatureGeometry);
</span>
cmd.Parameters.Add("style",MIDbType.Style);
</span>
cmd.CommandText ="Insert Into temp(MI_Geometry,MI_Style) values (geometry,style)";
</span>

</span>
connection.Open();
</span>
=geometry;
</span>
cmd.Parameters[1].Value =cStyle;
</span>
nchanged=cmd.ExecuteNonQuery();
</span>
cmd.Dispose();
</span>

</span>

</span></span>
FeatureLayer(table);
</span>
map.Layers.Insert(0,fl);
</span>

</span>
MapInfo.Geometry.DPoint(x,y);
</span>
}
</span>
 

你可能感兴趣的:(java,工作)