Click or drag to resize

SchematicTurnBox Constructor (String)

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Creates a SchematicTurnBox that uses images from a specified folder.

Namespace:  Telogis.GeoBase.Navigation
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public SchematicTurnBox(
	string imagesPath
)

Parameters

imagesPath
Type: SystemString
The path for the folder that contains the images for displaying different movements.
Remarks

SchematicTurnBox is used to draw a visual direction aid and, optionally, a progress bar on the Map when navigating a turn or navigation event. When constructed without a string path or a MovementCategorizer, SchematicTurnBox expects predefined PNG or BMP images located in the TurnIcons folder (Program Files\Telogis\GeoBase\GeoBaseResources\TurnIcons). See the table below for file name details.

The area of the SchematicTurnBox image is determined by the container image (container.png). If replacing the default turn and progress images with customized alternatives, note that the combined dimensions of the turn image (a graphical representation of the next movement, typically a directional arrow) and the progress image (an image indicating the distance remaining until an approaching turn or navigation event should be executed by the navigator/driver) should be less than that of the container image.

The default container's dimensions are 125 pixels x 125 pixels; the included default turn images 100 pixels x 100 pixels and the progress images 100 pixels x 15 pixels. Placed side-by-side these images have a combined width of 200 pixels, exceeding that of the container. SchematicTurnBox therefore automatically positions the progress image below the turn image in a default installation.

If the combination of turn image and progress image does not fit within the container's dimensions (either vertical or horizontal), the turn and progress images will be stacked vertically with the progress image the lower of the two.

To place the progress image beside the turn image rather than beneath it, ensure the combined width of the two images is less than that of the container by reducing the width of the progress images accordingly.

Note that the progress image is optional. If progress images are not found in the default or specified turn images folder, or if the SchematicTurnBox property ProgressBarVisible is set to false, a progress image will not be displayed.

The images folder should contain the following images (in png or bmp, format):

FileRepresents
around_round_lhd.pngUturn by going around a traffic circle in left-hand traffic.
around_round_rhd.pngUturn by going around a traffic circle in right-hand traffic.
container.pngAn image which defines the size of the SchematicTurnBox. The size should exceed the combined dimensions of the turn and progress images in either the vertical or horizontal dimensions.
destination.pngArrival at destination.
fwy_change_l.pngChange freeways to the left
fwy_change_r.pngChange freeways to the right.
fwy_enter_l.pngEnter freeway from the left.
fwy_enter_r.pngEnter freeway from the right.
fwy_exit_l.pngExit freeway on the left.
fwy_exit_r.pngExit freeway on the right.
left.pngTurn left.
left_bear.pngBear to the left.
left_lane.pngUse the left lane.
left_round_lhd.pngTurn left at the traffic circle in left-hand traffic.
left_round_rhd.pngTurn left at the traffic circle in right-hand traffic.
left_sharp.pngTake a sharp left
right.pngTurn right.
right_bear.pngBear to the right.
right_lane.pngUse the right lane.
right_round_lhd.pngTurn right at the traffic circle in left-hand traffic.
right_round_rhd.pngTurn right at the traffic circle in right-hand traffic.
right_sharp.pngTake a sharp right.
straight.pngGo straight ahead.
straight_round_lhd.pngGo straight through the traffic circle in left-hand traffic.
straight_round_rhd.pngGo straight through the traffic circle in right-hand traffic.
uturn_lhd.pngMake a uturn in left-hand traffic (by turning right).
uturn_rhd.pngMake a uturn in right-hand traffic (by turning left).
progress_i.pngOptional: A series of progress images, where i goes from 1 to the number of images. Used to show progress towards the navigation event.
Examples
The following example includes a modified version of the Using a TurnBox tutorial code, replacing TurnBox with SchematicTurnBox.
C#
// Declarations added to the top of the form.
RendererList myRenderList = new RendererList();
Navigator nav;

// Create a SchematicTurnBox with defaults and look for images in the
// Program Files\Telogis\GeoBase\GeoBaseResources\TurnIcons folder.
SchematicTurnBox sBox = new SchematicTurnBox();

// Create a SchematicTurnBox that points to the specified image folder.
// This folder must contain all images with their correct file names.
// SchematicTurnBox sBox = new SchematicTurnBox(@"C:\path_to_folder\TurnIcons");

// Initialize a pushpin at the starting point of the route.
BalloonPushPin myPin = new BalloonPushPin(new LatLon(34.167108, -118.327609));

public Form1()
{
    InitializeComponent();
}

private void UpdateLocation(object sender, EventArgs e)
{
    // Remove the previous/old pushpin. 
    myRenderList.Remove(myPin);

    // Update the map center and heading.
    mapMain.Center = nav.Gps.Position.location;
    mapMain.Heading = nav.Gps.Position.heading;

    // Update the current location of the Navigator.
    nav.AddPoint();

    // Get the upcoming events that the Navigator will use.
    sBox.Event = nav.CurrentNavigationEvent;

    // Add the SchematicTurnBox to the renderer.
    myRenderList.Add(sBox);

    // Add a new pin at the current GPS location.
    myPin.Location = nav.Gps.Position.location;

    // Show the closest street address in an information label.
    myPin.Name = "You are here";
    IGeocodeResult currentAddress = GeoCoder.ReverseGeoCodeFull(nav.Position.location).Address.ToGeocodeResult();
    string shortFormAddress = AddressFormatter.Default.GetShortLineForm(currentAddress.FoundAddress, "en-US");
    myPin.Information = "Closest street address is: \n" + shortFormAddress;

    // Add the new pushpin
    myRenderList.Add(myPin);
}

private void mapMain_Load(object sender, EventArgs e)
{

}

private void buttonGo_Click(object sender, EventArgs e)
{
    mapMain.Renderer = myRenderList;
    mapMain.Zoom = 0.5;

    // Start a timer that fires every second, calling our eventhandler.
    Timer tim = new Timer();
    tim.Interval = 1000;
    tim.Tick += new EventHandler(UpdateLocation);
    tim.Start();

    // Set up the Navigator.
    StaticGps MyGps = new StaticGps(34.167108, -118.327609);
    LatLon start_point = new LatLon(34.167108, -118.327609);
    LatLon end_point = new LatLon(34.178221, -118.342751);

    // The path to the langs folder.
    String path_to_langs_folder = Settings.GeoBasePath("langs");
    nav = new Navigator(MyGps, path_to_langs_folder, System.Globalization.CultureInfo.CurrentCulture);
    nav.Destination = new RouteStop(end_point);
    nav.Gps = new SimulatedGps(start_point);

    // Create BalloonPushPins at the start and end of the route (to improve visibility).
    BalloonPushPin myStart = new BalloonPushPin(start_point);
    BalloonPushPin myEnd = new BalloonPushPin(end_point);
    myStart.Name = "Starting Point";
    myStart.Information = "Route starts here";
    myEnd.Name = "Destination";
    myEnd.Information = "Route ends here";
    myRenderList.Add(nav);
    myRenderList.Add(myStart);
    myRenderList.Add(myEnd);    
}
See Also