二维里面建议使用跟踪图层,王跟踪图层里面添加图片,有下面两种方式:
1、直接使用UGGeoPicture,通过设置UGGeoPicture的SetAbsolutePath和中心点、宽度、高度等参数后,将UGGeoPicture直接添加到跟踪图层; UGGeoPicture* geopicture = new UGGeoPicture(); geopicture-<SetAbsolutePath(_U("..\\..\\..\\TestData\\22.png")); geopicture-<SetCenterPoint(pt); geopicture-<SetHeight(50); geopicture-<SetWidth(50); m_pMapControl-<GetMapEditWnd()-<m_mapWnd.m_Map.m_TrackingLayer.Add(geopicture, _U("tupian")); m_pMapControl-<GetMapEditWnd()-<m_mapWnd.m_Map.SetRefreshFlag(false); m_pMapControl-<GetMapEditWnd()-<SendInvalidateFunc();
2、或者将图标通过idekstop导入到符号资源库,然后构造一个点对象,设置点的风格,然后将填添加到跟踪图层; UGGeoPoint* geopoint = new UGGeoPoint(); geopoint-<SetX(pt.x); geopoint-<SetY(pt.y); UGStyle* style = new UGStyle(); style-<SetMarkerStyle(65);//设置图标ID; style-<SetMarkerSize(5); geopoint-<SetStyle(style); m_pMapControl-<GetMapEditWnd()-<m_mapWnd.m_Map.m_TrackingLayer.Add(geopoint, _U("dian"));