动态对象添加
2019-01-04 本文已影响0人
46c039090c91
1.动态对象的添加与点的添加类似,只是使用了GSOGeoDynamicMarker插件,使得标注的图片可以做成动态的图片
2.添加一个动态对象
GSOGeoDynamicMarker marker = new GSOGeoDynamicMarker();
3.设置点的位置
marker.Position = new GSOPoint3d(120.4178, 31.328, 0);
4.设置样式
marker.AltitudeMode = EnumAltitudeMode.ClampToModel;
marker.TimerInterval = 50000;
marker.PlaySpeed = 10; //运动速度
marker.Play(); //播放
//marker.Stop();//停止动画
GSOMarkerStyle3D markerStyle = new GSOMarkerStyle3D();
//设置显示图片位置(.gif 动态图)
markerStyle.IconPath= System.IO.Path.Combine("C:\\Users\\TX- 2018\\source\\repos\\aboutfeature\\aboutfeature\\bin\\x64\\Debug\\Resource\\gif\\190104.gif");
markerStyle.IconScale = 4; //图片显示缩放倍数
5.赋予样式
marker.Style = markerStyle;
6.把动态标注赋值给对象,跳转到对应位置
GSOFeature newFeature = new GSOFeature();
newFeature.Geometry = marker;//将几何对象加入要素中
newFeature.Name = "动态标注";
globeControl1.Globe.MemoryLayer.AddFeature(newFeature);
globeControl1.Globe.FlyToFeature(newFeature);

7.注意
7.1设置自己的图片路径的时候,注意原文档中已经有了一个图片的路径


