Directions Server Events Sample

A sample about ASP.NET Google Map Control directions server events usage.

Shows how to handle on the server the events fired by Google Map Directions.

Thank you for using the Development Build of ASP.NET Google Map Control to build Google Maps faster.
Purchase the Commercial Build now to get access to all product updates and the ASP.NET Google Map Control expert support.

Source

Markup

<%@ Page Language="C#" MasterPageFile="~/samples/Directions/Directions.master"  AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="GoogleMaps.Samples.samples.Directions.ServerEvents.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="jumbotron">
        <h2>Directions Server Events Sample</h2>
        <p>
            A sample about ASP.NET Google Map Control directions server events usage.
        </p>
    </div>
    <p>
        Shows how to handle on the server the events fired by Google Map Directions.
    </p>
    <div class="map-wrap">
        <map:GoogleMap ID="GoogleMap1" runat="server" Latitude="42.1229" Longitude="24.7879"
            Zoom="4" CssClass="map" Width="100%" Height="600px" FullscreenControl="true">
        </map:GoogleMap>
        <map:GoogleDirections ID="GoogleDirections1" TargetControlID="GoogleMap1" runat="server"
            Origin="plovdiv" Destination="sofia" Draggable="true" PanelID="route" OnChanged="HandleDirectionsChanged">
        </map:GoogleDirections>
    </div>
    <asp:PlaceHolder ID="phRoutes" runat="server">
        <div id="route">
        </div>
    </asp:PlaceHolder>
    
</asp:Content>

Code Behind

using GoogleMaps.Directions;

namespace GoogleMaps.Samples.samples.Directions.ServerEvents
{
    public partial class Default : System.Web.UI.Page
    {
        protected void HandleDirectionsChanged(object sender, DirectionsChangedEventArgs e)
        {
            phRoutes.Controls.Clear();
            //phRoutes.Controls.Add(new RouteRenderer(e));
        }
    }
}