473,320 Members | 1,870 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,320 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 3022

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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.