"Get Updates : Subscribe to our e-mail newsletter to receive updates........" "Good Luck frnds" Admission 2019 Application Form 2019 Colleges Entrance Exam 2019 Results 2019 Notification 2019 University Educational Jobs 2019 Government Jobs 2019

Search This Blog v24s guys

Follow by Email

03 April, 2013

Show Google Map with Latitude and Longitude in Asp.net Website


Here I will explain how to show Google map with latitude and longitude using JavaScript in asp.net website or Display Google map based on latitude and longitude in asp.net website example.


Before show Google map with latitude and longitude in website first we need to get Google API key for that please check below url

Once you got the key write the following code in your aspx or html page like as shown below 

<html xmlns="http://www.w3.org/1999/xhtml">
<title>Show Google Map with Latitude and Longitude in asp.net website</title>
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
<script type="text/javascript"
<script type="text/javascript">
function initialize() {
var lat = document.getElementById('txtlat').value;
var lon = document.getElementById('txtlon').value;
var myLatlng = new google.maps.LatLng(lat, lon) // This is used to center the map to show our markers
var mapOptions = {
center: myLatlng,
zoom: 6,
mapTypeId: google.maps.MapTypeId.ROADMAP,
marker: true
var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng
<body >
<form id="form1" runat="server">
<td>Enter Latitude:</td>
<td><input type="text" id="txtlat" value="13.053147716796578" /> </td>
<td>Enter Longitude:</td>
<td><input type="text" id="txtlon" value="80.2501953125" /> </td>
<td><input type="button" value="Submit" onclick="javascript:initialize()" /> </td>
<div id="map_canvas" style="width: 500px; height: 400px"></div>

No comments:

Popular Posts

Recent Posts

Google Analytics