If i want to add a point in mapXtreme i will use this :
Private Sub CreatePoint(ByVal X As Double, ByVal Y As Double) Dim Cat As Catalog = MapInfo.Engine.Session.Current.Catalog 'Create Temp layer Dim tblInfoTemp As New TableInfoMemTable("Animation") Dim tblTemp As Table = Cat.GetTable("Animation") If IsNothing(tblTemp) = False Then 'Table exists close it Cat.CloseTable("Animation") End If tblInfoTemp.Columns.Add(ColumnFactory.CreateFeatureGeometryColumn(MapForm1.MapControl1.Map.GetDisplayCoordSys())) tblInfoTemp.Columns.Add(ColumnFactory.CreateStyleColumn()) tblTemp = Cat.CreateTable(tblInfoTemp) Dim lyr As New FeatureLayer(tblTemp) MapForm1.MapControl1.Map.Layers.Add(lyr) Dim pt As FeatureGeometry = New Point(lyr.CoordSys, New DPoint(X, Y)) Dim cs As New CompositeStyle(New SimpleVectorPointStyle(37, System.Drawing.Color.Red, 30)) 'BitmapPointStyle sym1 = new BitmapPointStyle ("tv.bmp", BitmapStyles, System.Drawing.Color.White, 12); Dim filegst As String = Application.StartupPath + "\MAP\" & "busway.gst" Dim _bitmapSymbol As MapInfo.Styles.BitmapPointStyle = New MapInfo.Styles.BitmapPointStyle Dim foldercar As String = Application.StartupPath + "\CUSTSYMB" Dim styleRepository As MapInfo.Styles.StyleRepository = MapInfo.Engine.Session.Current.StyleRepository Dim bmpPointStyleRepository As MapInfo.Styles.BitmapPointStyleRepository = styleRepository.BitmapPointStyleRepository bmpPointStyleRepository.Reload(foldercar) _bitmapSymbol.Name = "car.bmp" _bitmapSymbol.PointSize = 18 'Dim img1 As BitmapPointStyle = New BitmapPointStyle("7331075531272800.bmp", BitmapStyles.None, Color.Green, 15) Dim ftr As New Feature(tblTemp.TableInfo.Columns) ftr.Geometry = pt ftr.Style = _bitmapSymbol tblTemp.InsertFeature(ftr)end sub
and My Question how to loop (add all point) data X/Y from data set like :
Sql = "select A_SummaryTrack.*, A_ObjectInf
bjectType from A_SummaryTrack Inner Join A_ObjectInfo on A_SummaryTrack.ObjectId = A_ObjectInf
bjectId order by A_SummaryTrack.gpstime desc" cmd = New OleDbCommand(Sql, ConAccess) Dim adapter As New OleDbDataAdapter(Sql, ConAccess) Dim dt As New DataTable("A_Speed") adapter.Fill(dt) dgw_tracking.DataSource = dt For Each dr As DataRow In dt.Rows() dim X as double = dr.item ("lon")dim y as double = dr.item ("lat") '??????????'' if i copy createpoint (x,y), just only 1 point add on the map .
أكثر...
Private Sub CreatePoint(ByVal X As Double, ByVal Y As Double) Dim Cat As Catalog = MapInfo.Engine.Session.Current.Catalog 'Create Temp layer Dim tblInfoTemp As New TableInfoMemTable("Animation") Dim tblTemp As Table = Cat.GetTable("Animation") If IsNothing(tblTemp) = False Then 'Table exists close it Cat.CloseTable("Animation") End If tblInfoTemp.Columns.Add(ColumnFactory.CreateFeatureGeometryColumn(MapForm1.MapControl1.Map.GetDisplayCoordSys())) tblInfoTemp.Columns.Add(ColumnFactory.CreateStyleColumn()) tblTemp = Cat.CreateTable(tblInfoTemp) Dim lyr As New FeatureLayer(tblTemp) MapForm1.MapControl1.Map.Layers.Add(lyr) Dim pt As FeatureGeometry = New Point(lyr.CoordSys, New DPoint(X, Y)) Dim cs As New CompositeStyle(New SimpleVectorPointStyle(37, System.Drawing.Color.Red, 30)) 'BitmapPointStyle sym1 = new BitmapPointStyle ("tv.bmp", BitmapStyles, System.Drawing.Color.White, 12); Dim filegst As String = Application.StartupPath + "\MAP\" & "busway.gst" Dim _bitmapSymbol As MapInfo.Styles.BitmapPointStyle = New MapInfo.Styles.BitmapPointStyle Dim foldercar As String = Application.StartupPath + "\CUSTSYMB" Dim styleRepository As MapInfo.Styles.StyleRepository = MapInfo.Engine.Session.Current.StyleRepository Dim bmpPointStyleRepository As MapInfo.Styles.BitmapPointStyleRepository = styleRepository.BitmapPointStyleRepository bmpPointStyleRepository.Reload(foldercar) _bitmapSymbol.Name = "car.bmp" _bitmapSymbol.PointSize = 18 'Dim img1 As BitmapPointStyle = New BitmapPointStyle("7331075531272800.bmp", BitmapStyles.None, Color.Green, 15) Dim ftr As New Feature(tblTemp.TableInfo.Columns) ftr.Geometry = pt ftr.Style = _bitmapSymbol tblTemp.InsertFeature(ftr)end sub
and My Question how to loop (add all point) data X/Y from data set like :
Sql = "select A_SummaryTrack.*, A_ObjectInf
أكثر...