问题描述
利用MapXtreme的控件,将sqlserver中数据信息展示到地图上,所有的都以点的形式存在,在数据库里对应的经纬度都有说明,请问怎样才能将说明信息展示到地图上?
解决方案
解决方案二:
MIConnectionConnection=newMIConnection();Connection.Open();MapInfo.Data.SpatialSchemaXYmiSpS=newMapInfo.Data.SpatialSchemaXY();MapInfo.Geometry.CoordSysFactorymiCF=newMapInfo.Geometry.CoordSysFactory();miSpS.XColumn="PointLong";miSpS.YColumn="PointLat";miSpS.DefaultStyle=newSimpleVectorPointStyle(34,Color.Red,15);miSpS.CoordSys=map.GetDisplayCoordSys();TableInfoServerti=newTableInfoServer("GpsData");ti.ConnectString="DRIVER={SQLServer};SERVER=10.60.6.21;DATABASE=bsgps_shenyang;UID=savideo;PWD=p@ssw0rd;";ti.Toolkit=ServerToolkit.Odbc;ti.Query="selectcarinfo.company,carinfo.cartype,carinfo.beizhu,ontimepoint.carmark,ontimepoint.pointlong,ontimepoint.pointlat,ontimepoint.speed,ontimepoint.direction,ontimepoint.retimefromontimepoint,carinfowhereontimepoint.carphone=carinfo.phone";ti.SpatialSchema=miSpS;ti.Temporary=true;
解决方案三:
有点用处,谢谢