The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



MouseAction


Unit:SDL_geomap
Class:TGeoMap
Declaration:property MouseAction: TMouseActMode;

The property MouseAction facilitates interactive zooming and panning of maps, and displaying a rubber band. This property may take one of the following values:

maDrawMTrace The mouse movement is recorded if the left mouse button is pressed. The recorded mouse trace is displayed. See MouseTrace for details.
maNone No built-in interaction is possible. The only way to apply a mouse controlled action is by utilizing the mouse events.
maPan The map can be panned by pressing and holding the left mouse button. The map image will then follow the mouse movement.
maPanHoriz The map can be panned only horizontally by pressing and holding the left mouse button. The map image will then follow the mouse movement parallel to the x-axis.
maPanVert The map can be panned only vertically by pressing and holding the left mouse button. The map image will then follow the mouse movement parallel to the y-axis.
maRubberband This mode allows to display a rubber band from the last click position to the current mouse position. The rubber band is turned on and off by successive clicks. You may leave the last rubber band trace visible by shift-clicking (this way you can easily follow a curved path by many small linear segments. The maRubberband mode triggers three events: OnBeginRubberBand, OnContinueRubberBand, and OnEndRubberband.
maSelectRect This option provides the capability to select a rectangular region of the map. The user has to press and hold down the left mouse button at the first corner of the intended region. Thereafter a rectangle follows the mouse cursor indicating the selected region. Releasing the left button selects this region and triggers the OnSelectRect event.
maZoomWind The user can zoom into a rectangular region of the map. Therefore he has to press and hold down the left mouse button at one of the corners of the intended region. Thereafter a rectangle follows the mouse cursor indicating the region to be zoomed. Releasing the left button selects this region and zooms into the map by displaying the selected region. Please note that the aspect ratio of the map image is retained.
maZoomDrag This mode enables the user both to increase and to decrease the magnification factor of the map. The left mouse button has to be pressed and held down. The magnification of the map image will then follow the mouse movement. Moving to the left and/or bottom zooms out of the map; moving to the right and/or top zooms into the map.

Hint 1: These interactive modes will function smoothly only on a powerful computer with a proper graphics card.

Hint 2: The various map ranges are stored in a zoom history list after each zoom or pan action. Thus you could restore the previous range by using the method ZoomHistory.

Hint 3: In the case of type ambiguities concerning maNone please visit the SDL TechnNotes.

Example: This property is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): simplegeomap



Last Update: 2023-Dec-13