MyMeasureAction m = new MyMeasureAction(); //initialize a MyMeasureAction class m.MeasureMode = ESRI.ArcGIS.Client.Actions.MeasureAction.Mode.Polygon; //MeasureMode is polygon m.DisplayTotals = false; //do not display total distance m.FillSymbol = LayoutRoot.Resources["DrawFillSymbol"] as FillSymbol; m.DistanceUnit = ESRI.ArcGIS.Client.Actions.DistanceUnit.Feet; m.MapUnits = ESRI.ArcGIS.Client.Actions.DistanceUnit.Feet; //the unit of the map is Feet m.Attach(MyMap); //bind this action to MyMap m.Execute(); //execute this action
Point lastClick;
private void Map_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Point pt = e.GetPosition(null);
if (Math.Abs(pt.X - lastClick.X) < 2 && Math.Abs(pt.Y - lastClick.Y) < 2)
{
//TODO: change cursor here
}
lastClick = pt;
}
You are right, there is no event raised when MeasureAction is complete. If you notice in the SDK sample, measure is completed when a DoubleClick is detected. This is when graphics are cleared from the map, which might be a good time to re-enable the pan cursor.Point lastClick; private void Map_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { Point pt = e.GetPosition(null); if (Math.Abs(pt.X - lastClick.X) < 2 && Math.Abs(pt.Y - lastClick.Y) < 2) { //TODO: change cursor here } lastClick = pt; }
You are right, there is no event raised when MeasureAction is complete. If you notice in the SDK sample, measure is completed when a DoubleClick is detected. This is when graphics are cleared from the map, which might be a good time to re-enable the pan cursor.Point lastClick; private void Map_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { Point pt = e.GetPosition(null); if (Math.Abs(pt.X - lastClick.X) < 2 && Math.Abs(pt.Y - lastClick.Y) < 2) { //TODO: change cursor here } lastClick = pt; }