添加半透明的图片到跟踪图层,半透明得到背景色没有半透明效果? string path= @"D:\\About.large.png"; bool cc = File.Exists(path); GeoPicture geo = new GeoPicture(); Bitmap bitmap = new Bitmap(path); geo.SetImage(bitmap); geo.Width = 0.005; geo.Height = 0.005; geo.Center = new Point2D(118.749836093, 27.926300662); map.Map.TrackingLayer.Add(geo, "geo"); map.Map.RefreshTrackingLayer();
答:地图的alpha通道没有打开,将alpha通道打开即可。map.IsGraphicsAlphaEnabled = true;
修改地图后,如何对地图进行保存?
答:UGMapStorage* pMapStorage = new UGMapStorage();pMapStorage->SetXML(pMap->ToXML());pMapStorage->SetName(pMap->GetName());m_pWorkSpace->m_MapStorages.SetAt(pMap->GetName(), pMapStorage);
修改场景后,如何对场景进行保存?
答:UGSceneStorage* pSceneStorage = new UGSceneStorage(); pSceneStorage->SetXML(pScene->ToXML()); pSceneStorage->SetName(strName); m_pWorkSpace->m_SceneStorages.SetAt(strName, pSceneStorage);
如何添加天地图在线地图到三维场景中?
答:scenecontrol.Scene.Layers.Add("http://t0.tianditu.gov.cn/img_c/wmts?tk=4de111eb54407e940abf055e6f38a167","tianditu","img",96,ImageFormatType.JPG_PNG, true); scenecontrol.Scene.Refresh(); 第一个参数中tk后面写自己申请的天地图token
如何添加OpenStreetMaps在线地图到三维场景中?
答: scenecontrol.Scene.Layers.Add("http://openstreetmap.org", Layer3DType.OpenStreetMaps, "openstreetmaps", true); scenecontrol.Scene.Refresh();
如何添加BingMaps在线地图到三维场景中?
答: scenecontrol.Scene.Layers.Add("http://cn.bing.com/ditu", Layer3DType.BingMaps, "bingmap", true); scenecontrol.Scene.Refresh();
如何添加三维切片缓存到三维场景?
答:scenecontrol.Scene.Layers.Add("scp路径", Layer3DType.osgb, true);
如何添加地图到三维场景?
答:scenecontrol.Scene.Layers.Add("地图名称", Layer3DType.Map, true);
如何查询某个字段的唯一值?
答:UGWorkspace* m_pWorkspace = (UGWorkspace*)m_pMapControl->GetMapEditWnd()->m_mapWnd.m_Map.GetWorkspace(); UGDatasetVector* datasetvector = (UGDatasetVector*)m_pWorkspace->GetDataSource(_U("aaa"))->GetDataset(_U("New_Point_1")); datasetvector->Open(); UGArray strs; strs.Add(_U("distinct smuserid")); UGQueryDef Querydef; Querydef.m_Fields = strs; UGRecordset* re = datasetvector->Query(Querydef); UGint count = re->GetRecordCount(); UGArray result; for (UGint i = 0; i < count; i++) { re->MoveTo(i); result.Add(re->GetString(_U("smuserid"))); } 以上代码是对smuserid这个字段进行查询唯一值操作,result数组中存储的就是所有的唯一值。
如何导入shp数据?
答:UGWorkspace* pWorkspace = (UGWorkspace*)m_pMapControl->GetMapEditWnd()->m_mapWnd.m_Map.GetWorkspace(); UGDataExchange exchange = UGDataExchange(); UGDataSource* ds = pWorkspace->GetDataSource(0); if (!ds) { return; } int issu = exchange.AttachDataSource(ds); UGShapeImportParams importparams = UGShapeImportParams(); importparams.SetDestDTName(_U("RESULT")); importparams.SetFilePathName(_U("C:\\Users\\\Desktop\\shp\\Ocean_R.shp")); UGint ii = importparams.GetFileType(); int ss = UGExchangeParamsManager::IsValidImportParams(ii, importparams); UGint issucceed = exchange.Import(importparams);