Googlemaps
Hi coders can anyone assist me with my google map
right now Iam able to get google map to show upon entering address in textbox then clickin btnFind I need to know how to link to google map upon clicking on a certain address without having to enter address
my code so far
<script src="http://maps.google.com/maps?file=api&v=2&key=<YOUR_API_KEY>&senso r=false"
type="text/javascript"></script>
<script type="text/javascript">
var map;
var geocoder;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(51.5, -0.1), 10);
map.setUIToDefault();
geocoder = new GClientGeocoder();
}
}
function showAddress() {
var txtAddress = document.getElementById("<%=txtAddress.ClientID %>");
var address = txtAddress .value;
geocoder.getLatLng(
address,
function (point) {
if (!point) {
alert(address + " not found");
}
else {
map.setCenter(point, 15);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindow(address);
}
}
);
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtAddress" runat="server" />
<input type="button" value="Find" onclick="showAddress();" />
<%-- <asp:HyperLink ID="HyperLink1" runat="server">HyperLink</asp:HyperLink>--%>
</div>
<div id="map" style="width: 500px; height: 500px"></div>
</form>
</body>
|