Hi
Requirement:
1. when page get load infowindow should popup with default address
2. when the destination address added using get direction link a poly
line should added inside gmap and also direction should get displayed
in another div tag.
3. Need to add a back link inside info window.
Here is my entire code
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Googlemap_directions.aspx.cs"
Inherits="Googlemap_directions" %>
<!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 id="Head1" runat="server">
<title>Untitled Page</title>
<script src="http://maps.google.com/maps?
file=api&v=2&sensor=true&key=ABQIAAAAFZwuSLCqK11X9dhmzhWjEBRSkiNxopGQyy-
XZnT7KnCU4CKxhhTd2o3pgLoJME797WpRiIYd1pMNzQ"
type="text/javascript"></script>
</head>
<body onunload="GUnload()">
<!-- you can use tables or divs for the overall layout -->
<table border="1">
<tbody>
<tr>
<td>
<div id="map" style="width: 550px; height: 450px;
position: relative; background-color: rgb(229, 227, 223);">
<div style="overflow: hidden; position:
absolute; left: 0px; top: 0px; width: 100%;
height: 100%;">
<div style="position: absolute; left:
-77px; top: 5px; z-index: 0; cursor: url(http://maps.gstatic.com/intl/
en_ALL/mapfiles/openhand_8_8.cur), default;">
<div style="position: absolute; left:
0px; top: 0px; display: none;">
<div style="position: absolute;
left: 0px; top: 0px; z-index: 0;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
transparent.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; width: 256px; height: 256px;
-moz-user-select: none;">
</div>
</div>
<div style="position: absolute; left:
0px; top: 0px;">
<div style="position: absolute;
left: 0px; top: 0px; z-index: 0;">
<img src="example_map4c_files/
vap_003.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 753px; top: -122px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_002.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 753px; top: 134px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_006.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 753px; top: 390px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_005.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 753px; top: 646px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_015.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: -15px; top: -122px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_004.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: -15px; top: 134px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_010.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: -15px; top: 390px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_007.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: -15px; top: 646px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap.png" style="border: 0px none; margin: 0px; padding: 0px;
position: absolute; left:
241px; top: -122px; width: 256px; height: 256px; -moz-user-select:
none;">
<img src="example_map4c_files/
vap_009.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 241px; top: 134px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_016.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 241px; top: 390px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_014.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 241px; top: 646px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_013.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 497px; top: -122px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_008.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 497px; top: 134px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_011.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 497px; top: 390px; width: 256px; height: 256px;
-moz-user-select: none;">
<img src="example_map4c_files/
vap_012.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 497px; top: 646px; width: 256px; height: 256px;
-moz-user-select: none;">
</div>
</div>
<div style="position: absolute; left:
0px; top: 0px; z-index: 100;">
</div>
<div style="position: absolute; left:
0px; top: 0px; z-index: 101;">
</div>
<div style="position: absolute; left:
0px; top: 0px; z-index: 102;">
<img class="gmnoprint"
src="example_map4c_files/shadow50.png" style="border: 0px none;
margin: 0px; padding: 0px;
position: absolute; left: 69px; top: 318px; width: 37px;
height: 34px; -moz-user-
select: none; z-index: -139700928;">
<img class="gmnoprint"
src="example_map4c_files/shadow50.png" style="border: 0px none;
margin: 0px; padding: 0px;
position: absolute; left: 436px; top: 185px; width: 37px;
height: 34px; -moz-user-
select: none; z-index: -140540544;">
<img class="gmnoprint"
src="example_map4c_files/shadow50.png" style="border: 0px none;
margin: 0px; padding: 0px;
position: absolute; left: 360px; top: 232px; width: 37px;
height: 34px; -moz-user-
select: none; z-index: -140242848;">
</div>
<div style="position: absolute; left:
0px; top: 0px; z-index: 103;">
</div>
<div style="position: absolute; left:
0px; top: 0px; z-index: 104; cursor: default;">
<img src="example_map4c_files/
marker.png" style="border: 0px none; margin: 0px; padding: 0px;
width: 20px; height: 34px; -
moz-user-select: none; position: absolute; left: 69px;
top: 318px; z-index:
-139700928;">
<img src="example_map4c_files/
marker.png" style="border: 0px none; margin: 0px; padding: 0px;
width: 20px; height: 34px; -
moz-user-select: none; position: absolute; left: 436px;
top: 185px; z-index:
-140540544;">
<img src="example_map4c_files/
marker.png" style="border: 0px none; margin: 0px; padding: 0px;
width: 20px; height: 34px; -
moz-user-select: none; position: absolute; left: 360px;
top: 232px; z-index:
-140242848;">
</div>
<div style="position: absolute; left:
0px; top: 0px; z-index: 105;">
<div class="gmnoprint"
style="position: absolute; left: 313px; top: 158px; display: none;">
<div style="overflow: hidden;
width: 70px; height: 30px; z-index: 1; position: absolute;
left: 30px; top: 0px;">
<img
src="example_map4c_files/iws3.png" style="border: 0px none; margin:
0px; padding: 0px;
position: absolute;
left: -323px; top: 0px; width: 1144px; height: 370px; -moz-user-
select: none;">
</div>
<div style="overflow: hidden;
width: 70px; height: 30px; z-index: 1; position: absolute;
left: 259px; top: 0px;">
<img
src="example_map4c_files/iws3.png" style="border: 0px none; margin:
0px; padding: 0px;
position: absolute;
left: -1033px; top: 0px; width: 1144px; height: 370px; -moz-user-
select: none;">
</div>
<div style="overflow: hidden;
width: 70px; height: 60px; z-index: 1; position: absolute;
left: 0px; top: 31px;">
<img
src="example_map4c_files/iws3.png" style="border: 0px none; margin:
0px; padding: 0px;
position: absolute;
left: -14px; top: -310px; width: 1144px; height: 370px; -moz-user-
select: none;">
</div>
<div style="overflow: hidden;
width: 70px; height: 60px; z-index: 1; position: absolute;
left: 259px; top: 31px;">
<img
src="example_map4c_files/iws3.png" style="border: 0px none; margin:
0px; padding: 0px;
position: absolute;
left: -754px; top: -310px; width: 1144px; height: 370px;
-moz-user-select:
none;">
</div>
<div style="overflow: hidden;
width: 140px; height: 60px; z-index: 1; position: absolute;
left: 70px; top: 31px;">
<img
src="example_map4c_files/iws3.png" style="border: 0px none; margin:
0px; padding: 0px;
position: absolute;
left: -119px; top: -310px; width: 1144px; height: 370px;
-moz-user-select:
none;">
</div>
<div style="overflow: hidden;
position: absolute; left: 100px; top: 0px; width: 159px;
height: 30px;">
<div style="overflow:
hidden; width: 640px; height: 30px;">
<img
src="example_map4c_files/iws3.png" style="border: 0px none; margin:
0px; padding: 0px;
position:
absolute; left: -393px; top: 0px; width: 1144px; height: 370px; -moz-
user-select: none;">
</div>
</div>
<div style="overflow: hidden;
width: 71px; height: 1px; bottom: -1px; position: absolute;
left: 29px; top: 30px;">
<img
src="example_map4c_files/iws3.png" style="border: 0px none; margin:
0px; padding: 0px;
position: absolute;
left: -322px; top: -30px; -moz-user-select: none; width: 1144px;
height: 370px;">
</div>
<div style="overflow: hidden;
width: 71px; height: 1px; bottom: -1px; position: absolute;
left: 288px; top: 30px;">
<img
src="example_map4c_files/iws3.png" style="border: 0px none; margin:
0px; padding: 0px;
position: absolute;
left: -1062px; top: -30px; -moz-user-select: none; width: 1144px;
height: 370px;">
</div>
<div style="overflow: hidden;
position: absolute; left: 70px; top: 31px; width: 0px;
height: 60px;">
<div style="overflow:
hidden; width: 320px; height: 60px;">
<img
src="example_map4c_files/iws3.png" style="border: 0px none; margin:
0px; padding: 0px;
position:
absolute; left: -345px; top: -310px; width: 1144px; height: 370px;
-moz-user-select:
none;">
</div>
</div>
<div style="overflow: hidden;
position: absolute; left: 210px; top: 31px; width: 49px;
height: 60px;">
<div style="overflow:
hidden; width: 320px; height: 60px;">
<img
src="example_map4c_files/iws3.png" style="border: 0px none; margin:
0px; padding: 0px;
position:
absolute; left: -345px; top: -310px; width: 1144px; height: 370px;
-moz-user-select:
none;">
</div>
</div>
<div style="overflow: hidden;
position: absolute; left: 100px; top: 30px; width: 188px;
height: 1px;">
<div style="overflow:
hidden; width: 640px; height: 598px;">
<img
src="example_map4c_files/iws3.png" style="border: 0px none; margin:
0px; padding: 0px;
position:
absolute; left: -360px; top: -30px; width: 1144px; height: 370px; -moz-
user-select: none;">
</div>
</div>
</div>
</div>
<div style="position: absolute; left:
0px; top: 0px; z-index: 106;">
<img usemap="#gmimap0"
class="gmnoprint" src="example_map4c_files/markerTransparent.png"
style="border: 0px none;
margin: 0px; padding: 0px; position: absolute; left: 69px;
top: 318px; width: 20px;
height: 34px; -moz-user-select: none; z-index: -139700928;">
<map id="gmimap0" name="gmimap0">
<area id="mtgt_unnamed_0"
href="javascript:void(0)" alt="" shape="poly"
coords="9,0,6,1,4,2,2,4,0,8,0,12,1,14,2,16,5,19,7,23,8,26,9,30,9,34,11,34,11,30,12,26,13,24,14,21,16,18,18,16,20,12,20,8,18,4,16,2,15,1,13,0"
log="miw">
</map>
<img usemap="#gmimap1"
class="gmnoprint" src="example_map4c_files/markerTransparent.png"
style="border: 0px none;
margin: 0px; padding: 0px; position: absolute; left: 436px;
top: 185px; width: 20px;
height: 34px; -moz-user-select: none; z-index: -140540544;">
<map id="gmimap1" name="gmimap1">
<area id="mtgt_unnamed_1"
href="javascript:void(0)" alt="" shape="poly"
coords="9,0,6,1,4,2,2,4,0,8,0,12,1,14,2,16,5,19,7,23,8,26,9,30,9,34,11,34,11,30,12,26,13,24,14,21,16,18,18,16,20,12,20,8,18,4,16,2,15,1,13,0"
log="miw">
</map>
<img usemap="#gmimap2"
class="gmnoprint" src="example_map4c_files/markerTransparent.png"
style="border: 0px none;
margin: 0px; padding: 0px; position: absolute; left: 360px;
top: 232px; width: 20px;
height: 34px; -moz-user-select: none; z-index: -140242848;">
<map id="gmimap2" name="gmimap2">
<area id="mtgt_unnamed_2"
href="javascript:void(0)" alt="" shape="poly"
coords="9,0,6,1,4,2,2,4,0,8,0,12,1,14,2,16,5,19,7,23,8,26,9,30,9,34,11,34,11,30,12,26,13,24,14,21,16,18,18,16,20,12,20,8,18,4,16,2,15,1,13,0"
log="miw">
</map>
</div>
<div style="position: absolute; left:
0px; top: 0px; z-index: 107; cursor: default;">
<div class="gmnoprint"
style="position: absolute; left: 288px; top: 71px; display: none;">
<div class="gmnoprint"
style="position: relative; left: 0px; top: 0px; z-index: 10;
width: 249px; height:
92px;">
<img
src="example_map4c_files/iw_close.gif" style="border: 0px none;
margin: 0px;
padding: 0px;
position: absolute; left: 225px; top: 11px; width: 12px; height: 12px;
-moz-user-select:
none; cursor: pointer; z-index: 10000;">
<img
src="example_map4c_files/iw_plus.gif" style="border: 0px none; margin:
0px;
padding: 0px;
position: absolute; left: 0px; top: 0px; width: 12px; height: 12px;
-moz-user-select:
none; cursor: pointer; z-index: 10000; display: none;">
<a href="javascript:void
(0)" style="position: absolute; left: 0px; top: 0px; text-decoration:
none;
white-space: nowrap;
display: none;">
<img
src="example_map4c_files/iw_fullscreen.gif" style="border: 0px none;
margin: 0px;
padding: 0px;
position: relative; left: 0px; top: 0px; width: 15px; height: 12px;
-moz-user-select:
none; cursor: pointer; z-index: 10000; display: none; vertical-align:
top;"><span
style="overflow: hidden; font-size: small; text-decoration: underline;
padding-left: 5px;
position:
relative; top: -6px;">Full-screen</span></a>
<img
src="example_map4c_files/iw_minus.gif" style="border: 0px none;
margin: 0px;
padding: 0px;
position: absolute; left: 0px; top: 0px; width: 12px; height: 12px;
-moz-user-select:
none; cursor: pointer; z-index: 10000; display: none;">
</div>
<div style="overflow: hidden;
width: 25px; height: 25px; z-index: 1; position: absolute;
left: 0px; top: 0px;">
<img
src="example_map4c_files/iw3.png" style="border: 0px none; margin:
0px; padding: 0px;
position: absolute;
left: 0px; top: 0px; width: 690px; height: 786px; -moz-user-select:
none;">
</div>
<div style="overflow: hidden;
width: 25px; height: 25px; z-index: 1; position: absolute;
left: 224px; top: 0px;">
<img
src="example_map4c_files/iw3.png" style="border: 0px none; margin:
0px; padding: 0px;
position: absolute;
left: -665px; top: 0px; width: 690px; height: 786px; -moz-user-select:
none;">
</div>
<div style="overflow: hidden;
width: 97px; height: 96px; z-index: 1; position: absolute;
left: 76px; top: 67px;">
<img
src="example_map4c_files/iw3.png" style="border: 0px none; margin:
0px; padding: 0px;
position: absolute;
left: 0px; top: -691px; width: 690px; height: 786px; -moz-user-select:
none;">
</div>
<div style="overflow: hidden;
width: 25px; height: 25px; z-index: 1; position: absolute;
left: 0px; top: 67px;">
<img
src="example_map4c_files/iw3.png" style="border: 0px none; margin:
0px; padding: 0px;
position: absolute;
left: 0px; top: -665px; width: 690px; height: 786px; -moz-user-select:
none;">
</div>
<div style="overflow: hidden;
width: 25px; height: 25px; z-index: 1; position: absolute;
left: 224px; top: 67px;">
<img
src="example_map4c_files/iw3.png" style="border: 0px none; margin:
0px; padding: 0px;
position: absolute;
left: -665px; top: -665px; width: 690px; height: 786px; -moz-user-
select: none;">
</div>
<div style="border-top: 1px
solid rgb(171, 171, 171); position: absolute; left: 25px;
top: 0px; width: 199px;
height: 25px; background-color: white;">
</div>
<div style="border-left: 1px
solid rgb(171, 171, 171); border-right: 1px solid rgb(171, 171, 171);
position: absolute; left:
0px; top: 25px; width: 247px; height: 42px; background-color: white;">
</div>
<div style="border-bottom: 1px
solid rgb(171, 171, 171); position: absolute; left: 25px;
top: 67px; width: 199px;
height: 24px; background-color: white;">
</div>
</div>
</div>
</div>
</div>
<div id="logocontrol" style="-moz-user-select:
none; z-index: 0; position: absolute;
left: 2px; bottom: 2px;"
class="gmnoprint">
<a target="_blank" href="http://
maps.google.com/maps?
ll=43.91768,-79.148254&spn=0.890309,1.51062&z=9&key=ABQIAAAAPDUET0Qt7p2VcSk6JNU1sBSM5jMcmVqUpI7aqV44cW1cEECiThQYkcZUPRJn9vy_TWxWvuLoOfSFBw&sensor=false&mapclient=jsapi&oi=map_misc&ct=api_logo"
title="Click to see this area on
Google Maps">
<img src="example_map4c_files/
poweredby.png" style="border: 0px none; margin: 0px;
padding: 0px; width: 62px; height:
30px; -moz-user-select: none; cursor: pointer;"></a></div>
<div dir="ltr" style="-moz-user-select: none;
z-index: 0; position: absolute; right: 3px;
bottom: 2px; color: black; font-family:
Arial,sans-serif; font-size: 11px; white-space: nowrap;
text-align: right;">
<span></span><span>Map data ©2009 Tele
Atlas - </span><a style="color: rgb(119, 119, 204);"
target="_blank" href="http://
www.google.com/intl/en_ALL/help/terms_maps.html">Terms
of Use</a></div>
<div class="gmnoprint" style="overflow:
hidden; width: 59px; height: 272px; -moz-user-select: none;
z-index: 0; position: absolute; left: 7px;
top: 7px; text-align: left;">
<div style="position: absolute; left: 0px;
top: 0px; width: 59px; height: 62px;">
<div style="overflow: hidden; width:
59px; height: 62px; position: absolute;">
<img src="example_map4c_files/
mapcontrols2.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: 0px; -moz-user-select: none;
width: 59px; height: 458px;">
</div>
<div log="pan_up" title="Pan up"
style="position: absolute; left: 20px; top: 0px;
width: 18px; height: 18px; cursor:
pointer;">
</div>
<div log="pan_lt" title="Pan left"
style="position: absolute; left: 0px; top: 20px;
width: 18px; height: 18px; cursor:
pointer;">
</div>
<div log="pan_rt" title="Pan right"
style="position: absolute; left: 40px; top: 20px;
width: 18px; height: 18px; cursor:
pointer;">
</div>
<div log="pan_down" title="Pan down"
style="position: absolute; left: 20px; top: 40px;
width: 18px; height: 18px; cursor:
pointer;">
</div>
<div log="center_result" title="Return
to the last result" style="position: absolute;
left: 20px; top: 20px; width:
18px; height: 18px; cursor: pointer;">
</div>
</div>
<div id="lmcslider" style="overflow:
hidden; position: absolute; left: 0px; top: 62px;
width: 59px; height: 180px;">
<div style="overflow: hidden; width:
59px; height: 292px;">
<img src="example_map4c_files/
mapcontrols2.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: -62px; -moz-user-select: none;
width: 59px; height: 458px;">
</div>
<div title="Zoom In" style="position:
absolute; left: 20px; top: 0px; width: 18px;
height: 18px; cursor: pointer;">
</div>
</div>
<div style="position: absolute; left: 0px;
top: 242px; width: 59px; height: 30px;
text-align: left;">
<div style="overflow: hidden; width:
59px; height: 30px; position: absolute;">
<img src="example_map4c_files/
mapcontrols2.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: -354px; -moz-user-select: none;
width: 59px; height: 458px;">
</div>
<div title="Zoom Out" style="position:
absolute; left: 20px; top: 11px; width: 18px;
height: 18px; cursor: pointer;">
</div>
</div>
<div id="lmczb" style="position: absolute;
left: 19px; top: 86px; width: 22px; height: 166px;
cursor: pointer;">
<div title="Drag to zoom"
style="overflow: hidden; width: 22px; height: 14px; position:
absolute;
left: 0px; top: 80px; cursor: url
(http://maps.gstatic.com/intl/en_ALL/mapfiles/openhand_8_8.cur),
default;">
<img src="example_map4c_files/
mapcontrols2.png" style="border: 0px none; margin: 0px;
padding: 0px; position:
absolute; left: 0px; top: -384px; -moz-user-select: none;
width: 59px; height: 458px;">
</div>
</div>
</div>
<div style="-moz-user-select: none; z-index:
0; position: absolute; right: 7px; top: 7px;
color: black; font-family: Arial,sans-
serif; font-size: small; width: 200px;
height: 19px;" class="gmnoprint">
<div title="Show street map"
style="border: 1px solid black; position: absolute;
background-color: white; text-align:
center; width: 5em; cursor: pointer; right: 10.2em;">
<div style="border-style: solid;
border-color: rgb(52, 86, 132) rgb(108, 157, 223) rgb(108, 157, 223)
rgb(52, 86, 132);
border-width: 1px; font-size:
12px; font-weight: bold;">
Map</div>
</div>
<div title="Show satellite imagery"
style="border: 1px solid black; position: absolute;
background-color: white; text-align:
center; width: 5em; cursor: pointer; right: 5.1em;">
<div style="border-style: solid;
border-color: white rgb(176, 176, 176) rgb(176, 176, 176) white;
border-width: 1px; font-size:
12px;">
Satellite</div>
</div>
<div title="Show imagery with street
names" style="border: 1px solid black; position: absolute;
background-color: white; text-align:
center; width: 5em; cursor: pointer; right: 0em;">
<div style="border-style: solid;
border-color: white rgb(176, 176, 176) rgb(176, 176, 176) white;
border-width: 1px; font-size:
12px;">
Hybrid</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<noscript>
<b>JavaScript must be enabled in order for you to use Google
Maps.</b> However,
it seems JavaScript is either disabled or not supported by
your browser. To view
Google Maps, enable JavaScript by changing your browser
options, and then try again.
</noscript>
<script type="text/javascript">
//<![CDATA[
var geocoder = null;
if (GBrowserIsCompatible()) {
//var side_bar_html = "";
var gmarkers = [];
var htmls = [];
// arrays to hold variants of the info window html with get
direction forms open
var to_htmls = [];
var from_htmls = [];
// A function to create the marker and set up the event window
function createMarker(point,name,html) {
var marker = new GMarker(point);
var i = gmarkers.length;
// The info window version with the "to here" form open
to_htmls[i] = html + '<br>Get Directions: <b>To here<\/b> - <a
href="javascript:fromhere(' + i + ')">From here<\/a>' +
'<form action="javascript:getDirections()">' +
'Start address:<br><input type="text" SIZE=20 MAXLENGTH=40
name="saddr" id="saddr" value="" />' +
'<INPUT value="Go" TYPE="SUBMIT"><br>' +
'<input type="hidden" id="daddr" value="'+name+"@"+
point.lat() + ',' + point.lng() +
'"/><a href="javascript:GEvent.trigger(gmarkers[' +i+ '],
\"click\")" > << Back</a>';
// The info window version with the "from here" form open
from_htmls[i] = html + '<br>Get Directions: <a
href="javascript:tohere(' + i + ')">To here<\/a> - <b>From here<\/b>'
+
'<form action="javascript:getDirections()">' +
'End address:<br><input type="text" SIZE=20 MAXLENGTH=40
name="daddr" id="daddr" value="" />' +
'<INPUT value="Go" TYPE="SUBMIT"><br>' +
'<input type="hidden" id="saddr" value="'+name+"@"+
point.lat() + ',' + point.lng() +
'"/><a href="javascript:GEvent.trigger(gmarkers[' +i+ '],
\"click\")"> << Back</a>';
// The inactive version of the direction info
html = html + '<br><a href="javascript:tohere('+i+')">Get
directions<\/a>';
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
// var txt=document.getElementById("txtGmap");
// marker.openInfoWindowHtml("<p align='left'><b>Address :</
b><br/>"+txt.value+"</p>"+html);
});
// save the info we need to use later for the side_bar
gmarkers.push(marker);
htmls[i] = html;
// add a line to the side_bar html
//side_bar_html += '<a href="javascript:myclick(' + i + ')">'
+ name + '<\/a><br>';
return marker;
}
// ===== request the directions =====
function getDirections() {
// ==== Set up the walk and avoid highways options ====
var opts = {};
// if (document.getElementById("walk").checked) {
// opts.travelMode = G_TRAVEL_MODE_WALKING;
// }
// if (document.getElementById("highways").checked) {
// opts.avoidHighways = true;
// }
// ==== set the start and end locations ====
var saddr = document.getElementById("saddr").value
var daddr = document.getElementById("daddr").value
// gdir.load("from: "+saddr+" to: "+daddr, opts);
gdir.load("from: "+saddr+" to: "+daddr);
}
// This function picks up the click and opens the corresponding
info window
function myclick(i) {
gmarkers[i].openInfoWindowHtml(htmls[i]);
}
// functions that open the directions forms
function tohere(i) {
gmarkers[i].openInfoWindowHtml(to_htmls[i]);
}
function fromhere(i) {
gmarkers[i].openInfoWindowHtml(from_htmls[i]);
}
// create the map
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(43.907787,-79.359741), 9);
// geocoder = new GClientGeocoder();
// var txt=document.getElementById("txtGmap");
// if(txt.value != "")
// {
// showAddress(txt.value, txt1.value);
// }
// === create a GDirections Object ===
var gdir=new GDirections(map, document.getElementById
("directions"));
// === Array for decoding the failure codes ===
var reasons=[];
reasons[G_GEO_SUCCESS] = "Success";
reasons[G_GEO_MISSING_ADDRESS] = "Missing Address: The
address was either missing or had no value.";
reasons[G_GEO_UNKNOWN_ADDRESS] = "Unknown Address: No
corresponding geographic location could be found for the specified
address.";
reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address: The
geocode for the given address cannot be returned due to legal or
contractual reasons.";
reasons[G_GEO_BAD_KEY] = "Bad Key: The API key is
either invalid or does not match the domain for which it was given";
reasons[G_GEO_TOO_MANY_QUERIES] = "Too Many Queries: The daily
geocoding quota for this site has been exceeded.";
reasons[G_GEO_SERVER_ERROR] = "Server error: The geocoding
request could not be successfully processed.";
reasons[G_GEO_BAD_REQUEST] = "A directions request could
not be successfully parsed.";
reasons[G_GEO_MISSING_QUERY] = "No query was specified in
the input.";
reasons[G_GEO_UNKNOWN_DIRECTIONS] = "The GDirections object
could not compute directions between the points.";
// === catch Directions errors ===
GEvent.addListener(gdir, "error", function() {
var code = gdir.getStatus().code;
var reason="Code "+code;
if (reasons[code]) {
reason = reasons[code]
}
alert("Failed to obtain directions, "+reason);
});
// Set up three markers with info windows
// var txt=document.getElementById("txtGmap");
// var point = new GLatLng( 33.65654,-78.80138);
// var marker = createMarker(point,'Address',"<p
align='left'><b>Address :</b><br/>"+txt.value+"</p>")
// map.addOverlay(marker);
var point = new GLatLng( 43.65654,-79.90138);
var marker = createMarker(point,'Elm Street','<p
align="left"><b>Address :</b><br/>Royapettah,Chennai,India</p>With a
<a href="http://localhost/googlemap/Gmap_ballonpopup.aspx">Link<\/a>
to my home page<br>')
map.addOverlay(marker);
var point = new GLatLng( 43.91892,-78.89231);
var marker = createMarker(point,'The Bates Motel','Some stuff to
display in the<br>Second Info Window')
map.addOverlay(marker);
var point = new GLatLng(43.82589,-79.10040);
var marker = createMarker(point,'Here be dragons','Some stuff to
display in the<br>Third Info Window')
map.addOverlay(marker);
// // Read the data from example.xml
// var request = GXmlHttp.create();
// request.open("GET", "example.xml", true);
// request.onreadystatechange = function() {
// if (request.readyState == 4) {
// var xmlDoc = GXml.parse(request.responseText);
// // obtain the array of markers and loop through it
// var markers = xmlDoc.documentElement.getElementsByTagName
("marker");
//
// for (var i = 0; i < markers.length; i++) {
// // obtain the attribues of each marker
// var lat = parseFloat(markers[i].getAttribute("lat"));
// var lng = parseFloat(markers[i].getAttribute("lng"));
// var point = new GLatLng(lat,lng);
// var html = markers[i].getAttribute("html");
// var label = markers[i].getAttribute("label");
// // create the marker
// var marker = createMarker(point,label,html);
// map.addOverlay(marker);
// }
// // put the assembled side_bar_html contents into the
side_bar div
// //document.getElementById("side_bar").innerHTML =
side_bar_html;
// }
// }
// request.send(null);
}
else {
alert("Sorry, the Google Maps API is not compatible with this
browser");
}
// This Javascript is based on code provided by the
// Community Church Javascript Team
// http://www.bisphamchurch.org.uk/
// http://econym.org.uk/gmap/
//]]>
function showAddress(address, address1)
{
if (geocoder)
{
geocoder.getLatLng(
address,
function(point)
{
if (!point)
{
geocoder.getLatLng(address1,
function(point)
{
if (!point)
{
//alert("'"+address + "' not found in
google map");
}
else
{
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml("<p
align='left'><b>Address :</b><br/>"+address1+"</p>");
}
}
);
}
else
{
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml("<p align='left'><b>Address :</
b><br/>"+address+"</p>");
}
}
);
}
}
</script>
<form id="frmmap" runat="server">
<asp:TextBox ID="txtGmap" runat="server" Height="0px"
Width="0px" BackColor="Transparent"
BorderColor="Transparent" BorderStyle="None"
BorderWidth="0px" Text="Royapettah,Chennai,India"></asp:TextBox>
<asp:TextBox ID="txtGmapAlter" runat="server" Height="0px"
Width="0px" BackColor="Transparent"
BorderColor="Transparent" BorderStyle="None"
BorderWidth="0px" Text="Royapettah,Chennai,India"></asp:TextBox><br />
</form>
</body>
</html>
Its very urgent...
Kindly help me out to sort out the problem.
Thanks in advance.
Regards
Akthari
[email protected]
On Aug 13, 10:45 am, Mike Williams <[email protected]> wrote:
> Wasn't it Akthari who wrote:
>
>
>
> >Hi Thanks for your reply i made those changes mentioned by you.
>
> >how to add a back link in infowindow
>
> ><a href="#"> << Back</a> what i need to specify in href link.
>
> Probably:
>
> href="javascript:GEvent.trigger(gmarkers[" +i+ "], \"click\")"
>
> --
> Mike Williamshttp://econym.org.uk/gmap
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---