mapxtreme2005 改變選中的圖元樣式

MapInfo.Styles.CompositeStyle compositeStyle = GetOpaquesStyle(false, System.Drawing.Color.Blue);

if (map != null)
{
if (map.Layers[SysCommon.TempTableAlias] != null)
{
map.Layers.Remove(SysCommon.TempTableAlias);
}
if (map.Layers[SysCommon.TempLayerAlias] != null)
{
map.Layers.Remove(SysCommon.TempLayerAlias);
}
}
MapInfo.Engine.Session.Current.Catalog.CloseTable(SysCommon.TempTableAlias);

MapInfo.Data.Table newtable = CreateCustomerTempTable(SysCommon.TempTableAlias, LayerAlias);
MapInfo.Data.MIConnection conn = new MIConnection();
conn.Open();
MapInfo.Data.MICommand comm = conn.CreateCommand();
comm.CommandText = "delete " + SysCommon.TempTableAlias;
comm.Prepare();
comm.ExecuteNonQuery();

foreach (Feature ftr in irfc)
{
comm.CommandText = "insert into " + newtable.Alias + " select * from " + LayerAlias + " where MI_Key ='" + ftr.Key + "'";
comm.ExecuteNonQuery();
}
conn.Close();
(map.Layers[SysCommon.TempTableAlias] as FeatureLayer).Modifiers.Clear();
MapInfo.Mapping.FeatureOverrideStyleModifier fsmtemp = new MapInfo.Mapping.FeatureOverrideStyleModifier(null, compositeStyle);
(map.Layers[SysCommon.TempTableAlias] as FeatureLayer).Modifiers.Append(fsmtemp);
發佈了45 篇原創文章 · 獲贊 0 · 訪問量 2525
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章