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 逆天通用水印扩展篇~新增剪贴板系列 ...
随机推荐
- 基于iTop4412的FM收音机系统设计(三)
说明:第一版架构为:APP+JNI(NDK)+Driver(linux),优点是开发简单,周期短,也作为自己的毕业设计 现在更新第二版,FM服务完全植入Android系统中,成为系统服务,架构为:AP ...
- Pycharm 报错 AttributeError: module 'pip' has no attribute 'main'
1.打开文件packaging_tool.py: D:\Program files\pycharm\PyCharm 2016.3.2\helpers\packaging_tool.py 2.添加导入: ...
- SpringMVC初写(二)映射类型、限制和数据绑定
映射路径 a)映射路径的概述 所谓的映射路径,就是匹配请求路径和执行方法关系的路径 请求路径:http://localhost:8080/springmvc-demo-cofig/say.do 映射路 ...
- 什么是WCF(转)
什么是WCF(Windows Communication Foundation(WCF)) 大家可以百度一下了解什么是WCF.当然有些人看到密密麻麻的黑框白字就懒的读.即使读了 可能也没明白确切的含义 ...
- LINQ to Entities does not recognize the method , and this method cannot be translated into a store expression 解决办法
根据用户输入的起始日期,查询以起始日期开始的前20条记录,在ASP.NET MVC的Controller代码中这样写: var Logs = db.Log.Take(20); if (!string. ...
- WCF系列教程之客户端异步调用服务
本文参考自http://www.cnblogs.com/wangweimutou/p/4409227.html,纯属读书笔记,加深记忆 一.简介 在前面的随笔中,详细的介绍了WCF客户端服务的调用方法 ...
- solr实时更新mysql数据的方法
第一步:创建core core是solr的特有概念,每个core是一个查询数据,.索引等的集合体,你可以把它想象成一个独立数据库,我们创建一个新core:名字[core1] 进入linux命令行,进入 ...
- solr集群的搭建教程和使用入门
1 什么是SolrCloud? SolrCloud(solr 云)是Solr提供的分布式搜索方案,当你需要大规模,容错,分布式索引和检索能力时使用 SolrCloud. 当一个系统的索引数据量少的时候 ...
- [PY3]——内置数据结构(6)——集合及其常用操作
集合及其常用操作Xmind图 集合的定义 # set( ) # {0,1,2} //注意不能用空的大括号来定义集合 # set(可迭代对象) In [1]: s=set();type ...
- Spring MVC 数据绑定流程分析
1. 数据绑定流程原理★ ① Spring MVC 主框架将 ServletRequest 对象及目标方法的入参实例传递给 WebDataBinderFactory 实例,以创建 Data ...