Help us translate this website and improve this translation and earn free licenses!
Anonymous user  |  Log in  |  Create Account

How to...

GDirections Basic

It is simple 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 textboxes, 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 = "Ups";
GMap1.addGDirection(gdirection);
Powered by Subgurim.NET and Comunactivo