Virtual Reality 3D Electronic Sandbox Digital Sandbox Drone Oblique Photography Panoramic Modeling Development Tutorial Lesson 5
Set system.ini as follows
Server=122.112.229.220
user=GisTest
Password=chinamtouch.com
This database only provides data near Chengdu South Railway Station. Please note, 104.0648,30.61658
Add your own UI object at the position specified by the mouse:
code show as below:
private void Button_Click_6(object sender, RoutedEventArgs e)
{
gis3d.GetJWEvent += Gis3d_GetJWEvent;
gis3d.State = GisLib.WindowsMT.GisState.Get the latitude and longitude;
}
private void Gis3d_GetJWEvent(System.Windows.Media.Media3D.Point3D value)
{
gis3d.GetJWEvent -= Gis3d_GetJWEvent;
gis3d.State = GisLib.WindowsMT.GisState.Roaming;
Callout MyCallOut = new Callout();
MyCallOut.Width = 300;
MyCallOut.Height = 200;
MyCallOut.BorderBrush = new SolidColorBrush(Colors.White);
MyCallOut.Background = new SolidColorBrush(Colors.Blue);
MyCallOut.Stroke = new SolidColorBrush(Colors.Black);
MyCallOut.Fill = new SolidColorBrush(Color.FromArgb(100, 0, 0, 0));
MyCallOut.AnchorPoint = new Point(0, 2);
MyCallOut.StrokeThickness = 2;
NewGisBiao.M3D.UserGisUI3dObject2 JuLiSechBiao = new NewGisBiao.M3D.UserGisUI3dObject2(); //Create a new thing that carries UI objects
JuLiSechBiao.PareantEarth = (NewGisBiao.Base.GISInterfaseForBiao)IniRead.IniReadWrite.MPareant;//Set its GIS ball object
JuLiSechBiao.Manage = IniRead.IniReadWrite.BiaoManage;//Set its label manager
JuLiSechBiao.MaxZoom = 9;//Maximum display layer, it will not be displayed when it is less than 9 layers
JuLiSechBiao.MUIValue = MyCallOut;//UI object
JuLiSechBiao.DHi = 0.01;//Height relative to terrain
JuLiSechBiao.ZScal = 0.2;//relative scaling
JuLiSechBiao.Scal.ScaleX = 1; //Fixed stuff
JuLiSechBiao.Scal.ScaleY = 1;
JuLiSechBiao.Scal.ScaleZ = 1;
JuLiSechBiao.AutoScal = true;//Whether to automatically scale or not, it will be the same size no matter which layer it is on
JuLiSechBiao.AutoAngle = true;//Whether to automatically angle so that it faces the camera
JuLiSechBiao.CenterType = JunBiao.CenteType.Lower left corner;//Center type
IniRead.IniReadWrite.BiaoManage.AddJunBiao(JuLiSechBiao);//Add to the military standard management object. You can also skip it
JuLiSechBiao.MWidth = 250;//The size of the three-dimensional patch
JuLiSechBiao.MHeight = 150;
JuLiSechBiao.MRX = 90;
if (IniRead.IniReadWrite.MPareant is MTGIS3D) //Manually refresh the automatic angle. . . bug
{
((MTGIS3D)IniRead.IniReadWrite.MPareant).TextAxisAngleX.Angle += 0.001;
((MTGIS3D)IniRead.IniReadWrite.MPareant).TextAxisAngleX.Angle -= 0.001;
}
JuLiSechBiao.Center = new Point(value.X, value.Y);//Set the center point
JuLiSechBiao.ISShow = true;//display
}
The effect is as follows:
————————————————