473,231 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

How to Draw a Route in Google Map using Asp.net and Sql server Database Values

I'm New Developer of Google Map Using ASP.Net...

I developing one Project Using ASP.Net,C#,SQL Server in Google Maps...My Problem is Database Values are Retrieved into the Map,but line is not Drawn between the Markers...

This is My Code for Retrieving Data from Database to GMap
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.     var markers = [
  3.     <asp:Repeater ID="rptMarkers" runat="server">
  4.     <ItemTemplate>
  5.              {
  6.                 "lat": '<%# Eval("Latitude") %>',
  7.                 "lng": '<%# Eval("Longitude") %>',               
  8.             }
  9.     </ItemTemplate>
  10.     <SeparatorTemplate>
  11.         ,
  12.     </SeparatorTemplate>
  13.     </asp:Repeater>
  14.     ];
  15.     </script>
  16.     <script type="text/javascript">
  17.  
  18.         window.onload = function () {
  19.             var mapOptions = {
  20.                 center: new google.maps.LatLng(markers[0].lat, markers[0].lng),
  21.                 zoom: 12,
  22.                 mapTypeId: google.maps.MapTypeId.ROADMAP
  23.             };
  24.             var infoWindow = new google.maps.InfoWindow();
  25.             var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions);
  26.  
  27.             for (i = 0; i < markers.length; i++) 
  28.             {
  29.                 var data = markers[i];
  30.  
  31.                 var myLatlng = new google.maps.LatLng(data.lat, data.lng);
  32.  
  33.                 var marker = new google.maps.Marker(
  34.                 {
  35.                     position: myLatlng,
  36.                     map: map
  37.                 });  
  38.  
  39.                 var myTrip = myLatlng;  alert(myTrip);  
  40.                 var polyline = new GPolyline([new GLatLng(myTrip),
  41.                                     new GLatLng( myTrip),
  42.                                     ],"#3333cc", 10);            
  43.              }
  44.  
  45.  
  46.         }
  47.     </script>
Can Any one Help me...
Apr 24 '13 #1
0 3015

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Michael diPilla | last post by:
We have a SQLSERVER database that is replicated to many users. We are currently in an expansion phase where we need to make changes to the server database. Each time we rollout a new release, we...
3
by: imani_technology_spam | last post by:
We need to present hierarchical data on a web page, the same way the tree view shows files in Windows Explorer. Here's the catch: that tree view needs to be bound to a SQL Server database. How...
1
by: BT Openworld | last post by:
I've just had to upgrade to Access 2003. Our company's main sales database started in Access V1.0 and has progressed through V2.0 and 97 without problems. I've converted it to 2003 format and have...
1
by: Paul | last post by:
Hi, I wish to be able to add tables to a sql server database at runtime from my asp.net application. As well as creating fields I also wish to be able to create indexes on selected fields and to...
1
by: Bennett Haselton | last post by:
One of the most convenient features of Visual Studio .Net and ASP.Net is being able to add rows to a SQL Server database in an intellisense-safe way, with code like: ...
2
by: David Berman | last post by:
It seems that my site is losing session information when using Server.Transfer. I have a page called PictureGallery.aspx. It takes an argument which is an index id, so it would look like...
2
by: Barry | last post by:
Hi can anyone tell me if there if any code snippet available for creating a SQL Server Database and Table using C# web application. TIA Barry
2
by: George G. | last post by:
Hi there, I hope I am posting to the correct news group. What would be a good way to deal with null database values using ADO.NET. My SQL queries sometimes return null values when I have left...
2
by: Trond Hindenes | last post by:
Hello all, I am working on a application for analyzing data from a SQL Server Database using vb.net. THe application will mostly be web-based, although we migt use some Windows Forms for some of...
2
by: Recep TARAKÇI | last post by:
hi how i can read and write image file a sql server database. thanks
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.