Shape tools – Pitney Bowes MapXtreme User Manual

Page 144

Advertising
background image

Chapter 7: Desktop Applications, Controls, Dialogs, and Tools

MapXtreme Desktop Tools API

MapXtreme v7.1

144

Developer Guide

Shape Tools

MapXtreme provides a group of tools for drawing geometric features on your map. Most of these
tools are used by “click-and-drag.” As you click and then drag to another location on your map, a
rubber-band image is displayed showing the current size and shape of the object being drawn. Each
of these tools uses the Esc key to cancel the current operation (if appropriate).

The following are types of shape tools MapXtreme supports.

Line Tools

The tools included in this group are AddLineMapTool and CustomLineMapTool. These tools draw a
Line. The tool is activated by clicking and dragging from the beginning point to the end point.
Releasing the mouse button creates the Line. If the Shift key is pressed while dragging, the angle of
the Line is constrained to multiples of 45°. If the Ctrl key is pressed while dragging, the line doubles
in length and height. Pressing Esc before releasing the mouse cancels the operation.

Polyline Tools

The tools included in this group are AddPolylineMapTool and CustomPolylineMapTool. These tools
draw a Line with multiple segments. The tool is activated by clicking on a point and then clicking on
a subsequent point. When you are done clicking on points, click again on the last point and the
Polyline is drawn. If the Shift key is pressed while dragging, the angle of the Line is constrained to
multiples of 45°. The Ctrl key has no effect on this tool. Pressing Esc before completing the line,
cancels the operation.

Ellipse and Arc Tools

The tools included in this group are: AddEllipseMapTool, CustomEllipseMapTool and
CustomArcMapTool. The Ellipse tools draw an Ellipse. The CustomArcMapTool draws an arc only; it
does not insert the arc into a layer.

The Ellipse tool is activated by clicking and dragging from a point on one side of the perimeter to a
point on the other. Releasing the mouse button creates the Ellipse. If the Shift key is pressed while
dragging, the Ellipse is constrained to a circle where the radius is constant. If the Ctrl key is pressed
while dragging, the Ellipse is drawn with the starting point in the center. Pressing the Esc key before
releasing the mouse cancels the operation. Note that the axis of the Ellipse is always aligned to the
coordinate system.

MapXtreme provides a lightweight CustomArcMapTool that draws a reference arc on the map, but
which does not provide or insert a LegacyArc FeatureGeometry into the layer. To create an arc tool
with such behavior, you must create your own implementation. For example, if you want a
CustomArcMapTool to have the same operations as an AddMapTool, create a new arc tool class
that derives from CustomArcMapTool and implements the IAddMapToolProperties interface.

Circle Tools

The tools included in this group are AddCircleMapTool and CustomCircleMapTool. The Circle tools
draw a Circle. This is equivalent to using the Ellipse tool while holding down the Shift key. The tool is
activated by clicking and dragging from the center point of the Circle center to a point on the
perimeter. As you drag, you will see the size of the Circle expand around that center point. Releasing

Advertising