Click or drag to resize

DirectionalPushPin Class

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
A light-weight pushpin that may be rotated to a specified Heading before being drawn. For example, a DirectionalPushPin could be used to describe the direction and position of a truck.
Inheritance Hierarchy

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
[SerializableAttribute]
public class DirectionalPushPin : PushPin

The DirectionalPushPin type exposes the following members.

Constructors
  NameDescription
Public methodDirectionalPushPin(LatLon)
Create a directional pushpin with the heading set to 0.
Public methodDirectionalPushPin(LatLon, Single, Int32)
Create a new DirectionalPushPin with a given location, heading and icon.
Top
Properties
  NameDescription
Public propertyCode exampleAlwaysOnTop
Controls whether labels are always shown above other map elements.
(Inherited from PushPin.)
Public propertyHeading
Gets or sets the heading (in degrees) of this DirectionalPushPin.
Public propertyCode exampleIcon
Gets or sets the Icon number. See IconCache for details.
(Inherited from PushPin.)
Public propertyLocation
Gets or sets the location (as a LatLon) of the push pin.
(Inherited from PushPin.)
Public propertyRequiredRendermodes
Gets the RenderMode required by this PushPin.
(Inherited from PushPin.)
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 methodRender
Render directional pushpins on the given map, according to their Heading.
(Overrides PushPinRender(Graphics, RenderContext).)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldTag
A user object containing data to associate with this PushPin.
(Inherited from PushPin.)
Top
Remarks

For best results you should use an icon that is rotatable about its center (that is, the hotspot of the icon is at (width/2, height/2).

Heading values are automatically kept within 360 degrees, but ensuring that the heading results in a visually appropriate rotation is your responsibility.

Examples
C#
// load our icon for the pushpin
int cacheIndex = ImageUtils.IconCache.LoadIcon("C:\path_to_icon\bus.png");

// location for the pushpin
LatLon ll = new LatLon(34.0, -118.0); 

// heading for the pushpin - we could also get this from a GPS unit,
// see Navigation.Navigator.Heading ...
float head = 72;  // rotated 72 degrees clockwise

// create the DirectionalPushPin
DirectionalPushPin dpp = new DirectionalPushPin(ll, head, cacheIndex);

...

// add to the RendererList so it gets drawn on the map
myRendererList.Add(dpp);
See Also