America/US Samples
Europe Samples
Asia Samples

Google Maps for ASP.NET

This is Google Maps for ASP.NET. It is a Gaia Ajax extension control that wraps the Google Maps (GMaps) service! You can write C# or VB.NET and experience a full integration with Google Maps without use of any JavaScript.

 
SetCenter Latitude

Longitude

SetZoomLevel
Coordinates
Configuration
InfoWindow
MapType


Markup (ASPX/.aspx)

   1:   
   2:      <gaia:Label 
   3:          runat="server" 
   4:          ID="err" 
   5:          ForeColor="Red" />
   6:      <div class="container-gmap">
   7:          <gaia:GMap 
   8:              runat="server" 
   9:              ID="GMap1"
  10:              Height="350px"
  11:              Width="430px" 
  12:              OnMapTypeChanged="GMap1_MapTypeChanged" 
  13:              OnClick="GMap1_Click" 
  14:              OnZoom="GMap1_Zoom" 
  15:              OnMoveEnd="GMap1_MoveEnd"
  16:              OnMoveStart="GMap1_MoveStart" />
  17:      </div>
  18:      <div class="container-controlpanel">
  19:          <gaia:Panel runat="server" ID="zPnlStatus" GroupingText="Status" CssClass="container-status">
  20:              <gaia:Label 
  21:                  runat="server" 
  22:                  ID="msg" />
  23:          </gaia:Panel>
  24:          <table>
  25:              <tr>
  26:                  <td valign="top">
  27:                      SetCenter</td>
  28:                  <td>
  29:                      Latitude<br />
  30:                      <gaia:TextBox 
  31:                          runat="server" 
  32:                          BackColor="#ddddff"
  33:                          ID="txtLatitude" 
  34:                          Text="59.19857" Width="60px" /><br />
  35:                      Longitude<br />
  36:                      <gaia:TextBox 
  37:                          runat="server" 
  38:                          BackColor="#ddddff"
  39:                          ID="txtLongitude" 
  40:                          Text="9.613282" Width="60px" /><br />    
  41:                      <gaia:Button 
  42:                          runat="server" 
  43:                          ID="btnGoTo" 
  44:                          Text="Go to"
  45:                          OnClick="btnGoTo_Click" />
  46:                      <gaia:Button 
  47:                          ID="btnPanTo" 
  48:                          runat="server" 
  49:                          OnClick="btnPanTo_Click" 
  50:                          Text="Pan to" />
  51:                  </td>
  52:              </tr>
  53:              <tr>
  54:                  <td>
  55:                      SetZoomLevel</td>
  56:                  <td>
  57:                      <gaia:DropDownList 
  58:                          runat="server"
  59:                          ID="ddlZoom"
  60:                          AutoPostBack="true" 
  61:                          OnSelectedIndexChanged="ddlZoom_SelectedIndexChanged">
  62:                          <items>
  63:                              <asp:ListItem Value="0" />
  64:                              <asp:ListItem Value="1" />
  65:                              <asp:ListItem Value="2" />
  66:                              <asp:ListItem Value="3" />
  67:                              <asp:ListItem Value="4" />
  68:                              <asp:ListItem Value="5" Selected="True" />
  69:                              <asp:ListItem Value="6" />
  70:                              <asp:ListItem Value="7" />
  71:                              <asp:ListItem Value="8" />
  72:                              <asp:ListItem Value="9" />
  73:                              <asp:ListItem Value="10" />
  74:                              <asp:ListItem Value="11" />
  75:                              <asp:ListItem Value="12" />
  76:                              <asp:ListItem Value="13" />
  77:                              <asp:ListItem Value="14" />
  78:                              <asp:ListItem Value="15" />
  79:                              <asp:ListItem Value="16" />
  80:                              <asp:ListItem Value="17" />
  81:                              <asp:ListItem Value="18" />
  82:                              <asp:ListItem Value="19" />
  83:                          </items>
  84:                      </gaia:DropDownList></td>
  85:              </tr>
  86:              <tr>
  87:                  <td>
  88:                      Coordinates</td>
  89:                  <td>
  90:                      <gaia:Button 
  91:                          runat="server" 
  92:                          ID="btnGetCenterLatLng" 
  93:                          Text="Get coordinates"
  94:                          OnClick="btnGetCenterLatLng_Click" /></td>
  95:              </tr>
  96:              <tr>
  97:                  <td>
  98:                      Configuration</td>
  99:                  <td>
 100:                      <gaia:Button 
 101:                          runat="server" 
 102:                          ID="btnToggleDragging" 
 103:                          Text="Toggle dragging"
 104:                          OnClick="btnToggleDragging_Click" />
 105:                      <br />
 106:                      <gaia:Button 
 107:                          runat="server" 
 108:                          ID="btnToggleZoomControls" 
 109:                          Text="Toggle zoom"
 110:                          OnClick="btnToggleZoomControls_Click" /></td>
 111:              </tr>
 112:              <tr>
 113:                  <td>
 114:                      InfoWindow</td>
 115:                  <td>
 116:                      <gaia:Button 
 117:                          runat="server" 
 118:                          ID="btnAddInfoWindow" 
 119:                          Text="Add InfoWindow"
 120:                          OnClick="btnAddInfoWindow_Click" />
 121:                      <br />
 122:                      <gaia:Button 
 123:                          runat="server" 
 124:                          ID="btnCloseInfoWindow" 
 125:                          Text="Close InfoWindow"
 126:                          OnClick="btnCloseInfoWindow_Click" /></td>
 127:              </tr>
 128:              <tr>
 129:                  <td>
 130:                      MapType</td>
 131:                  <td>
 132:                      <gaia:DropDownList
 133:                          runat="server"
 134:                          ID="ddlMapType"
 135:                          AutoPostBack="true"
 136:                          OnSelectedIndexChanged="ddlMapType_SelectedIndexChanged">
 137:                          <Items>
 138:                              <asp:ListItem Value="Normal" />
 139:                              <asp:ListItem Value="Satellite" />
 140:                              <asp:ListItem Value="Hybrid" />
 141:                              <asp:ListItem Value="Physical" />
 142:                          </Items>
 143:                      </gaia:DropDownList></td>
 144:              </tr>
 145:          </table>
 146:      </div>
 147:      <br style="clear:both;" />
 148:   
 149: