|
阅读:1057回复:0
求助。。。在Asp.net(C#)+Mapxtreme2005中怎么样增加x,y点图层
<P>我是这样写的,可是显示不出来</P>
<P>大家帮帮忙,谢谢!</P> <P>//建立XY空间方案<BR> MapInfo.Data.SpatialSchemaXY xy = new MapInfo.Data.SpatialSchemaXY();<BR> xy.XColumn = "X";<BR> xy.YColumn = "Y";<BR> xy.NullPoint = "0.0, 0.0";<BR> xy.StyleType = MapInfo.Data.StyleType.None;<BR> xy.DefaultStyle = new MapInfo.Styles.CompositeStyle();<BR> xy.CoordSys = MapInfo.Engine.Session.Current.CoordSysFactory.CreateLongLat(MapInfo.Geometry.DatumID.WGS84);</P> <P> //建立TableInfo <BR> MapInfo.Data.TableInfoServer ti=new TableInfoServer("sourcetable");<BR> ti.ConnectString ="Driver={SQL Server};Server=xiewei;database=MapSamples; Uid=sa;Pwd=123;QuotedID=Yes;Trusted_Connection=No;Network=DBMSSOCN;Address=PALADIN,1433;DLG=SQL_DRIVER_NOPROMPT";<BR> ti.Query="select * from Sheet1";<BR> ti.Toolkit=MapInfo.Data.ServerToolkit.Odbc; <BR> ti.CacheSettings.CacheType = CacheOption.Off;</P> <P> ti.SpatialSchema = xy;<BR> MapInfo.Data.Table miCustomers = MapInfo.Engine.Session.Current.Catalog.OpenTable (ti);<BR> bool ismap = miCustomers.IsMappable;<BR> MapInfo.Mapping.FeatureLayer featureLayer = new MapInfo.Mapping.FeatureLayer(miCustomers,"Database","Database"); </P> <P> MapInfo.Mapping.Map myMap = GetMapObj();</P> <P> for(int i=myMap.Layers.Count-1;i>=0 ;i--)<BR> {<BR> myMap.Layers.RemoveAt(i);<BR> }<BR> <BR> myMap.Layers.Add (featureLayer);</P> |
|