Introduction Now days google map is very popular one. Since now google has given feature to display google map in asp.net pages with few lines of java script code. In this article have deatils about that.To this create web application using visual studio. it's bring up with new default.aspx page. Then within the default.aspx page design view , make html like following. {codecitation class="brush: html; gutter: true;" width="700px"} <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAcl" type="text/javascript"></script>
<script language="javascript" type="text/javascript"> function load() {
map = new GMap2(document.getElementById("map"));
map.addControl(new GMapTypeControl()); //Adding the control that allows to see the scale map.addControl(new GScaleControl());
map.setCenter(new GLatLng(Langitude, latitude), 14); // (Here you can set //your map Center . and 14 is zoom level of Map .)
map.addControl(new GLargeMapControl());
}
</script>
</head> <body onload="javascript:load();"> <form id="form1" runat="server"> <div id="map"> </div> </form> </body> </html> {/codecitation} That's now press F5 and run web it will show the map in page. Thank you Patel |