Polyline Sample

A sample about ASP.NET Google Map Control polyline usage.

A simple demo adding polyline to map and client handler for polyline click event.
For full api documentation about polylines read here ...

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.

This is a dummy submit, nothing to do, but just to test changes are preserved after post back.


Source

Markup

<%@ Page Language="C#" MasterPageFile="Polylines.master" AutoEventWireup="false" %>

<asp:Content ID="mainContent" ContentPlaceHolderID="MainContent" runat="Server">
    <div class="jumbotron">
        <h2>Polyline Sample</h2>
        <p>
            A sample about ASP.NET Google Map Control polyline usage.
        </p>
    </div>
    <p>
        A simple demo adding polyline to map and client handler for polyline click event.<br />
        For full api documentation about polylines <a href="https://mapcontrol.bitbucket.io/api/GoogleMaps.Polylines.GooglePolyline.html" target="_blank">read here ...</a>
    </p>

    <div class="map-wrap">
        <map:GoogleMap ID="GoogleMap1" runat="server" Width="100%" Height="600px" Latitude="50.0" Longitude="19.0" Zoom="4" CssClass="map" FullscreenControl="true">
        </map:GoogleMap>
        <map:GooglePolyline TargetControlID="GoogleMap1" runat="server" StrokeWeight="10"
            OnClientClick="handleClick" Clickable="true" Geodesic="true" Draggable="true" Editable="true">
            <map:LatLng Latitude="42.14304" Longitude="24.74967" />
            <map:LatLng Latitude="42.69649" Longitude="23.32601" />
            <map:LatLng Latitude="58.3012888" Longitude="14.2586219" />
        </map:GooglePolyline>
    </div>

    <p>
        This is a dummy submit, nothing to do, but just to test changes are preserved after post back.
    </p>
    <asp:Button runat="server" Text="Submit" />

    <script type="text/javascript">
        function handleClick(sender, e) {
            alert("Polyline clicked at lat: " + e.latLng.lat() + ", lng: " + e.latLng.lng());
        }
    </script>
    
</asp:Content>