三维数字沙盘大数据人工智能模拟对抗推演系统开发教程第一课

 三维电子沙盘大数据人工智能模拟对抗推演系统开发教程第一课

该数据库中只提供 成都市火车南站附近的数据请注意,104.0648,30.61658

而且该公用服务器带宽不大,所以会有些卡顿,建议下载数据库后本地使用,下载后的数据库有些许变化,请联系博主修改一下

你下载了sql包。则设置为自己的设置。

下一步新建一个wpf工程。然后引用SDK中的gislib.dll,NewGisBiao.dll如下图:

下面上代码

<Window x:Class="Teach3DGIS.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Teach3DGIS"
        mc:Ignorable="d"
        Title="MainWindow" Height="768" Width="1024">
    <Canvas x:Name="Root" Height="768" Width="1024">
        
    </Canvas>
</Window>
MainWindow.cs

using GisLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
 
namespace Teach3DGIS
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            Init3D();
        }
        GisLib.MTGIS3D gis3d;
        GisLib.MTGIS2 gis2d;
        private void Init3D()
        {
            if (gis3d == null)
            {
                IniRead.IniReadWrite.BiaoManage = new NewGisBiao.Base.BiaoManage(Root);
                gis3d = new MTGIS3D();
                gis3d.TManage = IniRead.IniReadWrite.BiaoManage;
                Root.Children.Add(gis3d);
                Canvas.SetLeft(gis3d, 0);
                Canvas.SetTop(gis3d, 0);
                gis3d.Width = this.Width - 100;
                gis3d.Height = this.Height - 100;
 
 
                //高程数据目录及对象初始
                // gis3d.WireLineSelect += Gis3d_WireLineSelect;
                gis3d._HiMain = new GisLib.HiData.HiMang(AppDomain.CurrentDomain.BaseDirectory + "hidatatemp", "hi");
 
                 IniRead.IniReadWrite.MPareant = gis3d;
            }
 
        }
    }
}
设置工程 输出目录为SDK所在目录如下图

然后运后就可以得到一个wpf版本的3dgis了:

由于是非axhost方式加入的,所以是完全支持WPF的特性的。我们可以将地图控件旋转一定角度:代码如下:

  RotateTransform u1 = new RotateTransform();
                u1.Angle = 45;
                gis3d.RenderTransformOrigin = new Point(0.5, 0.5);
                gis3d.RenderTransform = u1;
效果如下:


————————————————
 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值