Integrate or show Google Maps in asp.net web site
Integrate or show or Add Google Maps in asp.net web site:
In this Post I will explain how to integrate Google map by JavaScript
in asp.net web site or show Google map in asp.net web Page. In this asp.nettutorial blog we give other Post related to google map application in asp.net
with different-different work Example. These are:-
JavaScript function for add map in asp.net page:
function initialize() {
var myLatlng = new
google.maps.LatLng(-34.397, 150.644)
var mapOptions = {
center: myLatlng,
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP,
marker: true
};
var map = new
google.maps.Map(document.getElementById("map_canvas"),
mapOptions);
}
Style of this asp.net page for display google Map:
<style type="text/css">
html
{
height: 100%;
}
body
{
height: 100%;
margin: 0;
padding: 0;
}
#map_canvas
{
height: 100%;
}
.style1
{
color: #990000;
text-decoration: underline;
font-size: x-large;
font-family: Arial, Helvetica, sans-serif;
}
</style>
Show google Mape by JavaScript in asp.net web Aplication:
<%@ Page
Language="C#"
AutoEventWireup="true"
CodeFile="Map.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>
<title>Integrate Google Maps in asp.net web</title>
<style type="text/css">
html
{
height: 100%;
}
body
{
height: 100%;
margin: 0;
padding: 0;
}
#map_canvas
{
height: 100%;
}
.style1
{
color: #990000;
text-decoration: underline;
font-size: x-large;
font-family: Arial, Helvetica, sans-serif;
}
</style>
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC6v5-2uaq_wusHDktM9ILcqIrlPtnZgEk&sensor=false">
</script>
<script type="text/javascript">
function initialize() {
var myLatlng = new
google.maps.LatLng(-34.397, 150.644)
var mapOptions = {
center: myLatlng,
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP,
marker: true
};
var map = new
google.maps.Map(document.getElementById("map_canvas"),
mapOptions);
}
</script>
</head>
<body onload="initialize()">
<form id="form1" runat="server">
<div align="center">
<h2 class="style1">
Integrate Google Maps in asp.net web site</h2>
<div id="map_canvas"
style="width: 800px; height: 500px">
</div>
</div>
</form>
</body>
</html>
Asp.net Grid View Related Post:
- How to Bind Gridview Form database.
- Show gridview Row Details.
- Templatefield in gridview
- Introduction of Asp.net grid view Control.
- Example of Templatefield in gridview .
- Example of DropDownList inside GridView
- Check box in ASP.NET GridView
- Ckeck box list example using javascript in grid.
- Check box in ASP.NET GridView
- Show grid view row details in to tooltip.
- How to Bind Gridview Form database.
- Show gridview Row Details And Give Example.
- Example of Templatefield in asp.net gridview.
- Example of DropDownList inside GridView control
- Introduction of Asp.net grid view Control.
- Example of C# for Bind Data to asp.net Textbox inside gridview control
- Bind Data to asp.net textbox control in inside of gridview Using C# Example
Comments
Post a Comment