20
Answers

how to get latitude and logitude from sql server Asp.net

taqi nazir

taqi nazir

8y
630
1
how to get latitude and logitude from sql server  2008 ,Asp.net web form
 
i want to get title, latitude ,logitude and description from sql server 2008?
how to conncet sql server 2008?
i want to get title, latitude ,logitude and description from sql server 2008?
please guide me?? 
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="gmap.ascx.cs" Inherits="line.usercontrol.GMap" %>
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
</style>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
var markers = [
{
"title": "University",
"lat": 43.9801363,
"lng": 81.4439812,
"description": "University"
},
{
"title": "School",
"lat": 38.4887684,
"lng": 78.3207063,
"description": "School"
}
 
];
var mapOptions = {
center: new google.maps.LatLng(33.375321, 99.345116),
zoom: 5,
mapTypeId: google.maps.MapTypeId.ROADMAP
// marker:true
};
var infoWindow = new google.maps.InfoWindow();
var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
for (i = 0; i < markers.length; i++) {
var data = markers[i]
var myLatlng = new google.maps.LatLng(data.lat, data.lng);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: data.title
});
(function (marker, data) {
// Attaching a click event to the current marker
google.maps.event.addListener(marker, "click", function (e) {
infoWindow.setContent(data.description);
infoWindow.open(map, marker);
});
})(marker, data);
}
}
</script>
<body onload="initialize()">
<div id="map_canvas" style="width: 1150px; height: 450px">
</div>
</body>
 

Answers (20)