在给定的Sharpmap教程代码中加载不同的shapefile的问题 [英] Issues loading different shapefiles in given sharpmap tutorial code

查看:28
本文介绍了在给定的Sharpmap教程代码中加载不同的shapefile的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在从事Sharpmap项目,需要处理离线地图.因为我在这个领域比较新鲜,所以我正在学习 sharpmap 教程并面临在给定教程代码中加载新形状文件的问题.

I am currently working on sharpmap project with the need to work on offline maps. As i am fresher in this field,I am following the sharpmap tutorial and facing a problem with loading new shape files in the given tutorial code.

例如:\

SharpMap.Layers.VectorLayer("States");
    vlay.DataSource = new SharpMap.Data.Providers.ShapeFile("path_to_data\\states_ugl.shp", true);

在这行代码中,如果我传递不同的 shapefile,则代码构建时背景为空白或不显示.我尝试了不同大小的不同形状文件,但结果是一样的.它仅适用于代码中提到的 states_ugl.shp 文件.请在此问题上寻求帮助,因为我是该领域的新手.
谢谢.

At this line of code, if i pass a different shapefile, code builds with a blank background or no display. I have tried with different shape files with different sizes but the result is the same. It only works for the mentioned states_ugl.shp file given in the code. Please need help regarding this issue as I am a fresher in this field.
Thanks.

推荐答案

尝试为您的图层设置图层样式,如下所示.

Try giving layer styling for your layer, something like below.

layer.DataSource = DBlayer;
layer.Style.Fill = new SolidBrush(Color.Transparent);
layer.Style.Outline = new Pen(Color.Black);
layer.Style.EnableOutline = true;
layer.MaxVisible = 13000;

这篇关于在给定的Sharpmap教程代码中加载不同的shapefile的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆