How to implement google map
Code this on your .aspx page
<body onload="initialize()">
<form id="form1" runat="server">
<div id="gmap" style="width:100%; height:100%"></div>
</form></body>
Use this javascript function as:-
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644); // You can use this LatLng Value from your place
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("gmap"), myOptions);
}
</script>
Note:- Remove the below line from your aspx page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
0 Comment(s)