ArcGISPlotSilverlightAPI For WPF
这两天有个需求,在地图上做标绘箭头,效果如下图。









public partial class MainWindow : Window
{
private EditGeometry _editGeometry;
private GraphicsLayer _gGraphicsLayer1;
private bool _isEdit;
private bool _isFinish;
private PlotDraw _plotDraw;
private long _pointCount;
private TailedArrow _tArraw;
private Graphic selectedPointGraphic; public MainWindow()
{
InitializeComponent();
Init();
} public void Init()
{
this._pointCount = 0L;
this._gGraphicsLayer1 = new GraphicsLayer();
this._isFinish = true;
this._plotDraw = new PlotDraw(mainMap);
EditGeometry geometry = new EditGeometry { Map=this.mainMap,IsEnabled=true,EditVerticesEnabled=false};
this._editGeometry = geometry;
this.mainMap.Layers.Add(this._gGraphicsLayer1);
this._gGraphicsLayer1.MouseLeftButtonDown += _gGraphicsLayer1_MouseLeftButtonDown;
this._isEdit = true;
this._plotDraw.DrawEnd += _plotDraw_DrawEnd;
this._plotDraw.setPlotDrawMode(PlotDrawMode.TailedArrow);
} void _gGraphicsLayer1_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e)
{
//throw new NotImplementedException();
if (this._isEdit)
{
e.Handled = true;
if (e.Graphic.Geometry is MapPoint)
{
e.Graphic.Selected = true;
this.selectedPointGraphic = e.Graphic;
}
else
{
this._editGeometry.StartEdit(e.Graphic);
}
}
} void _plotDraw_DrawEnd(ESRI.ArcGIS.Client.Geometry.Polygon polygon)
{
//throw new NotImplementedException();
Symbol symbol = App.Current.Resources["DrawFillSymbol"] as Symbol;
Graphic item = new Graphic
{
Geometry = polygon,
Symbol = symbol
}; this._gGraphicsLayer1.Graphics.Add(item );
}
}
ArcGISPlotSilverlightAPI For WPF的更多相关文章
- 在WPF中使用依赖注入的方式创建视图
在WPF中使用依赖注入的方式创建视图 0x00 问题的产生 互联网时代桌面开发真是越来越少了,很多应用都转到了浏览器端和移动智能终端,相应的软件开发上的新技术应用到桌面开发的文章也很少.我之前主要做W ...
- MVVM框架从WPF移植到UWP遇到的问题和解决方法
MVVM框架从WPF移植到UWP遇到的问题和解决方法 0x00 起因 这几天开始学习UWP了,之前有WPF经验,所以总体感觉还可以,看了一些基础概念和主题,写了几个测试程序,突然想起来了前一段时间在W ...
- MVVM模式解析和在WPF中的实现(六) 用依赖注入的方式配置ViewModel并注册消息
MVVM模式解析和在WPF中的实现(六) 用依赖注入的方式配置ViewModel并注册消息 系列目录: MVVM模式解析和在WPF中的实现(一)MVVM模式简介 MVVM模式解析和在WPF中的实现(二 ...
- MVVM模式解析和在WPF中的实现(五)View和ViewModel的通信
MVVM模式解析和在WPF中的实现(五) View和ViewModel的通信 系列目录: MVVM模式解析和在WPF中的实现(一)MVVM模式简介 MVVM模式解析和在WPF中的实现(二)数据绑定 M ...
- MVVM设计模式和WPF中的实现(四)事件绑定
MVVM设计模式和在WPF中的实现(四) 事件绑定 系列目录: MVVM模式解析和在WPF中的实现(一)MVVM模式简介 MVVM模式解析和在WPF中的实现(二)数据绑定 MVVM模式解析和在WPF中 ...
- MVVM模式解析和在WPF中的实现(三)命令绑定
MVVM模式解析和在WPF中的实现(三) 命令绑定 系列目录: MVVM模式解析和在WPF中的实现(一)MVVM模式简介 MVVM模式解析和在WPF中的实现(二)数据绑定 MVVM模式解析和在WPF中 ...
- MVVM模式和在WPF中的实现(二)数据绑定
MVVM模式解析和在WPF中的实现(二) 数据绑定 系列目录: MVVM模式解析和在WPF中的实现(一)MVVM模式简介 MVVM模式解析和在WPF中的实现(二)数据绑定 MVVM模式解析和在WPF中 ...
- MVVM模式和在WPF中的实现(一)MVVM模式简介
MVVM模式解析和在WPF中的实现(一) MVVM模式简介 系列目录: MVVM模式解析和在WPF中的实现(一)MVVM模式简介 MVVM模式解析和在WPF中的实现(二)数据绑定 MVVM模式解析和在 ...
- 逆天通用水印支持Winform,WPF,Web,WP,Win10。支持位置选择(9个位置 ==》[X])
常用技能:http://www.cnblogs.com/dunitian/p/4822808.html#skill 逆天博客:http://dnt.dkil.net 逆天通用水印扩展篇~新增剪贴板系列 ...
随机推荐
- UNIX基础概念
UNIX基本概念 进程 从用户观点来看:进程是程序的一个执行实例. 从UNIX系统内部来看,是为运行程序提供执行环境的实体,是系统进行资源分配和调度运行的一个单位. 进程有三个特点: 1)进程有一个控 ...
- Go语言类型转换
类型转换用于将一种数据类型的变量转换为另外一种类型的变量. Go语言类型转换基本格式如下:表达式 T(v) 将值 v 转换为类型 T . Go语言各种类型转换及函数的高级用法:strconv包实现了基 ...
- 物联网学习之路——物联网通信技术:NBIoT
NBIoT是什么 NB-IoT,Narrow Band Internet of Things,窄带物联网,是一种专为万物互联打造的蜂窝网络连接技术.顾名思义,NB-IoT所占用的带宽很窄,只需约180 ...
- hdu1024 Max Sum Plus Plus 滚动dp
Max Sum Plus Plus Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
- elastic-job动态添加定时任务
在elastic-job的使用过程中,我们会遇到动态添加定时任务的时候,但是官网上面并没有对这块内容进行说明.按照我的理解以及官网上面elastic-job的框架图,ej的定时任务其实是存储在zook ...
- Install Papirus Icon Theme on Ubuntu
sudo add-apt-repository ppa:papirus/papirus sudo apt update && sudo apt install papirus-icon ...
- JVM的监控命令
JVM监控命令基本就是 jps.jstack.jmap.jhat.jstat 几个命令的使用就可以了 JDK本身提供了很多方便的JVM性能调优监控工具,除了集成式的VisualVM和jConsole外 ...
- Java 中 String 的常用方法(一)
上一篇介绍了 String 中的几个常用构造方法,由 String 这个核心对象发散出去关于字符的编码,字符的字节表达,对 GC 的影响,正则表达式,模式匹配,这可能是 Java 里内涵最丰富的对象了 ...
- memcached 学习笔记 1
一 简介 1 What is Memcached? Free & open source, high-performance, distributed memory object cachin ...
- VSCode基本配置
功能:保存时自动按ESLint规范格式化代码 + stylus配置(需安装Manta's Stylus Supremacy插件) { "editor.fontSize": 18, ...