MapLink Pro .NET 11.1
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
Track Graphics

A Track Graphic is a type of entity which can be added to the track manager and is defined by a set of control points.

These control points can either be fixed locations, or may be attached to tracks within the manager. If one of a graphic's control points is attached to a track then the graphic will automatically update whenever the track’s position is modified.

Track graphics displayed on a map, with mixed static and dynamic control points

In a similar fashion to tracks these graphics are managed by the track display manager. The application must create the graphic, setup the control points as needed, and then add it to the track manager for display. Graphics use the same 'TrackID' concept as the tracks which specifies the draw order of the tracks/graphics. Graphics may be 'picked' once they have been added to the display in the same fashion as tracks or other objects within MapLink.

This example demonstrates how to create a track graphic arrow, which will point from a track to a fixed position on the underlying map. The usage of each graphic implementation is slightly different, however the method in which the application creates graphics will be fairly similar. Please see the class documentation for the graphic in question for implementation-specific details.

// Fetch a pointer to a track
TSLNTrack track = trackManager.queryTrack(0);
// Create an instance of the arrow class
TSLNTrackGraphicArrow arrow = TSLNTrackGraphicArrow.create();
// The arrow graphic will have valid rendering by default however
// in this case we want to make the arrow red, and change
// the arrow tail to be a filled polygon instead of a solid line
arrow.tailWidth( 30.0, TSLNDimensionUnits.TSLNDimensionUnitsPixels );
TSLNRenderingAttributes attribs = arrow.rendering();
attribs.exteriorEdgeColour = Color.Red.ToArgb();
attribs.fillStyle = 1;
attribs.fillColour = Color.Red.ToArgb();
arrow.rendering( attribs );
// Define the control points for the arrow
// These may be defined before or after adding the graphic to the manager
// This will produce an arrow which points from the position of the track
// to a fixed point on the map
arrow.addControlPoint( track );
arrow.addControlPoint( -0.31, 51.38 );
// Add the graphic to the display
// If the position of the track is moved after this point the arrow will update
// automatically
trackManager.addGraphic( graphicID, arrow.get() );

Interaction with track aggregation

When using in conjunction with Track Aggregation any track which is used as a control point for a graphic will be excluded from aggregation.

This means that the aggregated track group will be displayed, in addition to the track itself in this situation.