public GeoMap(Map esriMap) { _map = esriMap; ArcGISTiledMapServiceLayer layer = new ArcGISTiledMapServiceLayer(); layer.Url = "http://server.arcgisonline.com/arcgis/rest/services/ESRI_StreetMap_World_2D/MapServer"; _myLocationLayer = new GraphicsLayer(); _redliningGraphicsLayer = new GraphicsLayer(); _map.Layers.Add(layer); _map.Layers.Add(_redliningGraphicsLayer); _map.Layers.Add(_myLocationLayer); _map.ExtentChanged += _map_ExtentChanged; ////////Init DrawControl////////// _drawControl = new DrawControl(_map); _drawMode = GeoDrawMode.None; _drawControl.SetDrawMode(DrawMode.None); _drawControl.DrawCompletedEvent += _drawControl_DrawCompletedEvent; ///////Init default Draw Symbols//////// PointMarkerSymbol = new SimpleMarkerSymbol(); PointMarkerSymbol.Color = new SolidColorBrush(Colors.Red); PointMarkerSymbol.Size = 15; PointMarkerSymbol.Style = SimpleMarkerSymbol.SimpleMarkerStyle.Circle; PolygonFillSymbol = new SimpleFillSymbol(); PolygonFillSymbol.BorderBrush = new SolidColorBrush(Colors.Red); PolygonFillSymbol.BorderThickness = 3; PolygonFillSymbol.Fill = new SolidColorBrush(System.Windows.Media.Color.FromArgb(100, 255, 0, 0)); LineSymbol = new SimpleLineSymbol(); LineSymbol.Color = new SolidColorBrush(Colors.Red); LineSymbol.Width = 5; LineSymbol.Style = SimpleLineSymbol.LineStyle.Solid; TextDrawsymbol = new TextSymbol(); TextDrawsymbol.Text = "Text"; TextDrawsymbol.FontSize = 15; }
public void SetDrawMode(GeoDrawMode mode) { //_drawMode = mode; //switch (mode) //{ // case GeoDrawMode.None: // _drawControl.SetDrawMode(DrawMode.None); // break; // case GeoDrawMode.Point: // case GeoDrawMode.Text: // _drawControl.SetDrawMode(DrawMode.Point); // break; // case GeoDrawMode.Line: // _drawControl.SetDrawMode(DrawMode.Polyline); // break; // case GeoDrawMode.Polygon: // _drawControl.SetDrawMode(DrawMode.Polygon); // break; //} }
public void SetDrawMode(GeoDrawMode mode) { _drawMode = mode; switch (mode) { case GeoDrawMode.None: _drawControl.SetDrawMode(DrawMode.None); break; case GeoDrawMode.Point: case GeoDrawMode.Text: _drawControl.SetDrawMode(DrawMode.Point); break; case GeoDrawMode.Line: _drawControl.SetDrawMode(DrawMode.Polyline); break; case GeoDrawMode.Polygon: _drawControl.SetDrawMode(DrawMode.Polygon); break; } }