Draw draw = new Draw(ArcGISHelper.GisMap);
draw.DrawComplete += new EventHandler<DrawEventArgs>(draw_DrawComplete);
draw.DrawMode = DrawMode.Polygon;
draw.IsEnabled = true;
void draw_DrawComplete(object sender, DrawEventArgs e)
{
Graphic g = new Graphic();
if (e.Geometry is ESRI.ArcGIS.Client.Geometry.Polygon)
{
g.Geometry = e.Geometry;
g.Symbol = GisSymbol.GetPolygonLocation(4);
locateLayer.Graphics.Add(g);
//draw.DrawMode = DrawMode.Polyline;
//ArcGISHelper.GisMap.PanTo(g.Geometry);
}
if (e.Geometry is ESRI.ArcGIS.Client.Geometry.Polyline)
{
g.Geometry = e.Geometry;
g.Symbol = GisSymbol.GetLineLocation(4);
locateLayer.Graphics.Add(g);
}
}
Graphic g = new Graphic();
ESRI.ArcGIS.Client.Symbols.TextSymbol s = new ESRI.ArcGIS.Client.Symbols.TextSymbol()
{
Text = "哈哈哈哈",
FontSize=20
};
g.Symbol = s;
MapPoint m = new MapPoint(111.232986126, 30.7859620350001);
g.Geometry = m;
locateLayer.Graphics.Add(g);
Graphic g1 = new Graphic();
ESRI.ArcGIS.Client.Symbols.TextSymbol s1 = new ESRI.ArcGIS.Client.Symbols.TextSymbol()
{
Text = "嘻嘻",
FontSize = 20
};
g1.Symbol = s1;
g1.Geometry = new MapPoint(111.232986126, 30.7859620350001);
locateLayer.Graphics.Add(g1);