Arigis for WPF 標繪 箭頭 ArcGISPlotSilverlightAPI ...
這兩天有個需求,在地圖上做標繪箭頭,效果如下圖。









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 ); } }
運行,可以用滑鼠在地圖上做標繪了!