Anonymous user  |  Log in  |  Create Account

GDirections Basic

It's very easy to add support for GDirection in the map: only line of code is needed!

But obviously it is possible to make use of other properties of GDirection. In this example we will study the simplest properties:

  • autoGenerate: automatically adds the functionality of GDirections, inserting text boxes, labels, and the button. by default it is "true".
  • fromText: text for the start point label. by default it is "From: ".
  • toText: text for the destination label. by default it is "To: ".
  • buttonText: text on the button to execute the event. by default it is "Go".
  • clearMap: boolean that says whether the map should be cleared between two calls.
  • errorMessage: message seen when an error occurs. 
From: To:
Code.aspx
<cc1:GMap ID="GMap1" runat="server" />
Code.aspx.cs
GDirection gdirection = new GDirection(true);
gdirection.errorMessage = "Oops";
GMap1.Add(gdirection);
Powered by Subgurim.NET