Click or drag to resize

CompassRose Class

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Draws a Compass Rose on the map. When the user rotates the Compass Rose (by dragging with the mouse, configured by the EnableGui property) the map will rotate.
Inheritance Hierarchy
SystemObject
  Telogis.GeoBaseCompassRose

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public class CompassRose : IMapRenderer, 
	IMapMouseHandler

The CompassRose type exposes the following members.

Constructors
  NameDescription
Public methodCompassRose
Create a new CompassRose object.
Top
Properties
  NameDescription
Public propertyCode exampleColor
The Color that should be used to draw the CompassRose. Defaults to black.
Public propertyMapMouseEventsHandler
Implementation of IMapMouseHandler. Returns the correct handler for the user's action. Should not be called directly.
Public propertyCode exampleRequiredRendermodes
Gets the RenderMode required by this CompassRose. Always PostLabelling.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHitTest
Implementation of IMapMouseHandler. Checks to see if the Compass Rose should respond to the user action. Should not be called directly.
Public methodRender
Implementation of IMapRenderer. Used to draw the information balloon. Should not be called directly.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldCode exampleEnableGui
When true the user may interactively rotate the map by dragging the compass rose.
Public fieldCode exampleSize
The radius of the compass rose, in pixels. Default is 20.
Public fieldCode exampleX
The X pixel location of the center of the rose (measured from top left-hand corner). Default is 50.
Public fieldCode exampleY
The Y pixel location of the center of the rose (measured from top left-hand corner). Default is 50.
Top
Remarks

In this example image above the Compass Rose is drawn in the top left-hand corner and has been used to rotate the map (of Long Island, New York) clockwise approximately 100 degrees (positive angles are always clockwise). Note the orientation of labels does not change when the map is rotated.

This class is not guaranteed to be thread safe - a different instance should be used on each map.

Examples
C#
// set up the RendererList (allows us to draw multiple objects on a map)
RendererList rList = new RendererList();
mainMap.Renderer = rList;

...

// create a new CompassRose
CompassRose cr = new CompassRose();

// cr.X = mainMap.Right - 50;
// ^^ uncomment to position the CompassRose on the top-right corner

// cr.EnableGui = false; 
// ^^ uncomment to disable user interaction with the CompassRose

// add the CompassRose to our RendererList
rList.Add(cr);
See Also