Hi,
I want to use google map in my website.
I have 4 locations and I want to go to each location when link button for corresponding location is clicked.
Here is the code I am using
<script type="text/javascript">
function init_map() {
var myOptions = {
zoom: 6, center: new google.maps.LatLng(40.805478, -73.96522499999998), mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("gmap_canvas"), myOptions);
marker = new google.maps.Marker({ map: map, position: new google.maps.LatLng(40.805478, -73.96522499999998) });
infowindow = new google.maps.InfoWindow({ content: "india<br/>2880 Broadway<br/> New York" });
google.maps.event.addListener(marker, "click", function () { infowindow.open(map, marker); });
infowindow.open(map, marker);
}
google.maps.event.addDomListener(window, 'load', init_map);
function Goto(lat, long) {
debugger;
var myOptions = {
zoom: 6, center: new google.maps.LatLng(lat, long), mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("gmap_canvas"), myOptions);
marker = new google.maps.Marker({ map: map, position: new google.maps.LatLng(40.805478, -73.96522499999998) });
infowindow = new google.maps.InfoWindow({ content: "<br/>2880 Broadway<br/> New York" });
google.maps.event.addListener(marker, "click", function () { infowindow.open(map, marker); });
infowindow.open(map, marker);
}
</script>
body>
<form runat="server">
<asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="Goto(33.7018259,-117.85699)">1231 East Dyer Road</asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" OnClientClick="Goto(40.764847,-73.9782006)">123 West 57th Street</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" OnClientClick="Goto(22.3009512,114.172173)">Unit 1603, 16/F Miramar Tower</asp:LinkButton>
<asp:LinkButton ID="LinkButton4" runat="server" OnClientClick="Goto(48.8567,2.3508)">36-38 rue des Mathurins</asp:LinkButton>
</form>
</body>
What I am getting is whenever I click the link button it is not navigating to the location. Can you please help me.?
Thanks,
In advance