| | |
Google Map in C#
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2009
Posts: 10
Reputation:
Solved Threads: 0
I am trying to develp a webpage that takes in TO and FROM Addres and displays the Google Map as well the directions.
I understand JScript helps out with the Google Map display and I played around with the URL google.maps.com to get the directions. Now my issue is I have to pass on the data from the C# to JScript and i m struck here..
I understand JScript helps out with the Google Map display and I played around with the URL google.maps.com to get the directions. Now my issue is I have to pass on the data from the C# to JScript and i m struck here..
ASP.NET Syntax (Toggle Plain Text)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="http://maps.google.com/maps?file=api&v=1 &key=KEYS" type="text/javascript"> </script> </head> <body> <form id="form1" runat="server"> <div id="map" style="width: 400px; height: 300px; margin-top: 48px;"></div> <script type="text/javascript"> //<![CDATA[ var x = -83.022206; var y = 39.998264; var map = new GMap(document.getElementById("map")); var point1 = new GPoint(x,y); var marker1 = new GMarker(point1); map.centerAndZoom(point1, 3); map.addOverlay(marker1); //Add Zoom in Zoom out map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); //Add Marker var point = new GPoint(-83.015522, 40.002068); var marker = new GMarker(point); map.addOverlay(marker); //]]> </script> <div id="Div1" style="width: 400px; height: 97px; margin-top: 48px;"> TO <asp:TextBox ID="TextBox1" runat="server" style="width: 128px; margin-right: 49px"></asp:TextBox> <br /> FROM <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> <br /> <asp:Button ID="Button1" runat="server" Height="34px" style="margin-left: 39px" Text="Button" Width="167px" onclick="Button1_Click" /> <br /> <asp:GridView runat = server ID = "gridview" onselectedindexchanged="gridview_SelectedIndexChanged" AutoGenerateColumns = "false"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:Label ID="Label1" runat ="server" Text ='<% #Eval("value") %>' > </asp:Label> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </div> </form> </body> </html>
Last edited by peter_budo; Nov 12th, 2009 at 5:57 am. Reason: Correcting code tags
0
#2 Nov 12th, 2009
>Now my issue is I have to pass on the data from the C# to JScript and i m struck here..
Use GMap asp.net control.
SUMMARY: A custom server control wrapper for the Google Maps API. Developed for ASP.Net using C#, JavaScript, and XSL. The GMap control makes using Google Maps easy for .Net developers; allowing them to interact with Google Maps using standard .Net language
Take a look at an article - http://www.codeproject.com/KB/custom...lat-Part1.aspx
Use GMap asp.net control.
SUMMARY: A custom server control wrapper for the Google Maps API. Developed for ASP.Net using C#, JavaScript, and XSL. The GMap control makes using Google Maps easy for .Net developers; allowing them to interact with Google Maps using standard .Net language
Take a look at an article - http://www.codeproject.com/KB/custom...lat-Part1.aspx
![]() |
Similar Threads
- Google Map Tunining (Show Off your Projects)
- Google Map's new 'What's Here' functionality and SEO (Search Engine Optimization)
- Google map Api (PHP)
- How to display google map or Virtual Earth in PDA web browser (VB.NET)
- google map or image on form along zoomin zoomout (VB.NET)
- Google map convert into an image using php (PHP)
- google map question (PHP)
- display google map using php (PHP)
Other Threads in the ASP.NET Forum
- Previous Thread: File Upload Control
- Next Thread: Strange Issues on ASP.NET App
Views: 647 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 activexcontrol advice ajax alltypeofvideos anathor application asp asp.net bc30451 bottomasp.net browser button c# c#gridviewcolumn checkbox child click commonfunctions compatible confirmationcodegeneration connection content courier css database datagridview datagridviewcheckbox datalist deadlock development dgv dropdown dropdownlist edit expose feedback flash form formatdecimal forms formview google grid gridview homeedition hosting iframe iis index javascript jquery list login microsoft migration mono mssql multistepregistration numerical object objects panelmasterpagebuttoncontrols problem project ratings rotatepage save schoolproject search security serializesmo.table session silverlight smartcard software sql sqlserver2005 suse textbox tracking typeof unauthorized update validation vb vb.net video view virtualdirectory vista visual-studio visualstudio web webarchitecture webdevelopemnt webservice xml youareanotmemberofthedebuggerusers






