当前位置:网站首页>ArcEngine(一)加载矢量数据
ArcEngine(一)加载矢量数据
2022-08-03 07:28:00 【稻田里展望者】
利用MarControl控件添加矢量数据
private void 加载矢量数据ToolStripMenuItem_Click(object sender, EventArgs e)
{
//打开文件对话框
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Title = "加载shapefile数据";//设置title
openFileDialog.Filter = "(*.shp)|*.shp";//设置过滤模式
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
//设置路径
string fullPath = openFileDialog.FileName;//全部路径
string path = fullPath.Substring(0,fullPath.LastIndexOf("\\"));//截取字符串:除了名称之前的数据
string name = fullPath.Substring(fullPath.LastIndexOf("\\")+1);//一直截取到末尾
//添加图层
MapControl.AddShapeFile(path, name);
//刷新底图
MapControl.Refresh();
MessageBox.Show("文件加载成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
边栏推荐
猜你喜欢
随机推荐
MySQL or使索引失效
10 分钟彻底理解 Redis 的持久化和主从复制
vs 2022无法安装 vc_runtimeMinmum_x86错误
Haisi project summary
redis AOF持久化个人理解
DSP-ADAU1452输出通道配置
HCIP笔记整理 2022/7/18
volta管理node版本
《21天精通TypeScript-5》类型注解与原始类型
解读 refresh 十二步骤
pyspark---encode the suuid interval (based on the number of exposures and clicks)
SSM整合流程
pgaudit 的安装使用《postgresql》
jolt语法
集群
[机缘参悟-59]:《素书》-6-安于礼仪[安礼章第六]
Taro框架-微信小程序-内嵌h5页面
Golang协程goroutine的调度与状态变迁分析
一文搞懂什么是@Component和@Bean注解以及如何使用
C语言实现树的底层遍历--超简代码