当前位置: 首页> 健康> 科研 > 临沂网站定制_外包服务费税率_有别人的交易链接怎么交易_深圳百度快速排名优化

临沂网站定制_外包服务费税率_有别人的交易链接怎么交易_深圳百度快速排名优化

时间:2025/8/23 21:40:40来源:https://blog.csdn.net/liqian_ken/article/details/142751137 浏览次数:0次
临沂网站定制_外包服务费税率_有别人的交易链接怎么交易_深圳百度快速排名优化

步骤

  1. 创建.NET Framework4.8的WPF应用
  2. 在NuGet中安装Mapsui.Wpf 4.1.7
  3. 添加命名空间和组件
<Window x:Class="TestMapsui.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:TestMapsui"mc:Ignorable="d"xmlns:wpf="clr-namespace:Mapsui.UI.Wpf;assembly=Mapsui.UI.Wpf"Title="MainWindow" Height="450" Width="800"><Grid><wpf:MapControl x:Name="MapCtrl"/></Grid>
</Window>
  1. 添加WKT相关内容
using Mapsui.Layers;
using Mapsui.Nts;
using Mapsui.Styles;
using Mapsui.Styles.Thematics;
using NetTopologySuite.IO;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using Brush = Mapsui.Styles.Brush;
using Color = Mapsui.Styles.Color;namespace TestMapsui
{/// <summary>/// MainWindow.xaml 的交互逻辑/// </summary>public partial class MainWindow : Window{public MainWindow(){InitializeComponent();var map = MapCtrl.Map;var layer = new MemoryLayer{IsMapInfoLayer = true,Features = GetFeatures(),Style = CreateDefaultVectorStyle()};map.Layers.Add(layer);//map.Refresh();           }   }
}

随意制作几个点线面的WKT:

        public IEnumerable<GeometryFeature> GetFeatures(){var wkts = new List<string>(){"polygon((0 0,0 2,1 1,1 0,0 0),(0.3 0.3,0.3 0.8,0.8 0.8, 0.3 0.3))","polygon((2 2,3 2,3 1,2 2))","polygon((1 0,1 1,2 1,2 0,1 0))","linestring(0 3,2 3,1 2)","point(0 0)","point(3 3)"};var r = new WKTReader();var geos = wkts.Select(x => r.Read(x));var fs = geos.Select(x => new GeometryFeature(x));return fs;}

随意设置默认的矢量样式:

        private IThemeStyle CreateDefaultVectorStyle(){return new ThemeStyle(pFunction =>{var brush = new Brush(Color.LightBlue);brush.FillStyle = FillStyle.Solid;brush.Background = Color.Red;VectorStyle style = new VectorStyle{Fill = brush,Outline = new Mapsui.Styles.Pen(Color.Gray, 3),Line = new Mapsui.Styles.Pen(Color.Red, 2)};return style;       });} 

效果图

一条线、两个点、三个面:

在这里插入图片描述

关键字:临沂网站定制_外包服务费税率_有别人的交易链接怎么交易_深圳百度快速排名优化

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: